Chromium Mac: PDF: Scrollsbars should be visible when scrolling using the two finger...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 1 Sep 2011 01:31:50 +0000 (01:31 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 1 Sep 2011 01:31:50 +0000 (01:31 +0000)
https://bugs.webkit.org/show_bug.cgi?id=66599

Patch by Sailesh Agrawal <sail@chromium.org> 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):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@94261 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit/chromium/ChangeLog
Source/WebKit/chromium/src/WebPluginContainerImpl.cpp
Source/WebKit/chromium/src/WebPluginContainerImpl.h
Source/WebKit/chromium/src/WebViewImpl.cpp

index 576eee0..23602e5 100644 (file)
@@ -1,5 +1,22 @@
 2011-08-31  Sailesh Agrawal  <sail@chromium.org>
 
+        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  <sail@chromium.org>
+
         Chromium Mac: Add fallback for drawing PDF overhang area
         https://bugs.webkit.org/show_bug.cgi?id=66614
 
index 84eb06d..ac723f2 100644 (file)
 #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 @@ bool WebPluginContainerImpl::paintCustomOverhangArea(GraphicsContext* context, c
     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)
index 45bd181..1d26fab 100644 (file)
@@ -51,6 +51,10 @@ class PluginLayerChromium;
 class ResourceError;
 class ResourceResponse;
 class WheelEvent;
+
+#if ENABLE(GESTURE_EVENTS)
+class PlatformGestureEvent;
+#endif
 }
 
 namespace WebKit {
@@ -136,6 +140,10 @@ public:
 
     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();
index 58009db..e2b902a 100644 (file)
@@ -590,7 +590,14 @@ bool WebViewImpl::mouseWheel(const WebMouseWheelEvent& event)
 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