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

Unified Diff: ui/events/gesture_detection/touch_disposition_gesture_filter.cc

Issue 212663010: Store the id of a contributing motion event in GestureEventData (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Update test. Created 6 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
Index: ui/events/gesture_detection/touch_disposition_gesture_filter.cc
diff --git a/ui/events/gesture_detection/touch_disposition_gesture_filter.cc b/ui/events/gesture_detection/touch_disposition_gesture_filter.cc
index a64c1b61fc945856a30d23b79c2b1bcd898193e9..930624f5ae859813207af8a73d00f9c21596418d 100644
--- a/ui/events/gesture_detection/touch_disposition_gesture_filter.cc
+++ b/ui/events/gesture_detection/touch_disposition_gesture_filter.cc
@@ -15,9 +15,13 @@ namespace {
COMPILE_ASSERT(ET_GESTURE_TYPE_END - ET_GESTURE_TYPE_START < 32,
gesture_type_count_too_large);
-GestureEventData CreateGesture(EventType type) {
- return GestureEventData(
- type, base::TimeTicks(), 0, 0, GestureEventDetails(type, 0, 0));
+GestureEventData CreateGesture(EventType type, int motion_event_id) {
+ return GestureEventData(type,
+ motion_event_id,
+ base::TimeTicks(),
+ 0,
+ 0,
+ GestureEventDetails(type, 0, 0));
}
enum RequiredTouches {
@@ -205,6 +209,7 @@ void TouchDispositionGestureFilter::SendGesture(const GestureEventData& event) {
break;
case ET_GESTURE_TAP_DOWN:
DCHECK(!needs_tap_ending_event_);
+ ending_event_motion_event_id_ = event.motion_event_id;
needs_tap_ending_event_ = true;
break;
case ET_GESTURE_TAP:
@@ -217,6 +222,7 @@ void TouchDispositionGestureFilter::SendGesture(const GestureEventData& event) {
CancelTapIfNecessary();
CancelFlingIfNecessary();
EndScrollIfNecessary();
+ ending_event_motion_event_id_ = event.motion_event_id;
needs_scroll_ending_event_ = true;
break;
case ET_GESTURE_SCROLL_END:
@@ -224,6 +230,7 @@ void TouchDispositionGestureFilter::SendGesture(const GestureEventData& event) {
break;
case ET_SCROLL_FLING_START:
CancelFlingIfNecessary();
+ ending_event_motion_event_id_ = event.motion_event_id;
needs_fling_ending_event_ = true;
needs_scroll_ending_event_ = false;
break;
@@ -240,7 +247,8 @@ void TouchDispositionGestureFilter::CancelTapIfNecessary() {
if (!needs_tap_ending_event_)
return;
- SendGesture(CreateGesture(ET_GESTURE_TAP_CANCEL));
+ SendGesture(
+ CreateGesture(ET_GESTURE_TAP_CANCEL, ending_event_motion_event_id_));
DCHECK(!needs_tap_ending_event_);
}
@@ -248,7 +256,8 @@ void TouchDispositionGestureFilter::CancelFlingIfNecessary() {
if (!needs_fling_ending_event_)
return;
- SendGesture(CreateGesture(ET_SCROLL_FLING_CANCEL));
+ SendGesture(
+ CreateGesture(ET_SCROLL_FLING_CANCEL, ending_event_motion_event_id_));
DCHECK(!needs_fling_ending_event_);
}
@@ -256,7 +265,8 @@ void TouchDispositionGestureFilter::EndScrollIfNecessary() {
if (!needs_scroll_ending_event_)
return;
- SendGesture(CreateGesture(ET_GESTURE_SCROLL_END));
+ SendGesture(
+ CreateGesture(ET_GESTURE_SCROLL_END, ending_event_motion_event_id_));
DCHECK(!needs_scroll_ending_event_);
}

Powered by Google App Engine
This is Rietveld 408576698