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 #ifndef UI_EVENTS_GESTURE_DETECTION_GESTURE_EVENT_DETAILS_H_ | 5 #ifndef UI_EVENTS_GESTURE_DETECTION_GESTURE_EVENT_DETAILS_H_ |
6 #define UI_EVENTS_GESTURE_DETECTION_GESTURE_EVENT_DETAILS_H_ | 6 #define UI_EVENTS_GESTURE_DETECTION_GESTURE_EVENT_DETAILS_H_ |
7 | 7 |
8 #include "base/logging.h" | 8 #include "base/logging.h" |
9 #include "ui/events/event_constants.h" | 9 #include "ui/events/event_constants.h" |
10 #include "ui/events/events_base_export.h" | 10 #include "ui/events/events_base_export.h" |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 DCHECK_EQ(ET_GESTURE_TWO_FINGER_TAP, type_); | 73 DCHECK_EQ(ET_GESTURE_TWO_FINGER_TAP, type_); |
74 return data.first_finger_enclosing_rectangle.height; | 74 return data.first_finger_enclosing_rectangle.height; |
75 } | 75 } |
76 | 76 |
77 float scale() const { | 77 float scale() const { |
78 DCHECK_EQ(ET_GESTURE_PINCH_UPDATE, type_); | 78 DCHECK_EQ(ET_GESTURE_PINCH_UPDATE, type_); |
79 return data.scale; | 79 return data.scale; |
80 } | 80 } |
81 | 81 |
82 bool swipe_left() const { | 82 bool swipe_left() const { |
83 DCHECK_EQ(ET_GESTURE_MULTIFINGER_SWIPE, type_); | 83 DCHECK_EQ(ET_GESTURE_SWIPE, type_); |
84 return data.swipe.left; | 84 return data.swipe.left; |
85 } | 85 } |
86 | 86 |
87 bool swipe_right() const { | 87 bool swipe_right() const { |
88 DCHECK_EQ(ET_GESTURE_MULTIFINGER_SWIPE, type_); | 88 DCHECK_EQ(ET_GESTURE_SWIPE, type_); |
89 return data.swipe.right; | 89 return data.swipe.right; |
90 } | 90 } |
91 | 91 |
92 bool swipe_up() const { | 92 bool swipe_up() const { |
93 DCHECK_EQ(ET_GESTURE_MULTIFINGER_SWIPE, type_); | 93 DCHECK_EQ(ET_GESTURE_SWIPE, type_); |
94 return data.swipe.up; | 94 return data.swipe.up; |
95 } | 95 } |
96 | 96 |
97 bool swipe_down() const { | 97 bool swipe_down() const { |
98 DCHECK_EQ(ET_GESTURE_MULTIFINGER_SWIPE, type_); | 98 DCHECK_EQ(ET_GESTURE_SWIPE, type_); |
99 return data.swipe.down; | 99 return data.swipe.down; |
100 } | 100 } |
101 | 101 |
102 int tap_count() const { | 102 int tap_count() const { |
103 DCHECK(type_ == ET_GESTURE_TAP || | 103 DCHECK(type_ == ET_GESTURE_TAP || |
104 type_ == ET_GESTURE_TAP_UNCONFIRMED || | 104 type_ == ET_GESTURE_TAP_UNCONFIRMED || |
105 type_ == ET_GESTURE_DOUBLE_TAP); | 105 type_ == ET_GESTURE_DOUBLE_TAP); |
106 return data.tap_count; | 106 return data.tap_count; |
107 } | 107 } |
108 | 108 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 int touch_points_; // Number of active touch points in the gesture. | 158 int touch_points_; // Number of active touch points in the gesture. |
159 | 159 |
160 // Bounding box is an axis-aligned rectangle that contains all the | 160 // Bounding box is an axis-aligned rectangle that contains all the |
161 // enclosing rectangles of the touch-points in the gesture. | 161 // enclosing rectangles of the touch-points in the gesture. |
162 gfx::RectF bounding_box_; | 162 gfx::RectF bounding_box_; |
163 }; | 163 }; |
164 | 164 |
165 } // namespace ui | 165 } // namespace ui |
166 | 166 |
167 #endif // UI_EVENTS_GESTURE_DETECTION_GESTURE_EVENT_DETAILS_H_ | 167 #endif // UI_EVENTS_GESTURE_DETECTION_GESTURE_EVENT_DETAILS_H_ |
OLD | NEW |