WebTouchEventBuilder::WebTouchEventBuilder(const Widget* widget, const WebCore::RenderObject* renderObject, const TouchEvent& event) { if (event.type() == EventTypeNames::touchstart) type = TouchStart; else if (event.type() == EventTypeNames::touchmove) type = TouchMove; else if (event.type() == EventTypeNames::touchend) type = TouchEnd; else if (event.type() == EventTypeNames::touchcancel) type = TouchCancel; else { ASSERT_NOT_REACHED(); type = Undefined; return; } modifiers = getWebInputModifiers(event); timeStampSeconds = event.timeStamp() / millisPerSecond; addTouchPoints(widget, event.type(), event.touches(), touches, &touchesLength, renderObject); addTouchPoints(widget, event.type(), event.changedTouches(), changedTouches, &changedTouchesLength, renderObject); addTouchPoints(widget, event.type(), event.targetTouches(), targetTouches, &targetTouchesLength, renderObject); }
WebTouchEventBuilder::WebTouchEventBuilder(const Widget* widget, const TouchEvent& event) { if (event.type() == eventNames().touchstartEvent) type = TouchStart; else if (event.type() == eventNames().touchmoveEvent) type = TouchMove; else if (event.type() == eventNames().touchendEvent) type = TouchEnd; else if (event.type() == eventNames().touchcancelEvent) type = TouchCancel; else { ASSERT_NOT_REACHED(); type = Undefined; return; } modifiers = getWebInputModifiers(event); timeStampSeconds = event.timeStamp() / millisPerSecond; addTouchPoints(event.touches(), widget->location(), touches, &touchesLength); addTouchPoints(event.changedTouches(), widget->location(), changedTouches, &changedTouchesLength); addTouchPoints(event.targetTouches(), widget->location(), targetTouches, &targetTouchesLength); }