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 base::TimeTicks time, | 13 base::TimeTicks time, |
14 float x, | 14 float x, |
15 float y, | 15 float y, |
| 16 float raw_x, |
| 17 float raw_y, |
16 int touch_point_count, | 18 int touch_point_count, |
17 const gfx::RectF& bounding_box) | 19 const gfx::RectF& bounding_box) |
18 : details(details), | 20 : details(details), |
19 motion_event_id(motion_event_id), | 21 motion_event_id(motion_event_id), |
20 time(time), | 22 time(time), |
21 x(x), | 23 x(x), |
22 y(y) { | 24 y(y), |
| 25 raw_x(raw_x), |
| 26 raw_y(raw_y) { |
23 DCHECK_GE(motion_event_id, 0); | 27 DCHECK_GE(motion_event_id, 0); |
24 DCHECK_NE(0, touch_point_count); | 28 DCHECK_NE(0, touch_point_count); |
25 this->details.set_touch_points(touch_point_count); | 29 this->details.set_touch_points(touch_point_count); |
26 this->details.set_bounding_box(bounding_box); | 30 this->details.set_bounding_box(bounding_box); |
27 } | 31 } |
28 | 32 |
29 GestureEventData::GestureEventData(EventType type, | 33 GestureEventData::GestureEventData(EventType type, |
30 int motion_event_id, | 34 const GestureEventData& other) |
31 base::TimeTicks time, | 35 : details(type, 0, 0), |
32 float x, | 36 motion_event_id(other.motion_event_id), |
33 float y, | 37 time(other.time), |
34 int touch_point_count, | 38 x(other.x), |
35 const gfx::RectF& bounding_box) | 39 y(other.y), |
36 : details(GestureEventDetails(type, 0, 0)), | 40 raw_x(other.raw_x), |
37 motion_event_id(motion_event_id), | 41 raw_y(other.raw_y) { |
38 time(time), | 42 details.set_touch_points(other.details.touch_points()); |
39 x(x), | 43 details.set_bounding_box(other.details.bounding_box_f()); |
40 y(y) { | |
41 DCHECK_GE(motion_event_id, 0); | |
42 details.set_touch_points(touch_point_count); | |
43 details.set_bounding_box(bounding_box); | |
44 } | 44 } |
45 | 45 |
46 GestureEventData::GestureEventData() : x(0), y(0) { | 46 GestureEventData::GestureEventData() |
| 47 : motion_event_id(0), x(0), y(0), raw_x(0), raw_y(0) { |
47 } | 48 } |
48 | 49 |
49 } // namespace ui | 50 } // namespace ui |
OLD | NEW |