| 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 "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/memory/scoped_vector.h" | 9 #include "base/memory/scoped_vector.h" |
| 10 #include "base/time/time.h" | 10 #include "base/time/time.h" |
| 11 #include "content/browser/renderer_host/input/synthetic_gesture_new.h" | 11 #include "content/browser/renderer_host/input/synthetic_gesture.h" |
| 12 #include "content/common/content_export.h" | 12 #include "content/common/content_export.h" |
| 13 #include "content/common/input/synthetic_gesture_params.h" | 13 #include "content/common/input/synthetic_gesture_params.h" |
| 14 | 14 |
| 15 namespace content { | 15 namespace content { |
| 16 | 16 |
| 17 class SyntheticGestureTarget; | 17 class SyntheticGestureTarget; |
| 18 | 18 |
| 19 // Controls a synthetic gesture. | 19 // Controls a synthetic gesture. |
| 20 // Repeatedly invokes the gesture object's ForwardInputEvent method to send | 20 // Repeatedly invokes the gesture object's ForwardInputEvent method to send |
| 21 // input events to the platform until the gesture has finished. | 21 // input events to the platform until the gesture has finished. |
| 22 class CONTENT_EXPORT SyntheticGestureControllerNew { | 22 class CONTENT_EXPORT SyntheticGestureController { |
| 23 public: | 23 public: |
| 24 explicit SyntheticGestureControllerNew( | 24 explicit SyntheticGestureController( |
| 25 scoped_ptr<SyntheticGestureTarget> gesture_target); | 25 scoped_ptr<SyntheticGestureTarget> gesture_target); |
| 26 virtual ~SyntheticGestureControllerNew(); | 26 virtual ~SyntheticGestureController(); |
| 27 | 27 |
| 28 void QueueSyntheticGesture( | 28 void QueueSyntheticGesture( |
| 29 scoped_ptr<SyntheticGestureNew> synthetic_gesture); | 29 scoped_ptr<SyntheticGesture> synthetic_gesture); |
| 30 | 30 |
| 31 // Forward input events of the currently processed gesture. | 31 // Forward input events of the currently processed gesture. |
| 32 void Flush(base::TimeTicks timestamp); | 32 void Flush(base::TimeTicks timestamp); |
| 33 | 33 |
| 34 private: | 34 private: |
| 35 void StartGesture(const SyntheticGestureNew& gesture); | 35 void StartGesture(const SyntheticGesture& gesture); |
| 36 void StopGesture(const SyntheticGestureNew& gesture, | 36 void StopGesture(const SyntheticGesture& gesture, |
| 37 SyntheticGestureNew::Result result); | 37 SyntheticGesture::Result result); |
| 38 | 38 |
| 39 scoped_ptr<SyntheticGestureTarget> gesture_target_; | 39 scoped_ptr<SyntheticGestureTarget> gesture_target_; |
| 40 ScopedVector<SyntheticGestureNew> pending_gesture_queue_; | 40 ScopedVector<SyntheticGesture> pending_gesture_queue_; |
| 41 | 41 |
| 42 base::TimeTicks last_tick_time_; | 42 base::TimeTicks last_tick_time_; |
| 43 | 43 |
| 44 DISALLOW_COPY_AND_ASSIGN(SyntheticGestureControllerNew); | 44 DISALLOW_COPY_AND_ASSIGN(SyntheticGestureController); |
| 45 }; | 45 }; |
| 46 | 46 |
| 47 } // namespace content | 47 } // namespace content |
| 48 | 48 |
| 49 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_GESTURE_CONTROLLER_H_ | 49 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_GESTURE_CONTROLLER_H_ |
| OLD | NEW |