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

Unified Diff: content/browser/renderer_host/input/touch_disposition_gesture_filter.cc

Issue 128613003: [Tracking Patch] Unified gesture detection (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Cleanup Created 6 years, 10 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/browser/renderer_host/input/touch_disposition_gesture_filter.cc
diff --git a/content/browser/renderer_host/input/touch_disposition_gesture_filter.cc b/content/browser/renderer_host/input/touch_disposition_gesture_filter.cc
index 36de573810acd82f49292c4dc797bc485433b556..869565429b71d3a50744e245a659e68f70f8feb6 100644
--- a/content/browser/renderer_host/input/touch_disposition_gesture_filter.cc
+++ b/content/browser/renderer_host/input/touch_disposition_gesture_filter.cc
@@ -105,7 +105,8 @@ TouchDispositionGestureFilter::TouchDispositionGestureFilter(
TouchDispositionGestureFilterClient* client)
: client_(client),
needs_tap_ending_event_(false),
- needs_fling_ending_event_(false) {
+ needs_fling_ending_event_(false),
+ needs_scroll_ending_event_(false) {
DCHECK(client_);
}
@@ -212,10 +213,15 @@ void TouchDispositionGestureFilter::SendGesture(const WebGestureEvent& event) {
case WebInputEvent::GestureScrollBegin:
CancelTapIfNecessary();
CancelFlingIfNecessary();
+ needs_scroll_ending_event_ = true;
+ break;
+ case WebInputEvent::GestureScrollEnd:
+ needs_scroll_ending_event_ = false;
break;
case WebInputEvent::GestureFlingStart:
CancelFlingIfNecessary();
needs_fling_ending_event_ = true;
+ needs_scroll_ending_event_ = false;
break;
case WebInputEvent::GestureFlingCancel:
needs_fling_ending_event_ = false;
@@ -242,6 +248,14 @@ void TouchDispositionGestureFilter::CancelFlingIfNecessary() {
DCHECK(!needs_fling_ending_event_);
}
+void TouchDispositionGestureFilter::EndScrollIfNecessary() {
+ if (!needs_scroll_ending_event_)
+ return;
+
+ SendGesture(CreateGesture(WebInputEvent::GestureScrollEnd));
+ DCHECK(!needs_scroll_ending_event_);
+}
+
// TouchDispositionGestureFilter::GestureSequence
TouchDispositionGestureFilter::GestureSequence::GestureHandlingState::

Powered by Google App Engine
This is Rietveld 408576698