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

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

Issue 2539283002: Remove PlatformGestureEvent in favour of using WebGestureEvent (Closed)
Patch Set: Add missing copyright on new file Created 4 years 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
« no previous file with comments | « third_party/WebKit/Source/web/WebPagePopupImpl.cpp ('k') | third_party/WebKit/Source/web/WebViewImpl.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 8b29d6b25593c350c767b998e525d954315181aa..1bbd586a8ba8a4b50f1378a20a3dec77b9915835 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"
@@ -835,14 +834,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->nativeEvent().type == WebInputEvent::Undefined)
return;
- if (event->type() == EventTypeNames::gesturetapdown)
+ if (event->nativeEvent().type == WebInputEvent::GestureTapDown)
focusPlugin();
+
+ // Take a copy of the event and translate it into the coordinate
+ // system of the plugin.
+ WebGestureEvent translatedEvent = event->nativeEvent();
+ WebFloatPoint absoluteRootFrameLocation =
+ event->nativeEvent().positionInRootFrame();
+ IntPoint localPoint =
+ roundedIntPoint(m_element->layoutObject()->absoluteToLocal(
+ absoluteRootFrameLocation, UseTransforms));
+ translatedEvent.flattenTransform();
+ 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;
« no previous file with comments | « third_party/WebKit/Source/web/WebPagePopupImpl.cpp ('k') | third_party/WebKit/Source/web/WebViewImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698