Title: [94261] trunk/Source/WebKit/chromium
Revision
94261
Author
[email protected]
Date
2011-08-31 18:31:50 -0700 (Wed, 31 Aug 2011)

Log Message

Chromium Mac: PDF: Scrollsbars should be visible when scrolling using the two finger gesture on Lion
https://bugs.webkit.org/show_bug.cgi?id=66599

Patch by Sailesh Agrawal <[email protected]> on 2011-08-31
Reviewed by Darin Fisher.

Overlay scrollbars over a pdf wouldn't stay visible if a gesture was in progress. Normally we use a beginScrollGesture and endScrollGesture to keep the scrollbars visible. Unfortunately PDFs didn't handle gesture events so we didn't get the begin/end gesture events.

This change pipes gesture events to WebPluginContainerImpl if possible. This fixes this bug.

* src/WebPluginContainerImpl.cpp:
(WebKit::WebPluginContainerImpl::handleGestureEvent):
* src/WebPluginContainerImpl.h:
* src/WebViewImpl.cpp:
(WebKit::WebViewImpl::gestureEvent):

Modified Paths

Diff

Modified: trunk/Source/WebKit/chromium/ChangeLog (94260 => 94261)


--- trunk/Source/WebKit/chromium/ChangeLog	2011-09-01 01:22:22 UTC (rev 94260)
+++ trunk/Source/WebKit/chromium/ChangeLog	2011-09-01 01:31:50 UTC (rev 94261)
@@ -1,5 +1,22 @@
 2011-08-31  Sailesh Agrawal  <[email protected]>
 
+        Chromium Mac: PDF: Scrollsbars should be visible when scrolling using the two finger gesture on Lion
+        https://bugs.webkit.org/show_bug.cgi?id=66599
+
+        Reviewed by Darin Fisher.
+
+        Overlay scrollbars over a pdf wouldn't stay visible if a gesture was in progress. Normally we use a beginScrollGesture and endScrollGesture to keep the scrollbars visible. Unfortunately PDFs didn't handle gesture events so we didn't get the begin/end gesture events.
+
+        This change pipes gesture events to WebPluginContainerImpl if possible. This fixes this bug.
+
+        * src/WebPluginContainerImpl.cpp:
+        (WebKit::WebPluginContainerImpl::handleGestureEvent):
+        * src/WebPluginContainerImpl.h:
+        * src/WebViewImpl.cpp:
+        (WebKit::WebViewImpl::gestureEvent):
+
+2011-08-31  Sailesh Agrawal  <[email protected]>
+
         Chromium Mac: Add fallback for drawing PDF overhang area
         https://bugs.webkit.org/show_bug.cgi?id=66614
 

Modified: trunk/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp (94260 => 94261)


--- trunk/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp	2011-09-01 01:22:22 UTC (rev 94260)
+++ trunk/Source/WebKit/chromium/src/WebPluginContainerImpl.cpp	2011-09-01 01:31:50 UTC (rev 94261)
@@ -76,6 +76,10 @@
 #include "UserGestureIndicator.h"
 #include "WheelEvent.h"
 
+#if ENABLE(GESTURE_EVENTS)
+#include "PlatformGestureEvent.h"
+#endif
+
 #if WEBKIT_USING_SKIA
 #include "PlatformContextSkia.h"
 #endif
@@ -481,6 +485,17 @@
     return true;
 }
 
+#if ENABLE(GESTURE_EVENTS)
+bool WebPluginContainerImpl::handleGestureEvent(const WebCore::PlatformGestureEvent& gestureEvent)
+{
+    if (m_scrollbarGroup) {
+        m_scrollbarGroup->handleGestureEvent(gestureEvent);
+        return true;
+    }
+    return false;
+}
+#endif
+
 // Private methods -------------------------------------------------------------
 
 WebPluginContainerImpl::WebPluginContainerImpl(WebCore::HTMLPlugInElement* element, WebPlugin* webPlugin)

Modified: trunk/Source/WebKit/chromium/src/WebPluginContainerImpl.h (94260 => 94261)


--- trunk/Source/WebKit/chromium/src/WebPluginContainerImpl.h	2011-09-01 01:22:22 UTC (rev 94260)
+++ trunk/Source/WebKit/chromium/src/WebPluginContainerImpl.h	2011-09-01 01:31:50 UTC (rev 94261)
@@ -51,6 +51,10 @@
 class ResourceError;
 class ResourceResponse;
 class WheelEvent;
+
+#if ENABLE(GESTURE_EVENTS)
+class PlatformGestureEvent;
+#endif
 }
 
 namespace WebKit {
@@ -136,6 +140,10 @@
 
     bool paintCustomOverhangArea(WebCore::GraphicsContext*, const WebCore::IntRect&, const WebCore::IntRect&, const WebCore::IntRect&);
 
+#if ENABLE(GESTURE_EVENTS)
+    bool handleGestureEvent(const WebCore::PlatformGestureEvent&);
+#endif
+
 private:
     WebPluginContainerImpl(WebCore::HTMLPlugInElement* element, WebPlugin* webPlugin);
     ~WebPluginContainerImpl();

Modified: trunk/Source/WebKit/chromium/src/WebViewImpl.cpp (94260 => 94261)


--- trunk/Source/WebKit/chromium/src/WebViewImpl.cpp	2011-09-01 01:22:22 UTC (rev 94260)
+++ trunk/Source/WebKit/chromium/src/WebViewImpl.cpp	2011-09-01 01:31:50 UTC (rev 94261)
@@ -590,7 +590,14 @@
 bool WebViewImpl::gestureEvent(const WebGestureEvent& event)
 {
     PlatformGestureEventBuilder platformEvent(mainFrameImpl()->frameView(), event);
-    return mainFrameImpl()->frame()->eventHandler()->handleGestureEvent(platformEvent);
+    bool handled = mainFrameImpl()->frame()->eventHandler()->handleGestureEvent(platformEvent);
+
+    Frame* frame = mainFrameImpl()->frame();
+    WebPluginContainerImpl* pluginContainer = WebFrameImpl::pluginContainerFromFrame(frame);
+    if (pluginContainer)
+        handled |= pluginContainer->handleGestureEvent(platformEvent);
+
+    return handled;
 }
 #endif
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to