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 5589d358acd542d7b04e3a5bd85200a060d37fe7..f17f383830646369a38e1173bbc2cace428897a7 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 |
@@ -126,10 +126,7 @@ class ContentViewGestureHandler implements LongPressDelegate { |
// True from right before we send the first scroll event until the last finger is raised. |
private boolean mTouchScrolling; |
- // TODO(wangxianzhu): For now it is true after a fling is started until the next |
- // touch. Should reset it to false on end of fling if the UI is able to know when the |
- // fling ends. |
- private boolean mFlingMayBeActive; |
+ private boolean mFlingIsActive; |
// Used to remove the touch slop from the initial scroll event in a scroll gesture. |
private boolean mSeenFirstScrollEvent; |
@@ -649,7 +646,7 @@ class ContentViewGestureHandler implements LongPressDelegate { |
} |
endTouchScrollIfNecessary(timeMs, false); |
- mFlingMayBeActive = true; |
+ mFlingIsActive = true; |
mExtraParamBundleFling.putInt(VELOCITY_X, velocityX); |
mExtraParamBundleFling.putInt(VELOCITY_Y, velocityY); |
@@ -662,8 +659,8 @@ class ContentViewGestureHandler implements LongPressDelegate { |
* @param timeMs The time in ms for the event initiating this gesture. |
*/ |
void endFlingIfNecessary(long timeMs) { |
- if (!mFlingMayBeActive) return; |
- mFlingMayBeActive = false; |
+ if (!mFlingIsActive) return; |
+ mFlingIsActive = false; |
sendGesture(GESTURE_FLING_CANCEL, timeMs, 0, 0, null); |
} |
@@ -1274,4 +1271,8 @@ class ContentViewGestureHandler implements LongPressDelegate { |
mLastDoubleTapTimeMs = 0; |
} |
} |
+ |
+ public void onNativeFlingStopped() { |
+ mFlingIsActive = false; |
+ } |
} |