Chromium Code Reviews| 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 bfff7809b16651a3f5d3b7a912416d1132e51ae4..1dd73603d010c47a3f02ad9ea679915d999fdae0 100644 |
| --- a/ui/events/gesture_detection/touch_disposition_gesture_filter.cc |
| +++ b/ui/events/gesture_detection/touch_disposition_gesture_filter.cc |
| @@ -17,15 +17,17 @@ COMPILE_ASSERT(ET_GESTURE_TYPE_END - ET_GESTURE_TYPE_START < 32, |
| GestureEventData CreateGesture(EventType type, |
| int motion_event_id, |
| - const base::TimeTicks& timestamp) { |
| + const base::TimeTicks& timestamp, |
| + float x, |
| + float y) { |
| GestureEventDetails details(type, 0, 0); |
| return GestureEventData(type, |
| motion_event_id, |
| timestamp, |
| - 0, |
| - 0, |
| + x, |
| + y, |
| 1, |
| - gfx::RectF(0, 0, 0, 0), |
| + gfx::RectF(x, y, 0, 0), |
| details); |
| } |
| @@ -205,6 +207,8 @@ bool TouchDispositionGestureFilter::IsEmpty() const { |
| void TouchDispositionGestureFilter::FilterAndSendPacket( |
| const GestureEventDataPacket& packet) { |
| + ending_event_location_ = packet.touch_location(); |
|
jdduke (slow)
2014/05/12 17:02:34
It appears we only call |{Cancel,End}FooIfNecessar
tdresser
2014/05/12 18:09:31
SGTM.
Done.
|
| + |
| if (packet.gesture_source() == GestureEventDataPacket::TOUCH_SEQUENCE_START) { |
| CancelTapIfNecessary(packet.timestamp()); |
| EndScrollIfNecessary(packet.timestamp()); |
| @@ -300,8 +304,11 @@ void TouchDispositionGestureFilter::CancelTapIfNecessary( |
| if (!needs_tap_ending_event_) |
| return; |
| - SendGesture(CreateGesture( |
| - ET_GESTURE_TAP_CANCEL, ending_event_motion_event_id_, timestamp)); |
| + SendGesture(CreateGesture(ET_GESTURE_TAP_CANCEL, |
| + ending_event_motion_event_id_, |
| + timestamp, |
| + ending_event_location_.x(), |
| + ending_event_location_.y())); |
| DCHECK(!needs_tap_ending_event_); |
| } |
| @@ -310,8 +317,11 @@ void TouchDispositionGestureFilter::CancelFlingIfNecessary( |
| if (!needs_fling_ending_event_) |
| return; |
| - SendGesture(CreateGesture( |
| - ET_SCROLL_FLING_CANCEL, ending_event_motion_event_id_, timestamp)); |
| + SendGesture(CreateGesture(ET_SCROLL_FLING_CANCEL, |
| + ending_event_motion_event_id_, |
| + timestamp, |
| + ending_event_location_.x(), |
| + ending_event_location_.y())); |
| DCHECK(!needs_fling_ending_event_); |
| } |
| @@ -320,8 +330,11 @@ void TouchDispositionGestureFilter::EndScrollIfNecessary( |
| if (!needs_scroll_ending_event_) |
| return; |
| - SendGesture(CreateGesture( |
| - ET_GESTURE_SCROLL_END, ending_event_motion_event_id_, timestamp)); |
| + SendGesture(CreateGesture(ET_GESTURE_SCROLL_END, |
| + ending_event_motion_event_id_, |
| + timestamp, |
| + ending_event_location_.x(), |
| + ending_event_location_.y())); |
| DCHECK(!needs_scroll_ending_event_); |
| } |