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

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

Issue 277373002: Pass location with gestures created in TouchDispositionGestureFilter (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 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_);
}

Powered by Google App Engine
This is Rietveld 408576698