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 <array> | |
8 #include "base/macros.h" | 9 #include "base/macros.h" |
9 #include "content/browser/renderer_host/input/synthetic_gesture.h" | 10 #include "content/browser/renderer_host/input/synthetic_gesture.h" |
10 #include "content/browser/renderer_host/input/synthetic_gesture_target.h" | 11 #include "content/browser/renderer_host/input/synthetic_gesture_target.h" |
11 #include "content/browser/renderer_host/input/synthetic_pointer.h" | 12 #include "content/browser/renderer_host/input/synthetic_pointer.h" |
12 #include "content/common/content_export.h" | 13 #include "content/common/content_export.h" |
13 #include "content/common/input/synthetic_pointer_action_params.h" | 14 #include "content/common/input/synthetic_pointer_action_params.h" |
14 | 15 |
16 using blink::WebTouchEvent; | |
17 | |
15 namespace content { | 18 namespace content { |
16 | 19 |
17 class CONTENT_EXPORT SyntheticPointerAction : public SyntheticGesture { | 20 class CONTENT_EXPORT SyntheticPointerAction : public SyntheticGesture { |
18 public: | 21 public: |
22 using IndexMap = std::array<int, WebTouchEvent::touchesLengthCap>; | |
23 | |
19 explicit SyntheticPointerAction(const SyntheticPointerActionParams& params); | 24 explicit SyntheticPointerAction(const SyntheticPointerActionParams& params); |
20 SyntheticPointerAction(const SyntheticPointerActionParams& params, | 25 SyntheticPointerAction( |
21 SyntheticPointer* synthetic_pointer); | 26 const std::vector<SyntheticPointerActionParams>& param_list, |
27 SyntheticPointer* synthetic_pointer, | |
28 IndexMap* index_map); | |
22 ~SyntheticPointerAction() override; | 29 ~SyntheticPointerAction() override; |
23 | 30 |
24 SyntheticGesture::Result ForwardInputEvents( | 31 SyntheticGesture::Result ForwardInputEvents( |
25 const base::TimeTicks& timestamp, | 32 const base::TimeTicks& timestamp, |
26 SyntheticGestureTarget* target) override; | 33 SyntheticGestureTarget* target) override; |
27 | 34 |
28 void ForwardTouchOrMouseInputEvents(const base::TimeTicks& timestamp, | 35 SyntheticGesture::Result ForwardTouchOrMouseInputEvents( |
29 SyntheticGestureTarget* target); | 36 const base::TimeTicks& timestamp, |
37 SyntheticGestureTarget* target); | |
38 | |
39 void SetSyntheticPointer(SyntheticPointer* synthetic_pointer) { | |
40 synthetic_pointer_ = synthetic_pointer; | |
41 } | |
30 | 42 |
31 private: | 43 private: |
44 // These three objects are owned by SyntheticPointerActionController, which | |
45 // will manage their lifetime by initiating them when it starts processing a | |
46 // pointer action sequence and resets them when finish. | |
47 std::vector<SyntheticPointerActionParams> param_list_; | |
tdresser
2016/05/19 17:57:03
This is currently being copied. Should this be a c
lanwei
2016/05/20 01:48:16
We cannot, because there is another constructor ex
tdresser
2016/05/20 14:24:30
Then perhaps we should pass a pointer?
Right now
| |
48 SyntheticPointer* synthetic_pointer_; | |
49 IndexMap* index_map_; | |
50 | |
32 SyntheticPointerActionParams params_; | 51 SyntheticPointerActionParams params_; |
33 SyntheticPointer* synthetic_pointer_; | |
34 | 52 |
35 DISALLOW_COPY_AND_ASSIGN(SyntheticPointerAction); | 53 DISALLOW_COPY_AND_ASSIGN(SyntheticPointerAction); |
36 }; | 54 }; |
37 | 55 |
38 } // namespace content | 56 } // namespace content |
39 | 57 |
40 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_POINTER_ACTION_H_ | 58 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_POINTER_ACTION_H_ |
OLD | NEW |