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

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

Issue 321563002: Support minimum gesture bounds in GestureProvider (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compile Created 6 years, 6 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 311cf9b40618a15224b1840e076cda78964d3bc2..58194c59a15bf96731d25c74ae17ae4fc49712c0 100644
--- a/ui/events/gesture_detection/touch_disposition_gesture_filter.cc
+++ b/ui/events/gesture_detection/touch_disposition_gesture_filter.cc
@@ -20,14 +20,13 @@ GestureEventData CreateGesture(EventType type,
const base::TimeTicks& timestamp,
const gfx::PointF& location) {
GestureEventDetails details(type, 0, 0);
- return GestureEventData(type,
+ return GestureEventData(details,
motion_event_id,
timestamp,
location.x(),
location.y(),
1,
- gfx::RectF(location.x(), location.y(), 0, 0),
- details);
+ gfx::RectF(location.x(), location.y(), 0, 0));
}
enum RequiredTouches {
@@ -223,9 +222,9 @@ void TouchDispositionGestureFilter::FilterAndSendPacket(
for (size_t i = 0; i < packet.gesture_count(); ++i) {
const GestureEventData& gesture = packet.gesture(i);
- DCHECK(ET_GESTURE_TYPE_START <= gesture.type &&
- gesture.type <= ET_GESTURE_TYPE_END);
- if (state_.Filter(gesture.type)) {
+ DCHECK_GE(gesture.details.type(), ET_GESTURE_TYPE_START);
+ DCHECK_LE(gesture.details.type(), ET_GESTURE_TYPE_END);
+ if (state_.Filter(gesture.details.type())) {
CancelTapIfNecessary();
continue;
}
@@ -245,7 +244,7 @@ void TouchDispositionGestureFilter::FilterAndSendPacket(
void TouchDispositionGestureFilter::SendGesture(const GestureEventData& event) {
// TODO(jdduke): Factor out gesture stream reparation code into a standalone
// utility class.
- switch (event.type) {
+ switch (event.type()) {
case ET_GESTURE_LONG_TAP:
if (!needs_tap_ending_event_)
return;
@@ -270,8 +269,13 @@ void TouchDispositionGestureFilter::SendGesture(const GestureEventData& event) {
case ET_GESTURE_TAP:
DCHECK(needs_tap_ending_event_);
if (needs_show_press_event_) {
- GestureEventData show_press_event(event);
- show_press_event.type = ET_GESTURE_SHOW_PRESS;
+ GestureEventData show_press_event(ET_GESTURE_SHOW_PRESS,
+ event.motion_event_id,
+ event.time,
+ event.x,
+ event.y,
+ event.details.touch_points(),
+ event.details.bounding_box_f());
SendGesture(show_press_event);
DCHECK(!needs_show_press_event_);
}

Powered by Google App Engine
This is Rietveld 408576698