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_ |