Chromium Code Reviews| 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..6c069683e62e2b813b10dd19ca95535d3efb970b 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(); |
| + } |
|
jdduke (slow)
2014/01/15 21:50:05
I'm only worried about WebView behavior here. Is
|
| } |
| @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); |