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 88e7a9f10b0eaaa103191c2aa135b038427d9863..4e080b98369d9278e8016782aac93aa33c542727 100644 |
--- a/third_party/WebKit/Source/web/WebPluginContainerImpl.cpp |
+++ b/third_party/WebKit/Source/web/WebPluginContainerImpl.cpp |
@@ -70,7 +70,6 @@ |
#include "modules/plugins/PluginOcclusionSupport.h" |
#include "platform/HostWindow.h" |
#include "platform/KeyboardCodes.h" |
-#include "platform/PlatformGestureEvent.h" |
#include "platform/RuntimeEnabledFeatures.h" |
#include "platform/UserGestureIndicator.h" |
#include "platform/exported/WrappedResourceResponse.h" |
@@ -847,14 +846,25 @@ void WebPluginContainerImpl::handleTouchEvent(TouchEvent* event) { |
} |
void WebPluginContainerImpl::handleGestureEvent(GestureEvent* event) { |
- WebGestureEventBuilder webEvent(LayoutItem(m_element->layoutObject()), |
- *event); |
- if (webEvent.type == WebInputEvent::Undefined) |
+ if (event->originalEvent().type == WebInputEvent::Undefined) |
return; |
- if (event->type() == EventTypeNames::gesturetapdown) |
+ if (event->originalEvent().type == WebInputEvent::GestureTapDown) |
focusPlugin(); |
+ |
+ // Take a copy of the event and translate it into the coordinate |
+ // system of the plugin. |
+ WebGestureEvent translatedEvent = event->originalEvent(); |
+ WebFloatPoint absoluteRootFrameLocation = |
+ event->originalEvent().positionInRootFrame(); |
+ IntPoint localPoint = |
+ roundedIntPoint(m_element->layoutObject()->absoluteToLocal( |
+ absoluteRootFrameLocation, UseTransforms)); |
+ translatedEvent.flattenScale(); |
+ translatedEvent.x = localPoint.x(); |
+ translatedEvent.y = localPoint.y(); |
+ |
WebCursorInfo cursorInfo; |
- if (m_webPlugin->handleInputEvent(webEvent, cursorInfo) != |
+ if (m_webPlugin->handleInputEvent(translatedEvent, cursorInfo) != |
WebInputEventResult::NotHandled) { |
event->setDefaultHandled(); |
return; |