Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(576)

Unified Diff: third_party/WebKit/Source/web/WebPluginContainerImpl.cpp

Issue 2646163002: Remove PlatformTouchEvent/Point and use WebTouchEvent/Point instead (Closed)
Patch Set: Fix nit Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/web/WebPluginContainerImpl.cpp
diff --git a/third_party/WebKit/Source/web/WebPluginContainerImpl.cpp b/third_party/WebKit/Source/web/WebPluginContainerImpl.cpp
index 4301e301358579e03df0c6dd2ba64b8d4aba52cf..865ab971dcd5c3fed6e2c9190af33f2ec1692d47 100644
--- a/third_party/WebKit/Source/web/WebPluginContainerImpl.cpp
+++ b/third_party/WebKit/Source/web/WebPluginContainerImpl.cpp
@@ -815,16 +815,26 @@ void WebPluginContainerImpl::handleTouchEvent(TouchEvent* event) {
case TouchEventRequestTypeNone:
return;
case TouchEventRequestTypeRaw: {
- WebTouchEventBuilder webEvent(LayoutItem(m_element->layoutObject()),
- *event);
- if (webEvent.type() == WebInputEvent::Undefined)
+ if (!event->nativeEvent())
return;
if (event->type() == EventTypeNames::touchstart)
focusPlugin();
+ WebTouchEvent transformedEvent = event->nativeEvent()->flattenTransform();
+
+ for (unsigned i = 0; i < transformedEvent.touchesLength; ++i) {
+ WebFloatPoint absoluteRootFrameLocation =
+ transformedEvent.touches[i].position;
+ IntPoint localPoint =
+ roundedIntPoint(m_element->layoutObject()->absoluteToLocal(
+ absoluteRootFrameLocation, UseTransforms));
+ transformedEvent.touches[i].position.x = localPoint.x();
+ transformedEvent.touches[i].position.y = localPoint.y();
+ }
+
WebCursorInfo cursorInfo;
- if (m_webPlugin->handleInputEvent(webEvent, cursorInfo) !=
+ if (m_webPlugin->handleInputEvent(transformedEvent, cursorInfo) !=
WebInputEventResult::NotHandled)
event->setDefaultHandled();
// FIXME: Can a plugin change the cursor from a touch-event callback?

Powered by Google App Engine
This is Rietveld 408576698