| 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_TAP_GESTURE_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_TAP_GESTURE_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_TAP_GESTURE_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_TAP_GESTURE_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "content/browser/renderer_host/input/synthetic_gesture.h" | 9 #include "content/browser/renderer_host/input/synthetic_gesture.h" |
| 10 #include "content/browser/renderer_host/input/synthetic_gesture_target.h" | 10 #include "content/browser/renderer_host/input/synthetic_gesture_target.h" |
| 11 #include "content/browser/renderer_host/input/synthetic_pointer.h" | 11 #include "content/browser/renderer_host/input/synthetic_pointer_driver.h" |
| 12 #include "content/common/content_export.h" | 12 #include "content/common/content_export.h" |
| 13 #include "content/common/input/synthetic_tap_gesture_params.h" | 13 #include "content/common/input/synthetic_tap_gesture_params.h" |
| 14 | 14 |
| 15 namespace content { | 15 namespace content { |
| 16 | 16 |
| 17 class CONTENT_EXPORT SyntheticTapGesture : public SyntheticGesture { | 17 class CONTENT_EXPORT SyntheticTapGesture : public SyntheticGesture { |
| 18 public: | 18 public: |
| 19 explicit SyntheticTapGesture(const SyntheticTapGestureParams& params); | 19 explicit SyntheticTapGesture(const SyntheticTapGestureParams& params); |
| 20 ~SyntheticTapGesture() override; | 20 ~SyntheticTapGesture() override; |
| 21 | 21 |
| 22 SyntheticGesture::Result ForwardInputEvents( | 22 SyntheticGesture::Result ForwardInputEvents( |
| 23 const base::TimeTicks& timestamp, | 23 const base::TimeTicks& timestamp, |
| 24 SyntheticGestureTarget* target) override; | 24 SyntheticGestureTarget* target) override; |
| 25 | 25 |
| 26 private: | 26 private: |
| 27 enum GestureState { | 27 enum GestureState { |
| 28 SETUP, | 28 SETUP, |
| 29 PRESS, | 29 PRESS, |
| 30 WAITING_TO_RELEASE, | 30 WAITING_TO_RELEASE, |
| 31 DONE | 31 DONE |
| 32 }; | 32 }; |
| 33 | 33 |
| 34 void ForwardTouchOrMouseInputEvents(const base::TimeTicks& timestamp, | 34 void ForwardTouchOrMouseInputEvents(const base::TimeTicks& timestamp, |
| 35 SyntheticGestureTarget* target); | 35 SyntheticGestureTarget* target); |
| 36 | 36 |
| 37 base::TimeDelta GetDuration() const; | 37 base::TimeDelta GetDuration() const; |
| 38 | 38 |
| 39 SyntheticTapGestureParams params_; | 39 SyntheticTapGestureParams params_; |
| 40 std::unique_ptr<SyntheticPointer> synthetic_pointer_; | 40 std::unique_ptr<SyntheticPointerDriver> synthetic_pointer_driver_; |
| 41 base::TimeTicks start_time_; | 41 base::TimeTicks start_time_; |
| 42 SyntheticGestureParams::GestureSourceType gesture_source_type_; | 42 SyntheticGestureParams::GestureSourceType gesture_source_type_; |
| 43 GestureState state_; | 43 GestureState state_; |
| 44 | 44 |
| 45 DISALLOW_COPY_AND_ASSIGN(SyntheticTapGesture); | 45 DISALLOW_COPY_AND_ASSIGN(SyntheticTapGesture); |
| 46 }; | 46 }; |
| 47 | 47 |
| 48 } // namespace content | 48 } // namespace content |
| 49 | 49 |
| 50 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_TAP_GESTURE_H_ | 50 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_TAP_GESTURE_H_ |
| OLD | NEW |