OLD | NEW |
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(const GestureEventDetails& details, | 11 GestureEventData::GestureEventData(const GestureEventDetails& details, |
12 int motion_event_id, | 12 int motion_event_id, |
13 MotionEvent::ToolType primary_tool_type, | 13 MotionEvent::ToolType primary_tool_type, |
14 base::TimeTicks time, | 14 base::TimeTicks time, |
15 float x, | 15 float x, |
16 float y, | 16 float y, |
17 float raw_x, | 17 float raw_x, |
18 float raw_y, | 18 float raw_y, |
19 size_t touch_point_count, | 19 size_t touch_point_count, |
20 const gfx::RectF& bounding_box) | 20 const gfx::RectF& bounding_box, |
| 21 int flags) |
21 : details(details), | 22 : details(details), |
22 motion_event_id(motion_event_id), | 23 motion_event_id(motion_event_id), |
23 primary_tool_type(primary_tool_type), | 24 primary_tool_type(primary_tool_type), |
24 time(time), | 25 time(time), |
25 x(x), | 26 x(x), |
26 y(y), | 27 y(y), |
27 raw_x(raw_x), | 28 raw_x(raw_x), |
28 raw_y(raw_y) { | 29 raw_y(raw_y), |
| 30 flags(flags) { |
29 DCHECK_GE(motion_event_id, 0); | 31 DCHECK_GE(motion_event_id, 0); |
30 DCHECK_NE(0U, touch_point_count); | 32 DCHECK_NE(0U, touch_point_count); |
31 this->details.set_touch_points(static_cast<int>(touch_point_count)); | 33 this->details.set_touch_points(static_cast<int>(touch_point_count)); |
32 this->details.set_bounding_box(bounding_box); | 34 this->details.set_bounding_box(bounding_box); |
33 } | 35 } |
34 | 36 |
35 GestureEventData::GestureEventData(EventType type, | 37 GestureEventData::GestureEventData(EventType type, |
36 const GestureEventData& other) | 38 const GestureEventData& other) |
37 : details(type, 0, 0), | 39 : details(type, 0, 0), |
38 motion_event_id(other.motion_event_id), | 40 motion_event_id(other.motion_event_id), |
39 primary_tool_type(other.primary_tool_type), | 41 primary_tool_type(other.primary_tool_type), |
40 time(other.time), | 42 time(other.time), |
41 x(other.x), | 43 x(other.x), |
42 y(other.y), | 44 y(other.y), |
43 raw_x(other.raw_x), | 45 raw_x(other.raw_x), |
44 raw_y(other.raw_y) { | 46 raw_y(other.raw_y), |
| 47 flags(other.flags) { |
45 details.set_touch_points(other.details.touch_points()); | 48 details.set_touch_points(other.details.touch_points()); |
46 details.set_bounding_box(other.details.bounding_box_f()); | 49 details.set_bounding_box(other.details.bounding_box_f()); |
47 } | 50 } |
48 | 51 |
49 GestureEventData::GestureEventData() | 52 GestureEventData::GestureEventData() |
50 : motion_event_id(0), | 53 : motion_event_id(0), |
51 primary_tool_type(MotionEvent::TOOL_TYPE_UNKNOWN), | 54 primary_tool_type(MotionEvent::TOOL_TYPE_UNKNOWN), |
52 x(0), | 55 x(0), |
53 y(0), | 56 y(0), |
54 raw_x(0), | 57 raw_x(0), |
55 raw_y(0) { | 58 raw_y(0), |
| 59 flags(EF_NONE) { |
56 } | 60 } |
57 | 61 |
58 } // namespace ui | 62 } // namespace ui |
OLD | NEW |