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

Unified Diff: android_webview/java/src/org/chromium/android_webview/AwScrollOffsetManager.java

Issue 120513005: [Android] Perform eager gesture recognition on MotionEvents (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More testing 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: android_webview/java/src/org/chromium/android_webview/AwScrollOffsetManager.java
diff --git a/android_webview/java/src/org/chromium/android_webview/AwScrollOffsetManager.java b/android_webview/java/src/org/chromium/android_webview/AwScrollOffsetManager.java
index f10ff7f9395c67ad40326c3fd7d1596fb7a9cf13..e13daa2ce1744873296caf40da6d206f742f67bb 100644
--- a/android_webview/java/src/org/chromium/android_webview/AwScrollOffsetManager.java
+++ b/android_webview/java/src/org/chromium/android_webview/AwScrollOffsetManager.java
@@ -73,10 +73,6 @@ public class AwScrollOffsetManager {
private int mDeferredNativeScrollX;
private int mDeferredNativeScrollY;
- // The velocity of the last recorded fling,
- private int mLastFlingVelocityX;
- private int mLastFlingVelocityY;
-
private OverScroller mScroller;
public AwScrollOffsetManager(Delegate delegate, OverScroller overScroller) {
@@ -253,12 +249,6 @@ public class AwScrollOffsetManager {
mDelegate.scrollNativeTo(x, y);
}
- // Called at the beginning of every fling gesture.
- public void onFlingStartGesture(int velocityX, int velocityY) {
- mLastFlingVelocityX = velocityX;
- mLastFlingVelocityY = velocityY;
- }
-
// Called whenever some other touch interaction requires the fling gesture to be canceled.
public void onFlingCancelGesture() {
// TODO(mkosiba): Support speeding up a fling by flinging again.
@@ -269,8 +259,8 @@ public class AwScrollOffsetManager {
// Called when a fling gesture is not handled by the renderer.
// We explicitly ask the renderer not to handle fling gestures targeted at the root
// scroll layer.
- public void onUnhandledFlingStartEvent() {
- flingScroll(-mLastFlingVelocityX, -mLastFlingVelocityY);
+ public void onUnhandledFlingStartEvent(int velocityX, int velocityY) {
+ flingScroll(-velocityX, -velocityY);
}
// Starts the fling animation. Called both as a response to a fling gesture and as via the

Powered by Google App Engine
This is Rietveld 408576698