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

Side by Side 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: 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/events/gesture_detection/gesture_event_data.h" 5 #include "ui/events/gesture_detection/gesture_event_data.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 8
9 namespace ui { 9 namespace ui {
10 10
11 GestureEventData::GestureEventData(EventType type, 11 GestureEventData::GestureEventData(const GestureEventDetails& details,
12 int motion_event_id, 12 int motion_event_id,
13 base::TimeTicks time, 13 base::TimeTicks time,
14 float x, 14 float x,
15 float y, 15 float y,
16 int touch_point_count, 16 int touch_point_count,
17 const gfx::RectF& bounding_box, 17 const gfx::RectF& bounding_box)
18 const GestureEventDetails& details) 18 : details(details),
19 : type(type),
20 motion_event_id(motion_event_id), 19 motion_event_id(motion_event_id),
21 time(time), 20 time(time),
22 x(x), 21 x(x),
23 y(y), 22 y(y) {
24 details(details) {
25 DCHECK_GE(motion_event_id, 0); 23 DCHECK_GE(motion_event_id, 0);
26 DCHECK_NE(0, touch_point_count); 24 DCHECK_NE(0, touch_point_count);
27 DCHECK_GE(type, ET_GESTURE_TYPE_START);
28 DCHECK_LE(type, ET_GESTURE_TYPE_END);
29 DCHECK_EQ(type, details.type());
30 this->details.set_touch_points(touch_point_count); 25 this->details.set_touch_points(touch_point_count);
31 this->details.set_bounding_box(bounding_box); 26 this->details.set_bounding_box(bounding_box);
32 } 27 }
33 28
34 GestureEventData::GestureEventData(EventType type, 29 GestureEventData::GestureEventData(EventType type,
35 int motion_event_id, 30 int motion_event_id,
36 base::TimeTicks time, 31 base::TimeTicks time,
37 float x, 32 float x,
38 float y, 33 float y,
39 int touch_point_count, 34 int touch_point_count,
40 const gfx::RectF& bounding_box) 35 const gfx::RectF& bounding_box)
41 : type(type), 36 : details(GestureEventDetails(type, 0, 0)),
42 motion_event_id(motion_event_id), 37 motion_event_id(motion_event_id),
43 time(time), 38 time(time),
44 x(x), 39 x(x),
45 y(y), 40 y(y) {
46 details(GestureEventDetails(type, 0, 0)) {
47 DCHECK_GE(motion_event_id, 0); 41 DCHECK_GE(motion_event_id, 0);
48 DCHECK_NE(0, touch_point_count);
49 DCHECK_GE(type, ET_GESTURE_TYPE_START);
50 DCHECK_LE(type, ET_GESTURE_TYPE_END);
51 details.set_touch_points(touch_point_count); 42 details.set_touch_points(touch_point_count);
52 details.set_bounding_box(bounding_box); 43 details.set_bounding_box(bounding_box);
53 } 44 }
54 45
55 GestureEventData::GestureEventData() : type(ET_UNKNOWN), x(0), y(0) {} 46 GestureEventData::GestureEventData() : x(0), y(0) {
47 }
56 48
57 } // namespace ui 49 } // namespace ui
OLDNEW
« no previous file with comments | « ui/events/gesture_detection/gesture_event_data.h ('k') | ui/events/gesture_detection/gesture_event_data_packet.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698