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_BASE_GESTURES_GESTURE_POINT_H_ | 5 #ifndef UI_BASE_GESTURES_GESTURE_POINT_H_ |
6 #define UI_BASE_GESTURES_GESTURE_POINT_H_ | 6 #define UI_BASE_GESTURES_GESTURE_POINT_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "ui/base/gestures/velocity_calculator.h" | 10 #include "ui/base/gestures/velocity_calculator.h" |
11 #include "ui/gfx/point.h" | 11 #include "ui/gfx/point.h" |
12 | 12 |
13 namespace ui { | 13 namespace ui { |
14 class TouchEvent; | 14 class TouchEvent; |
15 | 15 |
16 // A GesturePoint represents a single touch-point/finger during a gesture | 16 // A GesturePoint represents a single touch-point/finger during a gesture |
17 // recognition process. | 17 // recognition process. |
18 class GesturePoint { | 18 class GesturePoint { |
19 public: | 19 public: |
20 GesturePoint(); | 20 GesturePoint(); |
21 ~GesturePoint(); | 21 ~GesturePoint(); |
22 | 22 |
23 // Resets various states. | 23 // Resets various states. |
24 void Reset(); | 24 void Reset(); |
25 | 25 |
| 26 void ResetVelocity(); |
| 27 |
26 // Updates some states when a Tap gesture has been recognized for this point. | 28 // Updates some states when a Tap gesture has been recognized for this point. |
27 void UpdateForTap(); | 29 void UpdateForTap(); |
28 | 30 |
29 // Updates some states when a Scroll gesture has been recognized for this | 31 // Updates some states when a Scroll gesture has been recognized for this |
30 // point. | 32 // point. |
31 void UpdateForScroll(); | 33 void UpdateForScroll(); |
32 | 34 |
33 // Updates states depending on the event and the gesture-state. | 35 // Updates states depending on the event and the gesture-state. |
34 void UpdateValues(const TouchEvent& event); | 36 void UpdateValues(const TouchEvent& event); |
35 | 37 |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 VelocityCalculator velocity_calculator_; | 101 VelocityCalculator velocity_calculator_; |
100 | 102 |
101 int point_id_; | 103 int point_id_; |
102 int touch_id_; | 104 int touch_id_; |
103 DISALLOW_COPY_AND_ASSIGN(GesturePoint); | 105 DISALLOW_COPY_AND_ASSIGN(GesturePoint); |
104 }; | 106 }; |
105 | 107 |
106 } // namespace ui | 108 } // namespace ui |
107 | 109 |
108 #endif // UI_BASE_GESTURES_GESTURE_POINT_H_ | 110 #endif // UI_BASE_GESTURES_GESTURE_POINT_H_ |
OLD | NEW |