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

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

Issue 131373004: Let the browser know the end of fling (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compile break 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/ContentViewCore.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java b/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
index 5bd4ed79fe778231d725e699352fe3364bdfc25d..ec600bcf0724103c93a4fdf1c3555a1ac2e6ca5c 100644
--- a/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
+++ b/content/public/android/java/src/org/chromium/content/browser/ContentViewCore.java
@@ -1359,10 +1359,16 @@ public class ContentViewCore
@SuppressWarnings("unused")
@CalledByNative
- private void unhandledFlingStartEvent() {
- if (mGestureStateListener != null) {
+ private void onFlingStartEventAck(int ackResult) {
+ if (ackResult == ContentViewGestureHandler.INPUT_EVENT_ACK_STATE_NO_CONSUMER_EXISTS
+ && mGestureStateListener != null) {
mGestureStateListener.onUnhandledFlingStartEvent();
}
+ if (ackResult != ContentViewGestureHandler.INPUT_EVENT_ACK_STATE_CONSUMED) {
+ // No fling happened for the fling start event.
+ // Cancel the fling status set when sending GestureFlingStart.
+ getContentViewClient().onFlingStopped();
+ }
}
@SuppressWarnings("unused")
@@ -1428,6 +1434,7 @@ public class ContentViewCore
nativeScrollEnd(mNativeContentViewCore, timeMs);
return true;
case ContentViewGestureHandler.GESTURE_FLING_START:
+ mContentViewClient.onFlingStarted();
nativeFlingStart(mNativeContentViewCore, timeMs, x, y,
b.getInt(ContentViewGestureHandler.VELOCITY_X, 0),
b.getInt(ContentViewGestureHandler.VELOCITY_Y, 0));
@@ -3257,6 +3264,11 @@ public class ContentViewCore
return getContentViewClient().shouldBlockMediaRequest(url);
}
+ @CalledByNative
+ private void onNativeFlingStopped() {
+ getContentViewClient().onFlingStopped();
+ }
+
private native WebContents nativeGetWebContentsAndroid(long nativeContentViewCoreImpl);
private native void nativeOnJavaContentViewCoreDestroyed(long nativeContentViewCoreImpl);

Powered by Google App Engine
This is Rietveld 408576698