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

Side by Side Diff: content/common/input/synthetic_pointer_action_params.h

Issue 1707943002: Add SyntheticPointerActionParams used in Chromedriver extension (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add a friend to the IPC SyntheticPointerActionParams Created 4 years, 9 months 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
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_COMMON_INPUT_SYNTHETIC_POINTER_ACTION_PARAMS_H_
6 #define CONTENT_COMMON_INPUT_SYNTHETIC_POINTER_ACTION_PARAMS_H_
7
8 #include "base/logging.h"
9 #include "content/common/content_export.h"
10 #include "content/common/input/input_param_traits.h"
11 #include "content/common/input/synthetic_gesture_params.h"
12 #include "ui/gfx/geometry/point_f.h"
13
14 namespace content {
15
16 struct CONTENT_EXPORT SyntheticPointerActionParams
17 : public SyntheticGestureParams {
18 public:
19 SyntheticPointerActionParams();
20 SyntheticPointerActionParams(PointerActionType type);
21 SyntheticPointerActionParams(const SyntheticPointerActionParams& other);
22 ~SyntheticPointerActionParams() override;
23
24 GestureType GetGestureType() const override;
25
26 static const SyntheticPointerActionParams* Cast(
27 const SyntheticGestureParams* gesture_params);
28
29 void set_pointer_action_type(
30 SyntheticGestureParams::PointerActionType pointer_action_type) {
31 pointer_action_type_arg = pointer_action_type;
32 }
33
34 void set_index(int index) {
35 DCHECK(pointer_action_type_arg !=
36 SyntheticGestureParams::PointerActionType::PROCESS);
37 index_arg = index;
38 }
39
40 void set_position(const gfx::PointF& position) {
41 DCHECK(pointer_action_type_arg ==
42 SyntheticGestureParams::PointerActionType::PRESS ||
43 pointer_action_type_arg ==
44 SyntheticGestureParams::PointerActionType::MOVE);
45 position_arg = position;
46 }
47
48 SyntheticGestureParams::PointerActionType pointer_action_type() const {
49 return pointer_action_type_arg;
50 }
51
52 int index() const {
53 DCHECK(pointer_action_type_arg !=
54 SyntheticGestureParams::PointerActionType::PROCESS);
55 return index_arg;
56 }
57
58 gfx::PointF position() const {
59 DCHECK(pointer_action_type_arg ==
60 SyntheticGestureParams::PointerActionType::PRESS ||
61 pointer_action_type_arg ==
62 SyntheticGestureParams::PointerActionType::MOVE);
63 return position_arg;
64 }
65
66 private:
67 friend struct IPC::ParamTraits<content::SyntheticPointerActionParams>;
68
69 SyntheticGestureParams::PointerActionType pointer_action_type_arg;
70 gfx::PointF position_arg;
tdresser 2016/03/17 18:25:29 Add comments indicating under what circumstances t
lanwei 2016/03/22 00:33:43 Done.
71 int index_arg;
72 };
73 } // namespace content
74
75 #endif // CONTENT_COMMON_INPUT_SYNTHETIC_POINTER_ACTION_PARAMS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698