OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_GESTURES_GESTURE_POINT_H_ | 5 #ifndef UI_EVENTS_GESTURES_GESTURE_POINT_H_ |
6 #define UI_EVENTS_GESTURES_GESTURE_POINT_H_ | 6 #define UI_EVENTS_GESTURES_GESTURE_POINT_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "ui/events/gestures/velocity_calculator.h" | 9 #include "ui/events/gestures/velocity_calculator.h" |
10 #include "ui/gfx/point.h" | 10 #include "ui/gfx/point.h" |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 | 72 |
73 bool in_use() const { return point_id_ >= 0; } | 73 bool in_use() const { return point_id_ >= 0; } |
74 | 74 |
75 gfx::Vector2d ScrollDelta() const; | 75 gfx::Vector2d ScrollDelta() const; |
76 | 76 |
77 float XVelocity() { return velocity_calculator_.XVelocity(); } | 77 float XVelocity() { return velocity_calculator_.XVelocity(); } |
78 float YVelocity() { return velocity_calculator_.YVelocity(); } | 78 float YVelocity() { return velocity_calculator_.YVelocity(); } |
79 | 79 |
80 const gfx::Rect& enclosing_rectangle() const { return enclosing_rect_; } | 80 const gfx::Rect& enclosing_rectangle() const { return enclosing_rect_; } |
81 | 81 |
| 82 void set_source_device_id(int source_device_id) { |
| 83 source_device_id_ = source_device_id; |
| 84 } |
| 85 int source_device_id() const { return source_device_id_; } |
| 86 |
82 private: | 87 private: |
83 // Various statistical functions to manipulate gestures. | 88 // Various statistical functions to manipulate gestures. |
84 | 89 |
85 // Tests if the point has a consistent scroll vector across a window of touch | 90 // Tests if the point has a consistent scroll vector across a window of touch |
86 // move events. | 91 // move events. |
87 bool IsConsistentScrollingActionUnderway() const; | 92 bool IsConsistentScrollingActionUnderway() const; |
88 bool IsInClickTimeWindow() const; | 93 bool IsInClickTimeWindow() const; |
89 bool IsInClickAggregateTimeWindow(double before, double after) const; | 94 bool IsInClickAggregateTimeWindow(double before, double after) const; |
90 bool IsPointInsideManhattanSquare(gfx::Point p1, gfx::Point p2) const; | 95 bool IsPointInsideManhattanSquare(gfx::Point p1, gfx::Point p2) const; |
91 bool IsOverMinFlickSpeed(); | 96 bool IsOverMinFlickSpeed(); |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 int point_id_; | 129 int point_id_; |
125 int touch_id_; | 130 int touch_id_; |
126 | 131 |
127 // Represents the rectangle that encloses the circles/ellipses | 132 // Represents the rectangle that encloses the circles/ellipses |
128 // generated by a sequence of touch events | 133 // generated by a sequence of touch events |
129 gfx::Rect enclosing_rect_; | 134 gfx::Rect enclosing_rect_; |
130 | 135 |
131 // Count of the number of events with same direction. | 136 // Count of the number of events with same direction. |
132 gfx::Vector2d same_direction_count_; | 137 gfx::Vector2d same_direction_count_; |
133 | 138 |
| 139 int source_device_id_; |
| 140 |
134 DISALLOW_COPY_AND_ASSIGN(GesturePoint); | 141 DISALLOW_COPY_AND_ASSIGN(GesturePoint); |
135 }; | 142 }; |
136 | 143 |
137 } // namespace ui | 144 } // namespace ui |
138 | 145 |
139 #endif // UI_EVENTS_GESTURES_GESTURE_POINT_H_ | 146 #endif // UI_EVENTS_GESTURES_GESTURE_POINT_H_ |
OLD | NEW |