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

Unified Diff: content/public/android/java/src/org/chromium/content/browser/ContentViewGestureHandler.java

Issue 11228010: Do not wait for the double tap timeout on pages with fixed page scale (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added new method to mock child classes in test file Created 8 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 side-by-side diff with in-line comments
Download patch
Index: content/public/android/java/src/org/chromium/content/browser/ContentViewGestureHandler.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/ContentViewGestureHandler.java b/content/public/android/java/src/org/chromium/content/browser/ContentViewGestureHandler.java
index 6bba091a3859708b2cd13715816786a9fa6acb94..ba0d1dc998402bce2769183578c8a3d8d0b7a46c 100644
--- a/content/public/android/java/src/org/chromium/content/browser/ContentViewGestureHandler.java
+++ b/content/public/android/java/src/org/chromium/content/browser/ContentViewGestureHandler.java
@@ -198,6 +198,11 @@ class ContentViewGestureHandler implements LongPressDelegate {
* Show the zoom picker UI.
*/
public void invokeZoomPicker();
+
+ /**
+ * @return Whether changing the page scale is not possible on the current page.
+ */
+ public boolean hasFixedPageScale();
}
ContentViewGestureHandler(
@@ -391,6 +396,18 @@ class ContentViewGestureHandler implements LongPressDelegate {
}
setClickXAndY((int) x, (int) y);
return true;
+ } else if (mMotionEventDelegate.hasFixedPageScale()) {
+ // If page is not user scalable, we don't need to wait
+ // for double tap timeout.
+ float x = e.getX();
+ float y = e.getY();
+ mExtraParamBundle.clear();
+ mExtraParamBundle.putBoolean(SHOW_PRESS, mShowPressIsCalled);
+ if (mMotionEventDelegate.sendGesture(GESTURE_SINGLE_TAP_CONFIRMED,
+ e.getEventTime(), (int) x, (int) y, mExtraParamBundle)) {
+ mIgnoreSingleTap = true;
+ }
+ setClickXAndY((int) x, (int) y);
}
return false;
}

Powered by Google App Engine
This is Rietveld 408576698