OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_GESTURE_CONTROLLER_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_GESTURE_CONTROLLER_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_GESTURE_CONTROLLER_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_GESTURE_CONTROLLER_H_ |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include <queue> | 9 #include <queue> |
10 #include <utility> | 10 #include <utility> |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 OnGestureCompleteCallback; | 50 OnGestureCompleteCallback; |
51 void QueueSyntheticGesture( | 51 void QueueSyntheticGesture( |
52 std::unique_ptr<SyntheticGesture> synthetic_gesture, | 52 std::unique_ptr<SyntheticGesture> synthetic_gesture, |
53 const OnGestureCompleteCallback& completion_callback); | 53 const OnGestureCompleteCallback& completion_callback); |
54 | 54 |
55 bool DispatchNextEvent(base::TimeTicks = base::TimeTicks::Now()); | 55 bool DispatchNextEvent(base::TimeTicks = base::TimeTicks::Now()); |
56 | 56 |
57 private: | 57 private: |
58 friend class SyntheticGestureControllerTestBase; | 58 friend class SyntheticGestureControllerTestBase; |
59 | 59 |
60 void RequestBeginFrame(); | |
61 void OnBeginFrame(); | |
62 void StartTimer(); | 60 void StartTimer(); |
63 | |
64 void StartGesture(const SyntheticGesture& gesture); | 61 void StartGesture(const SyntheticGesture& gesture); |
65 void StopGesture(const SyntheticGesture& gesture, | 62 void StopGesture(const SyntheticGesture& gesture, |
66 const OnGestureCompleteCallback& completion_callback, | 63 const OnGestureCompleteCallback& completion_callback, |
67 SyntheticGesture::Result result); | 64 SyntheticGesture::Result result); |
68 | 65 |
69 Delegate* const delegate_; | 66 Delegate* const delegate_; |
70 std::unique_ptr<SyntheticGestureTarget> gesture_target_; | 67 std::unique_ptr<SyntheticGestureTarget> gesture_target_; |
71 | 68 |
72 // A queue of gesture/callback pairs. Implemented as two queues to | 69 // A queue of gesture/callback pairs. Implemented as two queues to |
73 // simplify the ownership of SyntheticGesture pointers. | 70 // simplify the ownership of SyntheticGesture pointers. |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 | 114 |
118 base::RepeatingTimer dispatch_timer_; | 115 base::RepeatingTimer dispatch_timer_; |
119 base::WeakPtrFactory<SyntheticGestureController> weak_ptr_factory_; | 116 base::WeakPtrFactory<SyntheticGestureController> weak_ptr_factory_; |
120 | 117 |
121 DISALLOW_COPY_AND_ASSIGN(SyntheticGestureController); | 118 DISALLOW_COPY_AND_ASSIGN(SyntheticGestureController); |
122 }; | 119 }; |
123 | 120 |
124 } // namespace content | 121 } // namespace content |
125 | 122 |
126 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_GESTURE_CONTROLLER_H_ | 123 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_GESTURE_CONTROLLER_H_ |
OLD | NEW |