| 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 int flags, |
| 22 uint32_t unique_touch_event_id) |
| 22 : details(details), | 23 : details(details), |
| 23 motion_event_id(motion_event_id), | 24 motion_event_id(motion_event_id), |
| 24 primary_tool_type(primary_tool_type), | 25 primary_tool_type(primary_tool_type), |
| 25 time(time), | 26 time(time), |
| 26 x(x), | 27 x(x), |
| 27 y(y), | 28 y(y), |
| 28 raw_x(raw_x), | 29 raw_x(raw_x), |
| 29 raw_y(raw_y), | 30 raw_y(raw_y), |
| 30 flags(flags) { | 31 flags(flags), |
| 32 unique_touch_event_id(unique_touch_event_id) { |
| 31 DCHECK_GE(motion_event_id, 0); | 33 DCHECK_GE(motion_event_id, 0); |
| 32 DCHECK_NE(0U, touch_point_count); | 34 DCHECK_NE(0U, touch_point_count); |
| 33 this->details.set_touch_points(static_cast<int>(touch_point_count)); | 35 this->details.set_touch_points(static_cast<int>(touch_point_count)); |
| 34 this->details.set_bounding_box(bounding_box); | 36 this->details.set_bounding_box(bounding_box); |
| 35 } | 37 } |
| 36 | 38 |
| 37 GestureEventData::GestureEventData(EventType type, | 39 GestureEventData::GestureEventData(EventType type, |
| 38 const GestureEventData& other) | 40 const GestureEventData& other) |
| 39 : details(type, other.details), | 41 : details(type, other.details), |
| 40 motion_event_id(other.motion_event_id), | 42 motion_event_id(other.motion_event_id), |
| 41 primary_tool_type(other.primary_tool_type), | 43 primary_tool_type(other.primary_tool_type), |
| 42 time(other.time), | 44 time(other.time), |
| 43 x(other.x), | 45 x(other.x), |
| 44 y(other.y), | 46 y(other.y), |
| 45 raw_x(other.raw_x), | 47 raw_x(other.raw_x), |
| 46 raw_y(other.raw_y), | 48 raw_y(other.raw_y), |
| 47 flags(other.flags) { | 49 flags(other.flags), |
| 50 unique_touch_event_id(other.unique_touch_event_id) { |
| 48 details.set_touch_points(other.details.touch_points()); | 51 details.set_touch_points(other.details.touch_points()); |
| 49 details.set_bounding_box(other.details.bounding_box_f()); | 52 details.set_bounding_box(other.details.bounding_box_f()); |
| 50 } | 53 } |
| 51 | 54 |
| 52 GestureEventData::GestureEventData(const GestureEventData& other) = default; | 55 GestureEventData::GestureEventData(const GestureEventData& other) = default; |
| 53 | 56 |
| 54 GestureEventData::GestureEventData() | 57 GestureEventData::GestureEventData() |
| 55 : motion_event_id(0), | 58 : motion_event_id(0), |
| 56 primary_tool_type(MotionEvent::TOOL_TYPE_UNKNOWN), | 59 primary_tool_type(MotionEvent::TOOL_TYPE_UNKNOWN), |
| 57 x(0), | 60 x(0), |
| 58 y(0), | 61 y(0), |
| 59 raw_x(0), | 62 raw_x(0), |
| 60 raw_y(0), | 63 raw_y(0), |
| 61 flags(EF_NONE) { | 64 flags(EF_NONE), |
| 65 unique_touch_event_id(0U) { |
| 62 } | 66 } |
| 63 | 67 |
| 64 } // namespace ui | 68 } // namespace ui |
| OLD | NEW |