Title: [131965] trunk/Source/WebKit/chromium
Revision
131965
Author
[email protected]
Date
2012-10-19 17:19:40 -0700 (Fri, 19 Oct 2012)

Log Message

[chromium] Double-tap defaults to zoom (should only do this on Android)
https://bugs.webkit.org/show_bug.cgi?id=99600

Patch by Yusuf Ozuysal <[email protected]> on 2012-10-19
Reviewed by Adam Barth.

Adds a web setting for enabling DoubleTapToZoom on a doubleTap gesture.
This gesture was just needed for mobile, and the patch that implemented it caused regressions on other platforms.

* public/WebSettings.h:
* src/WebSettingsImpl.cpp:
(WebKit::WebSettingsImpl::WebSettingsImpl):
(WebKit::WebSettingsImpl::setDoubleTapToZoomEnabled):
(WebKit):
* src/WebSettingsImpl.h:
(WebSettingsImpl):
(WebKit::WebSettingsImpl::doubleTapToZoomEnabled):
* src/WebViewImpl.cpp:
(WebKit::WebViewImpl::handleGestureEvent):
* tests/WebFrameTest.cpp:

Modified Paths

Diff

Modified: trunk/Source/WebKit/chromium/ChangeLog (131964 => 131965)


--- trunk/Source/WebKit/chromium/ChangeLog	2012-10-20 00:15:23 UTC (rev 131964)
+++ trunk/Source/WebKit/chromium/ChangeLog	2012-10-20 00:19:40 UTC (rev 131965)
@@ -1,3 +1,25 @@
+2012-10-19  Yusuf Ozuysal  <[email protected]>
+
+        [chromium] Double-tap defaults to zoom (should only do this on Android)
+        https://bugs.webkit.org/show_bug.cgi?id=99600
+
+        Reviewed by Adam Barth.
+
+        Adds a web setting for enabling DoubleTapToZoom on a doubleTap gesture.
+        This gesture was just needed for mobile, and the patch that implemented it caused regressions on other platforms.
+
+        * public/WebSettings.h:
+        * src/WebSettingsImpl.cpp:
+        (WebKit::WebSettingsImpl::WebSettingsImpl):
+        (WebKit::WebSettingsImpl::setDoubleTapToZoomEnabled):
+        (WebKit):
+        * src/WebSettingsImpl.h:
+        (WebSettingsImpl):
+        (WebKit::WebSettingsImpl::doubleTapToZoomEnabled):
+        * src/WebViewImpl.cpp:
+        (WebKit::WebViewImpl::handleGestureEvent):
+        * tests/WebFrameTest.cpp:
+
 2012-10-19  Sheriff Bot  <[email protected]>
 
         Unreviewed, rolling out r131944.

Modified: trunk/Source/WebKit/chromium/public/WebSettings.h (131964 => 131965)


--- trunk/Source/WebKit/chromium/public/WebSettings.h	2012-10-20 00:15:23 UTC (rev 131964)
+++ trunk/Source/WebKit/chromium/public/WebSettings.h	2012-10-20 00:19:40 UTC (rev 131965)
@@ -90,6 +90,7 @@
     virtual void setDeveloperExtrasEnabled(bool) = 0;
     virtual void setDeviceSupportsMouse(bool) = 0;
     virtual void setDeviceSupportsTouch(bool) = 0;
+    virtual void setDoubleTapToZoomEnabled(bool) = 0;
     virtual void setDownloadableBinaryFontsEnabled(bool) = 0;
     virtual void setEditableLinkBehaviorNeverLive() = 0;
     virtual void setEditingBehavior(EditingBehavior) = 0;

Modified: trunk/Source/WebKit/chromium/src/WebSettingsImpl.cpp (131964 => 131965)


--- trunk/Source/WebKit/chromium/src/WebSettingsImpl.cpp	2012-10-20 00:15:23 UTC (rev 131964)
+++ trunk/Source/WebKit/chromium/src/WebSettingsImpl.cpp	2012-10-20 00:19:40 UTC (rev 131965)
@@ -57,6 +57,7 @@
     , m_gestureTapHighlightEnabled(true)
     , m_autoZoomFocusedNodeToLegibleScale(false)
     , m_deferredImageDecodingEnabled(false)
+    , m_doubleTapToZoomEnabled(false)
     , m_defaultTileSize(WebSize(256, 256))
     , m_maxUntiledLayerSize(WebSize(512, 512))
 {
@@ -266,6 +267,11 @@
     m_settings->setPageCacheSupportsPlugins(pageCacheSupportsPlugins);
 }
 
+void WebSettingsImpl::setDoubleTapToZoomEnabled(bool doubleTapToZoomEnabled)
+{
+    m_doubleTapToZoomEnabled = doubleTapToZoomEnabled;
+}
+
 void WebSettingsImpl::setDownloadableBinaryFontsEnabled(bool enabled)
 {
     m_settings->setDownloadableBinaryFontsEnabled(enabled);

Modified: trunk/Source/WebKit/chromium/src/WebSettingsImpl.h (131964 => 131965)


--- trunk/Source/WebKit/chromium/src/WebSettingsImpl.h	2012-10-20 00:15:23 UTC (rev 131964)
+++ trunk/Source/WebKit/chromium/src/WebSettingsImpl.h	2012-10-20 00:19:40 UTC (rev 131965)
@@ -82,6 +82,7 @@
     virtual void setDeveloperExtrasEnabled(bool);
     virtual void setDeviceSupportsMouse(bool);
     virtual void setDeviceSupportsTouch(bool);
+    virtual void setDoubleTapToZoomEnabled(bool);
     virtual void setDownloadableBinaryFontsEnabled(bool);
     virtual void setEditableLinkBehaviorNeverLive();
     virtual void setEditingBehavior(EditingBehavior);
@@ -166,6 +167,7 @@
     bool applyPageScaleFactorInCompositor() const;
     bool autoZoomFocusedNodeToLegibleScale() const { return m_autoZoomFocusedNodeToLegibleScale; }
     bool gestureTapHighlightEnabled() { return m_gestureTapHighlightEnabled; }
+    bool doubleTapToZoomEnabled() { return m_doubleTapToZoomEnabled; }
     WebSize defaultTileSize() const { return m_defaultTileSize; }
     WebSize maxUntiledLayerSize() const { return m_maxUntiledLayerSize; }
 
@@ -180,6 +182,7 @@
     bool m_gestureTapHighlightEnabled;
     bool m_autoZoomFocusedNodeToLegibleScale;
     bool m_deferredImageDecodingEnabled;
+    bool m_doubleTapToZoomEnabled;
     WebSize m_defaultTileSize;
     WebSize m_maxUntiledLayerSize;
 };

Modified: trunk/Source/WebKit/chromium/src/WebViewImpl.cpp (131964 => 131965)


--- trunk/Source/WebKit/chromium/src/WebViewImpl.cpp	2012-10-20 00:15:23 UTC (rev 131964)
+++ trunk/Source/WebKit/chromium/src/WebViewImpl.cpp	2012-10-20 00:19:40 UTC (rev 131965)
@@ -775,10 +775,12 @@
         break;
     }
     case WebInputEvent::GestureDoubleTap:
-        m_client->cancelScheduledContentIntents();
-        animateZoomAroundPoint(WebPoint(event.x, event.y), DoubleTap);
-        eventSwallowed = true;
-        break;
+        if (m_webSettings->doubleTapToZoomEnabled()) {
+            m_client->cancelScheduledContentIntents();
+            animateZoomAroundPoint(WebPoint(event.x, event.y), DoubleTap);
+            eventSwallowed = true;
+            break;
+        }
     case WebInputEvent::GestureScrollBegin:
     case WebInputEvent::GesturePinchBegin:
         m_client->cancelScheduledContentIntents();
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to