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

Unified Diff: content/browser/android/content_view_core_impl.cc

Issue 1053823002: [Android] Disable fling cancel filtering in the GestureEventQueue (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleanup, working tests Created 5 years, 9 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
« no previous file with comments | « no previous file | content/browser/renderer_host/input/gesture_event_queue.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « no previous file | content/browser/renderer_host/input/gesture_event_queue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698