Index: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java |
diff --git a/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java b/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java |
index a7da5bc527bc7450f9f1531519e47ec208285838..d973bcab6a1dbc528688296ac2d4b43d1d55ef34 100644 |
--- a/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java |
+++ b/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java |
@@ -1461,7 +1461,22 @@ public class ContentViewCore |
private void onRenderCoordinatesUpdated() { |
if (mContentViewGestureHandler == null) return; |
- mContentViewGestureHandler.updateHasFixedPageScale(mRenderCoordinates.hasFixedPageScale()); |
+ |
+ float minScale = mRenderCoordinates.getMinPageScaleFactor(); |
+ float maxScale = mRenderCoordinates.getMaxPageScaleFactor(); |
+ float pageScale = mRenderCoordinates.getPageScaleFactor(); |
+ float contentWidthCss = mRenderCoordinates.getContentWidthCss(); |
+ float windowWidthDp = pageScale * mRenderCoordinates.getLastFrameViewportWidthCss(); |
+ // We disable double tap zoom for pages that have a width=device-width |
+ // or narrower viewport (indicating that this is a mobile-optimized or |
+ // responsive website), as long as the user has not pinch-zoomed in by |
+ // more than 10% (in which case they might reasonably expect to be able |
+ // to zoom back out using double tap zoom). |
+ // It is also disabled for pages that disallow the user from zooming in |
+ // or out (even if they don't have a device-width or narrower viewport). |
+ boolean disable = (contentWidthCss <= windowWidthDp && pageScale < 1.1f * minScale) |
aelias_OOO_until_Jul13
2013/10/22 23:43:26
I don't like the "pageScale < 1.1f * minScale" con
jdduke (slow)
2013/10/22 23:57:49
I'd have to agree on this, all or nothing will sav
johnme
2013/10/23 11:46:07
After thinking about this for a little more, I agr
|
+ || minScale == maxScale; |
+ mContentViewGestureHandler.updateShouldDisableDoubleTap(disable); |
jdduke (slow)
2013/10/22 14:15:08
So the user can double-tap to zoom out, but then d
johnme
2013/10/22 15:57:58
Double-tap toggles between "overview zoom level" a
|
} |
private void hidePopupDialog() { |