Title: [120992] trunk/Source/WebKit/chromium
Revision
120992
Author
[email protected]
Date
2012-06-21 19:05:13 -0700 (Thu, 21 Jun 2012)

Log Message

[chromium] Add touch-event support for WebPluginContainerImpl
https://bugs.webkit.org/show_bug.cgi?id=89089

Patch by Sadrul Habib Chowdhury <[email protected]> on 2012-06-21
Reviewed by Adam Barth.

* src/WebPluginContainerImpl.cpp:
(WebKit::WebPluginContainerImpl::handleEvent):
* src/WebPluginContainerImpl.h:
(WebCore):
(WebPluginContainerImpl):

Modified Paths

Diff

Modified: trunk/Source/WebKit/chromium/ChangeLog (120991 => 120992)


--- trunk/Source/WebKit/chromium/ChangeLog	2012-06-22 02:02:38 UTC (rev 120991)
+++ trunk/Source/WebKit/chromium/ChangeLog	2012-06-22 02:05:13 UTC (rev 120992)
@@ -1,3 +1,16 @@
+2012-06-21  Sadrul Habib Chowdhury  <[email protected]>
+
+        [chromium] Add touch-event support for WebPluginContainerImpl
+        https://bugs.webkit.org/show_bug.cgi?id=89089
+
+        Reviewed by Adam Barth.
+
+        * src/WebPluginContainerImpl.cpp:
+        (WebKit::WebPluginContainerImpl::handleEvent):
+        * src/WebPluginContainerImpl.h:
+        (WebCore):
+        (WebPluginContainerImpl):
+
 2012-06-21  Oli Lan  <[email protected]>
 
         Add methods to select between offsets in an editable field.

Modified: trunk/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp (120991 => 120992)


--- trunk/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp	2012-06-22 02:02:38 UTC (rev 120991)
+++ trunk/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp	2012-06-22 02:05:13 UTC (rev 120992)
@@ -71,6 +71,7 @@
 #include "ScrollAnimator.h"
 #include "ScrollView.h"
 #include "ScrollbarTheme.h"
+#include "TouchEvent.h"
 #include "UserGestureIndicator.h"
 #include "WebPrintParams.h"
 #include "WheelEvent.h"
@@ -185,6 +186,8 @@
         handleWheelEvent(static_cast<WheelEvent*>(event));
     else if (event->isKeyboardEvent())
         handleKeyboardEvent(static_cast<KeyboardEvent*>(event));
+    else if (eventNames().isTouchEventType(event->type()))
+        handleTouchEvent(static_cast<TouchEvent*>(event));
 
     // FIXME: it would be cleaner if Widget::handleEvent returned true/false and
     // HTMLPluginElement called setDefaultHandled or defaultEventHandler.
@@ -682,6 +685,17 @@
         event->setDefaultHandled();
 }
 
+void WebPluginContainerImpl::handleTouchEvent(TouchEvent* event)
+{
+    WebTouchEventBuilder webEvent(this, *event);
+    if (webEvent.type == WebInputEvent::Undefined)
+        return;
+    WebCursorInfo cursorInfo;
+    if (m_webPlugin->handleInputEvent(webEvent, cursorInfo))
+        event->setDefaultHandled();
+    // FIXME: Can a plugin change the cursor from a touch-event callback?
+}
+
 void WebPluginContainerImpl::calculateGeometry(const IntRect& frameRect,
                                                IntRect& windowRect,
                                                IntRect& clipRect,

Modified: trunk/Source/WebKit/chromium/src/WebPluginContainerImpl.h (120991 => 120992)


--- trunk/Source/WebKit/chromium/src/WebPluginContainerImpl.h	2012-06-22 02:02:38 UTC (rev 120991)
+++ trunk/Source/WebKit/chromium/src/WebPluginContainerImpl.h	2012-06-22 02:05:13 UTC (rev 120992)
@@ -52,6 +52,7 @@
 class MouseEvent;
 class ResourceError;
 class ResourceResponse;
+class TouchEvent;
 class WheelEvent;
 
 #if ENABLE(GESTURE_EVENTS)
@@ -160,6 +161,7 @@
     void handleMouseEvent(WebCore::MouseEvent*);
     void handleWheelEvent(WebCore::WheelEvent*);
     void handleKeyboardEvent(WebCore::KeyboardEvent*);
+    void handleTouchEvent(WebCore::TouchEvent*);
 
     void calculateGeometry(const WebCore::IntRect& frameRect,
                            WebCore::IntRect& windowRect,
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to