| 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 14 matching lines...) Expand all Loading... |
| 25 | 25 |
| 26 // Controls a synthetic gesture. | 26 // Controls a synthetic gesture. |
| 27 // Repeatedly invokes the gesture object's ForwardInputEvent method to send | 27 // Repeatedly invokes the gesture object's ForwardInputEvent method to send |
| 28 // input events to the platform until the gesture has finished. | 28 // input events to the platform until the gesture has finished. |
| 29 class CONTENT_EXPORT SyntheticGestureController { | 29 class CONTENT_EXPORT SyntheticGestureController { |
| 30 public: | 30 public: |
| 31 class Delegate { | 31 class Delegate { |
| 32 public: | 32 public: |
| 33 virtual ~Delegate() {} | 33 virtual ~Delegate() {} |
| 34 | 34 |
| 35 // Requests a single begin frame. The passed callback is run on the next | |
| 36 // begin frame message. | |
| 37 virtual void RequestBeginFrameForSynthesizedInput( | |
| 38 base::OnceClosure callback) = 0; | |
| 39 | |
| 40 // Returns whether any gesture created by dispatched input events has | 35 // Returns whether any gesture created by dispatched input events has |
| 41 // completed or not. | 36 // completed or not. |
| 42 virtual bool HasGestureStopped() = 0; | 37 virtual bool HasGestureStopped() = 0; |
| 43 }; | 38 }; |
| 44 SyntheticGestureController( | 39 SyntheticGestureController( |
| 45 Delegate* delegate, | 40 Delegate* delegate, |
| 46 std::unique_ptr<SyntheticGestureTarget> gesture_target); | 41 std::unique_ptr<SyntheticGestureTarget> gesture_target); |
| 47 virtual ~SyntheticGestureController(); | 42 virtual ~SyntheticGestureController(); |
| 48 | 43 |
| 49 typedef base::Callback<void(SyntheticGesture::Result)> | 44 typedef base::Callback<void(SyntheticGesture::Result)> |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 | 109 |
| 115 base::RepeatingTimer dispatch_timer_; | 110 base::RepeatingTimer dispatch_timer_; |
| 116 base::WeakPtrFactory<SyntheticGestureController> weak_ptr_factory_; | 111 base::WeakPtrFactory<SyntheticGestureController> weak_ptr_factory_; |
| 117 | 112 |
| 118 DISALLOW_COPY_AND_ASSIGN(SyntheticGestureController); | 113 DISALLOW_COPY_AND_ASSIGN(SyntheticGestureController); |
| 119 }; | 114 }; |
| 120 | 115 |
| 121 } // namespace content | 116 } // namespace content |
| 122 | 117 |
| 123 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_GESTURE_CONTROLLER_H_ | 118 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_GESTURE_CONTROLLER_H_ |
| OLD | NEW |