| 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(EventType type, | 11 GestureEventData::GestureEventData(EventType type, |
| 12 int motion_event_id, |
| 12 base::TimeTicks time, | 13 base::TimeTicks time, |
| 13 float x, | 14 float x, |
| 14 float y, | 15 float y, |
| 15 const GestureEventDetails& details) | 16 const GestureEventDetails& details) |
| 16 : type(type), time(time), x(x), y(y), details(details) { | 17 : type(type), |
| 18 motion_event_id(motion_event_id), |
| 19 time(time), |
| 20 x(x), |
| 21 y(y), |
| 22 details(details) { |
| 23 DCHECK(motion_event_id >= 0); |
| 17 DCHECK(ET_GESTURE_TYPE_START <= type && type <= ET_GESTURE_TYPE_END); | 24 DCHECK(ET_GESTURE_TYPE_START <= type && type <= ET_GESTURE_TYPE_END); |
| 18 } | 25 } |
| 19 | 26 |
| 20 GestureEventData::GestureEventData(EventType type, | 27 GestureEventData::GestureEventData(EventType type, |
| 28 int motion_event_id, |
| 21 base::TimeTicks time, | 29 base::TimeTicks time, |
| 22 float x, | 30 float x, |
| 23 float y) | 31 float y) |
| 24 : type(type), | 32 : type(type), |
| 33 motion_event_id(motion_event_id), |
| 25 time(time), | 34 time(time), |
| 26 x(x), | 35 x(x), |
| 27 y(y), | 36 y(y), |
| 28 details(GestureEventDetails(type, 0, 0)) { | 37 details(GestureEventDetails(type, 0, 0)) { |
| 38 DCHECK(motion_event_id >= 0); |
| 29 DCHECK(ET_GESTURE_TYPE_START <= type && type <= ET_GESTURE_TYPE_END); | 39 DCHECK(ET_GESTURE_TYPE_START <= type && type <= ET_GESTURE_TYPE_END); |
| 30 } | 40 } |
| 31 | 41 |
| 32 GestureEventData::GestureEventData() : type(ET_UNKNOWN), x(0), y(0) {} | 42 GestureEventData::GestureEventData() : type(ET_UNKNOWN), x(0), y(0) {} |
| 33 | 43 |
| 34 } // namespace ui | 44 } // namespace ui |
| OLD | NEW |