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

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: 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 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..ceec9ff9afe788c099412a0b80798ac850a5e630
--- /dev/null
+++ b/content/common/input/synthetic_pointer_action_params.h
@@ -0,0 +1,75 @@
+// 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 "base/logging.h"
+#include "content/common/content_export.h"
+#include "content/common/input/input_param_traits.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_pointer_action_type(
+ SyntheticGestureParams::PointerActionType pointer_action_type) {
+ pointer_action_type_arg = pointer_action_type;
+ }
+
+ void set_index(int index) {
+ DCHECK(pointer_action_type_arg !=
+ SyntheticGestureParams::PointerActionType::PROCESS);
+ index_arg = index;
+ }
+
+ void set_position(const gfx::PointF& position) {
+ DCHECK(pointer_action_type_arg ==
+ SyntheticGestureParams::PointerActionType::PRESS ||
+ pointer_action_type_arg ==
+ SyntheticGestureParams::PointerActionType::MOVE);
+ position_arg = position;
+ }
+
+ SyntheticGestureParams::PointerActionType pointer_action_type() const {
+ return pointer_action_type_arg;
+ }
+
+ int index() const {
+ DCHECK(pointer_action_type_arg !=
+ SyntheticGestureParams::PointerActionType::PROCESS);
+ return index_arg;
+ }
+
+ gfx::PointF position() const {
+ DCHECK(pointer_action_type_arg ==
+ SyntheticGestureParams::PointerActionType::PRESS ||
+ pointer_action_type_arg ==
+ SyntheticGestureParams::PointerActionType::MOVE);
+ return position_arg;
+ }
+
+ private:
+ friend struct IPC::ParamTraits<content::SyntheticPointerActionParams>;
+
+ SyntheticGestureParams::PointerActionType pointer_action_type_arg;
+ 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.
+ int index_arg;
+};
+} // namespace content
+
+#endif // CONTENT_COMMON_INPUT_SYNTHETIC_POINTER_ACTION_PARAMS_H_

Powered by Google App Engine
This is Rietveld 408576698