Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_POINTER_ACTION_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_POINTER_ACTION_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_POINTER_ACTION_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_POINTER_ACTION_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_driver.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_pointer_action_list_params.h" | |
| 13 #include "content/common/input/synthetic_pointer_action_params.h" | 14 #include "content/common/input/synthetic_pointer_action_params.h" |
| 14 | 15 |
| 15 using blink::WebTouchEvent; | |
| 16 | |
| 17 namespace content { | 16 namespace content { |
| 18 | 17 |
| 19 class CONTENT_EXPORT SyntheticPointerAction : public SyntheticGesture { | 18 class CONTENT_EXPORT SyntheticPointerAction : public SyntheticGesture { |
| 20 public: | 19 public: |
| 21 SyntheticPointerAction(std::vector<SyntheticPointerActionParams>* param_list, | 20 explicit SyntheticPointerAction( |
| 22 SyntheticPointerDriver* synthetic_pointer_driver); | 21 const SyntheticPointerActionListParams& params); |
| 23 ~SyntheticPointerAction() override; | 22 ~SyntheticPointerAction() override; |
| 24 | 23 |
| 25 SyntheticGesture::Result ForwardInputEvents( | 24 SyntheticGesture::Result ForwardInputEvents( |
| 26 const base::TimeTicks& timestamp, | 25 const base::TimeTicks& timestamp, |
| 27 SyntheticGestureTarget* target) override; | 26 SyntheticGestureTarget* target) override; |
| 28 | 27 |
| 29 private: | 28 private: |
| 30 explicit SyntheticPointerAction(const SyntheticPointerActionParams& params); | 29 enum GestureState { UNINITIALIZED, RUNNING, INVALID, DONE }; |
| 31 SyntheticGesture::Result ForwardTouchOrMouseInputEvents( | |
| 32 const base::TimeTicks& timestamp, | |
| 33 SyntheticGestureTarget* target); | |
| 34 | 30 |
| 35 // SyntheticGestureController is responsible to create the | 31 GestureState ForwardTouchOrMouseInputEvents(const base::TimeTicks& timestamp, |
| 36 // SyntheticPointerActions and control when to forward them. | 32 SyntheticGestureTarget* target); |
| 37 | 33 |
| 38 // These two objects will be owned by SyntheticGestureController, which | 34 // params_ contains a list of lists of pointer actions, that each list of |
| 39 // will manage their lifetime by initiating them when it starts processing a | 35 // pointer actions will be dispatched together. |
| 40 // pointer action sequence and resetting them when it finishes. | 36 SyntheticPointerActionListParams params_; |
| 41 // param_list_ contains a list of pointer actions which will be dispatched | 37 std::unique_ptr<SyntheticPointerDriver> synthetic_pointer_driver_; |
| 42 // together. | 38 SyntheticGestureParams::GestureSourceType gesture_source_type_; |
| 43 std::vector<SyntheticPointerActionParams>* param_list_; | 39 GestureState state_; |
| 44 SyntheticPointerDriver* synthetic_pointer_driver_; | 40 size_t actions_dispatched_count_; |
|
samuong
2016/12/21 00:02:27
i was initially a bit confused by the meaning of t
lanwei
2016/12/21 20:01:14
Done.
| |
| 45 | |
| 46 SyntheticPointerActionParams params_; | |
| 47 | 41 |
| 48 DISALLOW_COPY_AND_ASSIGN(SyntheticPointerAction); | 42 DISALLOW_COPY_AND_ASSIGN(SyntheticPointerAction); |
| 49 }; | 43 }; |
| 50 | 44 |
| 51 } // namespace content | 45 } // namespace content |
| 52 | 46 |
| 53 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_POINTER_ACTION_H_ | 47 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_POINTER_ACTION_H_ |
| OLD | NEW |