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

Unified 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, 10 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 side-by-side diff with in-line comments
Download patch
Index: content/common/input/synthetic_pointer_action_params.h
diff --git a/content/common/input/synthetic_pointer_action_params.h b/content/common/input/synthetic_pointer_action_params.h
new file mode 100644
index 0000000000000000000000000000000000000000..aea2ad3bd84d54f936152879cfc62d4464cee077
--- /dev/null
+++ b/content/common/input/synthetic_pointer_action_params.h
@@ -0,0 +1,79 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CONTENT_COMMON_INPUT_SYNTHETIC_POINTER_ACTION_PARAMS_H_
+#define CONTENT_COMMON_INPUT_SYNTHETIC_POINTER_ACTION_PARAMS_H_
+
+#include <stdint.h>
+
+#include "base/logging.h"
+#include "content/common/content_export.h"
+#include "content/common/input/synthetic_gesture_params.h"
+#include "ui/gfx/geometry/point_f.h"
+
+namespace content {
+
+struct CONTENT_EXPORT SyntheticPointerActionParams
+ : public SyntheticGestureParams {
+ public:
+ SyntheticPointerActionParams();
+ SyntheticPointerActionParams(PointerActionType type);
+ SyntheticPointerActionParams(const SyntheticPointerActionParams& other);
+ ~SyntheticPointerActionParams() override;
+
+ GestureType GetGestureType() const override;
+
+ static const SyntheticPointerActionParams* Cast(
+ const SyntheticGestureParams* gesture_params);
+
+ void set_index(uint32_t index) {
+ DCHECK(pointer_action_type !=
tdresser 2016/03/07 14:57:56 DCHECK_NE
+ SyntheticGestureParams::PointerActionType::PROCESS);
+ index_ = index;
+ }
+
+ void set_position(const gfx::PointF& position) {
+ DCHECK(pointer_action_type ==
+ SyntheticGestureParams::PointerActionType::PRESS ||
+ pointer_action_type ==
+ SyntheticGestureParams::PointerActionType::MOVE);
+ position_ = position;
+ }
+
+ const uint32_t& index() const {
+ DCHECK(pointer_action_type !=
tdresser 2016/03/07 14:57:56 DCHECK_NE, and below.
+ SyntheticGestureParams::PointerActionType::PROCESS);
+ return index_;
+ }
+
+ uint32_t& index() {
+ DCHECK(pointer_action_type !=
+ SyntheticGestureParams::PointerActionType::PROCESS);
+ return index_;
+ }
+
+ const gfx::PointF& position() const {
+ DCHECK(pointer_action_type ==
+ SyntheticGestureParams::PointerActionType::PRESS ||
+ pointer_action_type ==
+ SyntheticGestureParams::PointerActionType::MOVE);
+ return position_;
+ }
+
+ gfx::PointF& position() {
+ DCHECK(pointer_action_type ==
+ SyntheticGestureParams::PointerActionType::PRESS ||
+ pointer_action_type ==
+ SyntheticGestureParams::PointerActionType::MOVE);
+ return position_;
+ }
+ SyntheticGestureParams::PointerActionType pointer_action_type;
+
+ private:
+ gfx::PointF position_;
+ uint32_t index_;
tdresser 2016/03/07 14:57:56 Don't we need the delay info at this point?
+};
+} // namespace content
+
+#endif // CONTENT_COMMON_INPUT_SYNTHETIC_POINTER_ACTION_PARAMS_H_
« 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