Chromium Code Reviews| 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 f0fb10a4e2bade31d15065bf8b9e078ab8e3bf3e..1058c22506ed32f4715b30f75c84dda6092b0bba 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 |
| @@ -154,8 +154,9 @@ class ContentViewGestureHandler implements LongPressDelegate { |
| private boolean mSentGestureNeedsVSync; |
| private long mLastVSyncGestureTimeMs; |
| - // If the page scale is fixed, double tap gesture detection can be disabled. |
| - private boolean mHasFixedPageScale; |
| + // The page's viewport and scale sometimes allow us to disable double tap gesture detection, |
| + // according to the logic in ContentViewCore.onRenderCoordinatesUpdated(). |
| + private boolean mShouldDisableDoubleTap; |
| // Incremented and decremented when the methods onTouchEvent() and confirmTouchEvent() start |
| // and finish execution, respectively. This provides accounting for synchronous calls to |
| @@ -968,7 +969,7 @@ class ContentViewGestureHandler implements LongPressDelegate { |
| // then |event| will have been recycled. Only start the timer if the sent event has |
| // not yet been confirmed. |
| if (!mJavaScriptIsConsumingGesture |
| - && !mHasFixedPageScale |
| + && !mShouldDisableDoubleTap |
| && event == mPendingMotionEvents.peekFirst() |
| && event.getAction() != MotionEvent.ACTION_UP |
| && event.getAction() != MotionEvent.ACTION_CANCEL) { |
| @@ -1209,8 +1210,8 @@ class ContentViewGestureHandler implements LongPressDelegate { |
| /** |
| * Update whether double-tap gestures are supported. This allows |
| - * double-tap gesture suppression independent of whether or not the page |
| - * scale is fixed. |
| + * double-tap gesture suppression independent of whether or not the page's |
| + * viewport and scale would normally prevent double-tap. |
| * Note: This should never be called while a double-tap gesture is in progress. |
| * @param supportDoubleTap Whether double-tap gestures are supported. |
| */ |
| @@ -1225,20 +1226,20 @@ class ContentViewGestureHandler implements LongPressDelegate { |
| } |
| /** |
| - * Update whether the current page has a fixed page scale. |
| - * A fixed page scale will suppress double-tap gesture detection, allowing |
| - * for rapid and responsive single-tap gestures. |
| - * @param hasFixedPageScale Whether the page scale is fixed. |
| + * Update whether double-tap gesture detection should be suppressed due to |
| + * the viewport or scale of the current page. Suppressing double-tap gesture |
| + * detection allows for rapid and responsive single-tap gestures. |
| + * @param shouldDisableDoubleTap Whether double-tap should be suppressed. |
| */ |
| - public void updateHasFixedPageScale(boolean hasFixedPageScale) { |
| - if (mHasFixedPageScale == hasFixedPageScale) return; |
| - mHasFixedPageScale = hasFixedPageScale; |
| + public void updateShouldDisableDoubleTap(boolean shouldDisableDoubleTap) { |
| + if (mShouldDisableDoubleTap == shouldDisableDoubleTap) return; |
| + mShouldDisableDoubleTap = shouldDisableDoubleTap; |
| updateDoubleTapListener(); |
| } |
| private boolean isDoubleTapDisabled() { |
| return mDoubleTapMode == DOUBLE_TAP_MODE_DISABLED || |
| - mHasFixedPageScale; |
| + mShouldDisableDoubleTap; |
|
Ted C
2013/10/24 19:52:44
this looks like it should fit on the previous line
johnme
2013/10/31 19:13:12
Done.
|
| } |
| private void updateDoubleTapListener() { |