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

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

Issue 321563002: Support minimum gesture bounds in GestureProvider (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Tweak test 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/gesture_event_data.cc
diff --git a/ui/events/gesture_detection/gesture_event_data.cc b/ui/events/gesture_detection/gesture_event_data.cc
index 48f87497df696166e695780dff100070e8134c01..8400a5a55a038b8eb335a5de4ed23f16400a9ef7 100644
--- a/ui/events/gesture_detection/gesture_event_data.cc
+++ b/ui/events/gesture_detection/gesture_event_data.cc
@@ -8,25 +8,22 @@
namespace ui {
-GestureEventData::GestureEventData(EventType type,
+GestureEventData::GestureEventData(const GestureEventDetails& details,
int motion_event_id,
base::TimeTicks time,
float x,
float y,
int touch_point_count,
- const gfx::RectF& bounding_box,
- const GestureEventDetails& details)
- : type(type),
+ const gfx::RectF& bounding_box)
+ : details(details),
motion_event_id(motion_event_id),
time(time),
x(x),
- y(y),
- details(details) {
+ y(y) {
DCHECK_GE(motion_event_id, 0);
DCHECK_NE(0, touch_point_count);
- DCHECK_GE(type, ET_GESTURE_TYPE_START);
- DCHECK_LE(type, ET_GESTURE_TYPE_END);
- DCHECK_EQ(type, details.type());
+ DCHECK_GE(details.type(), ET_GESTURE_TYPE_START);
+ DCHECK_LE(details.type(), ET_GESTURE_TYPE_END);
tdresser 2014/06/09 13:36:37 We could move these DCHECKs to the GestureEventDet
jdduke (slow) 2014/06/09 15:40:57 Totally, done.
this->details.set_touch_points(touch_point_count);
this->details.set_bounding_box(bounding_box);
}
@@ -38,12 +35,11 @@ GestureEventData::GestureEventData(EventType type,
float y,
int touch_point_count,
const gfx::RectF& bounding_box)
- : type(type),
+ : details(GestureEventDetails(type, 0, 0)),
motion_event_id(motion_event_id),
time(time),
x(x),
- y(y),
- details(GestureEventDetails(type, 0, 0)) {
+ y(y) {
DCHECK_GE(motion_event_id, 0);
DCHECK_NE(0, touch_point_count);
DCHECK_GE(type, ET_GESTURE_TYPE_START);
@@ -52,6 +48,7 @@ GestureEventData::GestureEventData(EventType type,
details.set_bounding_box(bounding_box);
}
-GestureEventData::GestureEventData() : type(ET_UNKNOWN), x(0), y(0) {}
+GestureEventData::GestureEventData() : x(0), y(0) {
+}
} // namespace ui

Powered by Google App Engine
This is Rietveld 408576698