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

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

Issue 131373004: Let the browser know the end of fling (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 11 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 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;
+ }
}

Powered by Google App Engine
This is Rietveld 408576698