Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(91)

Side by Side Diff: content/browser/renderer_host/input/synthetic_pointer_action.h

Issue 2336803003: Make SyntheticPointerAction to flush the pointer action sequence (Closed)
Patch Set: return invaid when index is out bound Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 using blink::WebTouchEvent;
16 17
17 namespace content { 18 namespace content {
18 19
19 class CONTENT_EXPORT SyntheticPointerAction : public SyntheticGesture { 20 class CONTENT_EXPORT SyntheticPointerAction : public SyntheticGesture {
20 public: 21 public:
21 SyntheticPointerAction(std::vector<SyntheticPointerActionParams>* param_list, 22 explicit SyntheticPointerAction(
22 SyntheticPointerDriver* synthetic_pointer_driver); 23 const SyntheticPointerActionListParams& params);
23 ~SyntheticPointerAction() override; 24 ~SyntheticPointerAction() override;
24 25
25 SyntheticGesture::Result ForwardInputEvents( 26 SyntheticGesture::Result ForwardInputEvents(
26 const base::TimeTicks& timestamp, 27 const base::TimeTicks& timestamp,
27 SyntheticGestureTarget* target) override; 28 SyntheticGestureTarget* target) override;
28 29
29 private: 30 private:
30 explicit SyntheticPointerAction(const SyntheticPointerActionParams& params); 31 enum GestureState { SETUP, RUNNING, INVALID, DONE };
tdresser 2016/12/13 14:37:43 SETUP -> UNINITIALIZED? The rest of these, you co
lanwei 2016/12/18 17:35:55 Acknowledged.
31 SyntheticGesture::Result ForwardTouchOrMouseInputEvents(
32 const base::TimeTicks& timestamp,
33 SyntheticGestureTarget* target);
34 32
35 // SyntheticGestureController is responsible to create the 33 GestureState ForwardTouchOrMouseInputEvents(const base::TimeTicks& timestamp,
36 // SyntheticPointerActions and control when to forward them. 34 SyntheticGestureTarget* target);
37 35
38 // These two objects will be owned by SyntheticGestureController, which 36 // 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 37 // pointer actions will be dispatched together.
40 // pointer action sequence and resetting them when it finishes. 38 SyntheticPointerActionListParams params_;
41 // param_list_ contains a list of pointer actions which will be dispatched 39 std::unique_ptr<SyntheticPointerDriver> synthetic_pointer_driver_;
42 // together. 40 SyntheticGestureParams::GestureSourceType gesture_source_type_;
43 std::vector<SyntheticPointerActionParams>* param_list_; 41 GestureState state_;
44 SyntheticPointerDriver* synthetic_pointer_driver_; 42 size_t count_;
tdresser 2016/12/13 14:37:43 Rename something like |params_dispatched_count_|
lanwei 2016/12/18 17:35:55 Done.
45
46 SyntheticPointerActionParams params_;
47 43
48 DISALLOW_COPY_AND_ASSIGN(SyntheticPointerAction); 44 DISALLOW_COPY_AND_ASSIGN(SyntheticPointerAction);
49 }; 45 };
50 46
51 } // namespace content 47 } // namespace content
52 48
53 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_POINTER_ACTION_H_ 49 #endif // CONTENT_BROWSER_RENDERER_HOST_INPUT_SYNTHETIC_POINTER_ACTION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698