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

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: Use get functions in the IPC message 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 <stdint.h>
9
10 #include "base/logging.h"
11 #include "content/common/content_export.h"
12 #include "content/common/input/synthetic_gesture_params.h"
13 #include "ui/gfx/geometry/point_f.h"
14
15 namespace content {
16
17 struct CONTENT_EXPORT SyntheticPointerActionParams
18 : public SyntheticGestureParams {
19 public:
20 SyntheticPointerActionParams();
21 SyntheticPointerActionParams(PointerActionType type);
22 SyntheticPointerActionParams(const SyntheticPointerActionParams& other);
23 ~SyntheticPointerActionParams() override;
24
25 GestureType GetGestureType() const override;
26
27 static const SyntheticPointerActionParams* Cast(
28 const SyntheticGestureParams* gesture_params);
29
30 void set_index(uint32_t index) {
31 DCHECK(pointer_action_type !=
tdresser 2016/03/07 14:57:56 DCHECK_NE
32 SyntheticGestureParams::PointerActionType::PROCESS);
33 index_ = index;
34 }
35
36 void set_position(const gfx::PointF& position) {
37 DCHECK(pointer_action_type ==
38 SyntheticGestureParams::PointerActionType::PRESS ||
39 pointer_action_type ==
40 SyntheticGestureParams::PointerActionType::MOVE);
41 position_ = position;
42 }
43
44 const uint32_t& index() const {
45 DCHECK(pointer_action_type !=
tdresser 2016/03/07 14:57:56 DCHECK_NE, and below.
46 SyntheticGestureParams::PointerActionType::PROCESS);
47 return index_;
48 }
49
50 uint32_t& index() {
51 DCHECK(pointer_action_type !=
52 SyntheticGestureParams::PointerActionType::PROCESS);
53 return index_;
54 }
55
56 const gfx::PointF& position() const {
57 DCHECK(pointer_action_type ==
58 SyntheticGestureParams::PointerActionType::PRESS ||
59 pointer_action_type ==
60 SyntheticGestureParams::PointerActionType::MOVE);
61 return position_;
62 }
63
64 gfx::PointF& position() {
65 DCHECK(pointer_action_type ==
66 SyntheticGestureParams::PointerActionType::PRESS ||
67 pointer_action_type ==
68 SyntheticGestureParams::PointerActionType::MOVE);
69 return position_;
70 }
71 SyntheticGestureParams::PointerActionType pointer_action_type;
72
73 private:
74 gfx::PointF position_;
75 uint32_t index_;
tdresser 2016/03/07 14:57:56 Don't we need the delay info at this point?
76 };
77 } // namespace content
78
79 #endif // CONTENT_COMMON_INPUT_SYNTHETIC_POINTER_ACTION_PARAMS_H_
OLDNEW
« no previous file with comments | « content/common/input/synthetic_gesture_params.h ('k') | content/common/input/synthetic_pointer_action_params.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698