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 30a5d3eac45087bc0adba8df73c82720af7da65d..b5f22bc55b70c1ee0b72dc6716b0c341735d8b97 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 |
@@ -1363,6 +1363,7 @@ public class ContentViewCore |
if (mGestureStateListener != null) { |
mGestureStateListener.onUnhandledFlingStartEvent(); |
} |
+ mContentViewClient.onFlingStopped(); |
} |
@SuppressWarnings("unused") |
@@ -1428,6 +1429,12 @@ public class ContentViewCore |
nativeScrollEnd(mNativeContentViewCore, timeMs); |
return true; |
case ContentViewGestureHandler.GESTURE_FLING_START: |
+ // As onNativeFlingStarted() may be delayed, here let the client know the |
+ // possible fling earlier. If the fling is not handled by native side |
+ // (i.e. no onNativeFlingStarted() or onNativeFlingStopped() will be called), |
+ // onFlingStopped() will be called from unhandledFlingStartEvent(). |
jdduke (slow)
2014/01/10 17:45:59
So we may get a redundant |onFlingStarted()| call
Xianzhu
2014/01/10 20:16:02
Yes, the redundancy is to handle the gap. Added co
|
+ mContentViewClient.onFlingStarted(); |
+ |
nativeFlingStart(mNativeContentViewCore, timeMs, x, y, |
b.getInt(ContentViewGestureHandler.VELOCITY_X, 0), |
b.getInt(ContentViewGestureHandler.VELOCITY_Y, 0)); |
@@ -3257,6 +3264,16 @@ public class ContentViewCore |
return getContentViewClient().shouldBlockMediaRequest(url); |
} |
+ @CalledByNative |
+ private void onNativeFlingStarted() { |
+ getContentViewClient().onFlingStarted(); |
+ } |
+ |
+ @CalledByNative |
+ private void onNativeFlingStopped() { |
+ getContentViewClient().onFlingStopped(); |
+ } |
+ |
private native WebContents nativeGetWebContentsAndroid(long nativeContentViewCoreImpl); |
private native void nativeOnJavaContentViewCoreDestroyed(long nativeContentViewCoreImpl); |