Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(120)

Side by Side Diff: content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java

Issue 18850005: Disable double tap zoom on mobile sites, to remove 300ms click delay (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rewrite, taking into account crrev.com/27043004 Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | content/public/android/java/src/org/chromium/content/browser/ContentViewGestureHandler.java » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package org.chromium.content.browser; 5 package org.chromium.content.browser;
6 6
7 import android.app.Activity; 7 import android.app.Activity;
8 import android.app.SearchManager; 8 import android.app.SearchManager;
9 import android.content.ContentResolver; 9 import android.content.ContentResolver;
10 import android.content.Context; 10 import android.content.Context;
(...skipping 1443 matching lines...) Expand 10 before | Expand all | Expand 10 after
1454 } 1454 }
1455 1455
1456 @Override 1456 @Override
1457 public boolean didUIStealScroll(float x, float y) { 1457 public boolean didUIStealScroll(float x, float y) {
1458 return getContentViewClient().shouldOverrideScroll( 1458 return getContentViewClient().shouldOverrideScroll(
1459 x, y, computeHorizontalScrollOffset(), computeVerticalScrollOffs et()); 1459 x, y, computeHorizontalScrollOffset(), computeVerticalScrollOffs et());
1460 } 1460 }
1461 1461
1462 private void onRenderCoordinatesUpdated() { 1462 private void onRenderCoordinatesUpdated() {
1463 if (mContentViewGestureHandler == null) return; 1463 if (mContentViewGestureHandler == null) return;
1464 mContentViewGestureHandler.updateHasFixedPageScale(mRenderCoordinates.ha sFixedPageScale()); 1464
1465 float minScale = mRenderCoordinates.getMinPageScaleFactor();
1466 float maxScale = mRenderCoordinates.getMaxPageScaleFactor();
1467 float pageScale = mRenderCoordinates.getPageScaleFactor();
1468 float contentWidthCss = mRenderCoordinates.getContentWidthCss();
1469 float windowWidthDp = pageScale * mRenderCoordinates.getLastFrameViewpor tWidthCss();
1470 // We disable double tap zoom for pages that have a width=device-width
1471 // or narrower viewport (indicating that this is a mobile-optimized or
1472 // responsive website), as long as the user has not pinch-zoomed in by
1473 // more than 10% (in which case they might reasonably expect to be able
1474 // to zoom back out using double tap zoom).
1475 // It is also disabled for pages that disallow the user from zooming in
1476 // or out (even if they don't have a device-width or narrower viewport).
1477 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
1478 || minScale == maxScale;
1479 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
1465 } 1480 }
1466 1481
1467 private void hidePopupDialog() { 1482 private void hidePopupDialog() {
1468 SelectPopupDialog.hide(this); 1483 SelectPopupDialog.hide(this);
1469 hideHandles(); 1484 hideHandles();
1470 hideSelectActionBar(); 1485 hideSelectActionBar();
1471 } 1486 }
1472 1487
1473 void hideSelectActionBar() { 1488 void hideSelectActionBar() {
1474 if (mActionMode != null) { 1489 if (mActionMode != null) {
(...skipping 1819 matching lines...) Expand 10 before | Expand all | Expand 10 after
3294 3309
3295 private native void nativeAttachExternalVideoSurface( 3310 private native void nativeAttachExternalVideoSurface(
3296 int nativeContentViewCoreImpl, int playerId, Surface surface); 3311 int nativeContentViewCoreImpl, int playerId, Surface surface);
3297 3312
3298 private native void nativeDetachExternalVideoSurface( 3313 private native void nativeDetachExternalVideoSurface(
3299 int nativeContentViewCoreImpl, int playerId); 3314 int nativeContentViewCoreImpl, int playerId);
3300 3315
3301 private native void nativeSetAccessibilityEnabled( 3316 private native void nativeSetAccessibilityEnabled(
3302 int nativeContentViewCoreImpl, boolean enabled); 3317 int nativeContentViewCoreImpl, boolean enabled);
3303 } 3318 }
OLDNEW
« no previous file with comments | « no previous file | content/public/android/java/src/org/chromium/content/browser/ContentViewGestureHandler.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698