Index: content/browser/renderer_host/input/synthetic_pointer_action.h |
diff --git a/content/browser/renderer_host/input/synthetic_pointer_action.h b/content/browser/renderer_host/input/synthetic_pointer_action.h |
index 23b23fa421be29b1254cd491eebcbaff13adbb06..a7e984ea381b05c84c04d0433e51e950467f300b 100644 |
--- a/content/browser/renderer_host/input/synthetic_pointer_action.h |
+++ b/content/browser/renderer_host/input/synthetic_pointer_action.h |
@@ -5,6 +5,7 @@ |
#ifndef CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_POINTER_ACTION_H_ |
#define CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_POINTER_ACTION_H_ |
+#include <array> |
#include "base/macros.h" |
#include "content/browser/renderer_host/input/synthetic_gesture.h" |
#include "content/browser/renderer_host/input/synthetic_gesture_target.h" |
@@ -12,25 +13,51 @@ |
#include "content/common/content_export.h" |
#include "content/common/input/synthetic_pointer_action_params.h" |
+using blink::WebTouchEvent; |
+ |
namespace content { |
class CONTENT_EXPORT SyntheticPointerAction : public SyntheticGesture { |
public: |
+ using IndexMap = std::array<int, WebTouchEvent::touchesLengthCap>; |
+ |
explicit SyntheticPointerAction(const SyntheticPointerActionParams& params); |
- SyntheticPointerAction(const SyntheticPointerActionParams& params, |
- SyntheticPointer* synthetic_pointer); |
+ SyntheticPointerAction( |
+ std::unique_ptr<std::vector<SyntheticPointerActionParams>> param_list, |
+ SyntheticPointer* synthetic_pointer, |
+ IndexMap* index_map); |
~SyntheticPointerAction() override; |
SyntheticGesture::Result ForwardInputEvents( |
const base::TimeTicks& timestamp, |
SyntheticGestureTarget* target) override; |
- void ForwardTouchOrMouseInputEvents(const base::TimeTicks& timestamp, |
- SyntheticGestureTarget* target); |
+ SyntheticGesture::Result ForwardTouchOrMouseInputEvents( |
+ const base::TimeTicks& timestamp, |
+ SyntheticGestureTarget* target); |
+ |
+ void SetSyntheticPointer(SyntheticPointer* synthetic_pointer) { |
+ synthetic_pointer_ = synthetic_pointer; |
+ } |
+ |
+ int GetPointIndex(int index) const; |
+ |
+ void SetPointIndex(int index, int point_index) { |
+ (*index_map_)[index] = point_index; |
+ } |
private: |
- SyntheticPointerActionParams params_; |
+ // This is passed from SyntheticPointerActionController, which will reset its |
+ // value to push a new patch of action parameters. |
tdresser
2016/05/31 13:44:26
patch -> batch
lanwei
2016/06/02 13:26:26
Done.
|
+ // This contains a list of pointer actions which will be dispatched together. |
+ const std::unique_ptr<std::vector<SyntheticPointerActionParams>> param_list_; |
+ // These two objects are owned by SyntheticPointerActionController, which |
+ // will manage their lifetime by initiating them when it starts processing a |
+ // pointer action sequence and resets them when it finishes. |
tdresser
2016/05/31 13:44:26
resets -> resetting
lanwei
2016/06/02 13:26:27
Done.
|
SyntheticPointer* synthetic_pointer_; |
+ IndexMap* index_map_; |
+ |
+ SyntheticPointerActionParams params_; |
DISALLOW_COPY_AND_ASSIGN(SyntheticPointerAction); |
}; |