Index: content/browser/android/content_view_core_impl.cc |
diff --git a/content/browser/android/content_view_core_impl.cc b/content/browser/android/content_view_core_impl.cc |
index c9b6394aeb34cad859c481d31cdcc663180139f5..6cf234071b270f27e67cf1c045594a869f8ee369 100644 |
--- a/content/browser/android/content_view_core_impl.cc |
+++ b/content/browser/android/content_view_core_impl.cc |
@@ -556,7 +556,8 @@ bool ContentViewCoreImpl::FilterInputEvent(const blink::WebInputEvent& event) { |
if (event.type != WebInputEvent::GestureTap && |
event.type != WebInputEvent::GestureDoubleTap && |
event.type != WebInputEvent::GestureLongTap && |
- event.type != WebInputEvent::GestureLongPress) |
+ event.type != WebInputEvent::GestureLongPress && |
+ event.type != WebInputEvent::GestureFlingCancel) |
return false; |
JNIEnv* env = AttachCurrentThread(); |
@@ -564,6 +565,14 @@ bool ContentViewCoreImpl::FilterInputEvent(const blink::WebInputEvent& event) { |
if (j_obj.is_null()) |
return false; |
+ if (event.type == WebInputEvent::GestureFlingCancel) { |
+ // If no fling is active, either in the compositor or externally-driven, |
+ // there's no need to explicitly cancel the fling. |
+ bool may_need_fling_cancel = |
+ Java_ContentViewCore_isScrollInProgress(env, j_obj.obj()); |
+ return !may_need_fling_cancel; |
+ } |
+ |
const blink::WebGestureEvent& gesture = |
static_cast<const blink::WebGestureEvent&>(event); |
int gesture_type = ToGestureEventType(event.type); |