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_event_details.h" | 5 #include "ui/events/gesture_event_details.h" |
6 | 6 |
7 namespace ui { | 7 namespace ui { |
8 | 8 |
9 GestureEventDetails::GestureEventDetails() | 9 GestureEventDetails::GestureEventDetails() |
10 : type_(ET_UNKNOWN), | 10 : type_(ET_UNKNOWN), |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 default: | 61 default: |
62 NOTREACHED() << "Invalid event type for constructor: " << type; | 62 NOTREACHED() << "Invalid event type for constructor: " << type; |
63 } | 63 } |
64 } | 64 } |
65 | 65 |
66 GestureEventDetails::GestureEventDetails(ui::EventType type, | 66 GestureEventDetails::GestureEventDetails(ui::EventType type, |
67 const GestureEventDetails& other) | 67 const GestureEventDetails& other) |
68 : type_(type), | 68 : type_(type), |
69 data_(other.data_), | 69 data_(other.data_), |
70 device_type_(other.device_type_), | 70 device_type_(other.device_type_), |
| 71 primary_pointer_type_(other.primary_pointer_type_), |
71 touch_points_(other.touch_points_), | 72 touch_points_(other.touch_points_), |
72 bounding_box_(other.bounding_box_) { | 73 bounding_box_(other.bounding_box_) { |
73 DCHECK_GE(type, ET_GESTURE_TYPE_START); | 74 DCHECK_GE(type, ET_GESTURE_TYPE_START); |
74 DCHECK_LE(type, ET_GESTURE_TYPE_END); | 75 DCHECK_LE(type, ET_GESTURE_TYPE_END); |
75 switch (type) { | 76 switch (type) { |
76 case ui::ET_GESTURE_SCROLL_BEGIN: | 77 case ui::ET_GESTURE_SCROLL_BEGIN: |
77 // Synthetic creation of SCROLL_BEGIN from PINCH_BEGIN is explicitly | 78 // Synthetic creation of SCROLL_BEGIN from PINCH_BEGIN is explicitly |
78 // allowed as an exception. | 79 // allowed as an exception. |
79 if (other.type() == ui::ET_GESTURE_PINCH_BEGIN) | 80 if (other.type() == ui::ET_GESTURE_PINCH_BEGIN) |
80 break; | 81 break; |
81 case ui::ET_GESTURE_SCROLL_UPDATE: | 82 case ui::ET_GESTURE_SCROLL_UPDATE: |
82 case ui::ET_SCROLL_FLING_START: | 83 case ui::ET_SCROLL_FLING_START: |
83 case ui::ET_GESTURE_SWIPE: | 84 case ui::ET_GESTURE_SWIPE: |
84 case ui::ET_GESTURE_PINCH_UPDATE: | 85 case ui::ET_GESTURE_PINCH_UPDATE: |
85 DCHECK_EQ(type, other.type()) << " - Invalid gesture conversion from " | 86 DCHECK_EQ(type, other.type()) << " - Invalid gesture conversion from " |
86 << other.type() << " to " << type; | 87 << other.type() << " to " << type; |
87 break; | 88 break; |
88 default: | 89 default: |
89 break; | 90 break; |
90 } | 91 } |
91 } | 92 } |
92 | 93 |
93 GestureEventDetails::Details::Details() { | 94 GestureEventDetails::Details::Details() { |
94 memset(this, 0, sizeof(Details)); | 95 memset(this, 0, sizeof(Details)); |
95 } | 96 } |
96 | 97 |
97 } // namespace ui | 98 } // namespace ui |
OLD | NEW |