| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_COMMON_INPUT_SYNTHETIC_POINTER_ACTION_PARAMS_H_ | 5 #ifndef CONTENT_COMMON_INPUT_SYNTHETIC_POINTER_ACTION_PARAMS_H_ |
| 6 #define CONTENT_COMMON_INPUT_SYNTHETIC_POINTER_ACTION_PARAMS_H_ | 6 #define CONTENT_COMMON_INPUT_SYNTHETIC_POINTER_ACTION_PARAMS_H_ |
| 7 | 7 |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "content/common/content_export.h" | 9 #include "content/common/content_export.h" |
| 10 #include "content/common/input/input_param_traits.h" | 10 #include "content/common/input/input_param_traits.h" |
| 11 #include "content/common/input/synthetic_gesture_params.h" | 11 #include "content/common/input/synthetic_gesture_params.h" |
| 12 #include "ui/gfx/geometry/point_f.h" | 12 #include "ui/gfx/geometry/point_f.h" |
| 13 | 13 |
| 14 namespace ipc_fuzzer { |
| 15 template <class T> |
| 16 struct FuzzTraits; |
| 17 } // namespace ipc_fuzzer |
| 18 |
| 14 namespace content { | 19 namespace content { |
| 15 | 20 |
| 16 struct CONTENT_EXPORT SyntheticPointerActionParams | 21 struct CONTENT_EXPORT SyntheticPointerActionParams |
| 17 : public SyntheticGestureParams { | 22 : public SyntheticGestureParams { |
| 18 public: | 23 public: |
| 19 // Actions are queued up until we receive a PROCESS action, at which point | 24 // Actions are queued up until we receive a PROCESS action, at which point |
| 20 // we'll dispatch all queued events. | 25 // we'll dispatch all queued events. |
| 21 enum class PointerActionType { | 26 enum class PointerActionType { |
| 22 NOT_INITIALIZED, | 27 NOT_INITIALIZED, |
| 23 PRESS, | 28 PRESS, |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 } | 65 } |
| 61 | 66 |
| 62 gfx::PointF position() const { | 67 gfx::PointF position() const { |
| 63 DCHECK(pointer_action_type_ == PointerActionType::PRESS || | 68 DCHECK(pointer_action_type_ == PointerActionType::PRESS || |
| 64 pointer_action_type_ == PointerActionType::MOVE); | 69 pointer_action_type_ == PointerActionType::MOVE); |
| 65 return position_; | 70 return position_; |
| 66 } | 71 } |
| 67 | 72 |
| 68 private: | 73 private: |
| 69 friend struct IPC::ParamTraits<content::SyntheticPointerActionParams>; | 74 friend struct IPC::ParamTraits<content::SyntheticPointerActionParams>; |
| 75 friend struct ipc_fuzzer::FuzzTraits<content::SyntheticPointerActionParams>; |
| 70 | 76 |
| 71 PointerActionType pointer_action_type_; | 77 PointerActionType pointer_action_type_; |
| 72 // Pass a position value when sending a press or move action. | 78 // Pass a position value when sending a press or move action. |
| 73 gfx::PointF position_; | 79 gfx::PointF position_; |
| 74 // Pass an index value except if the pointer_action_type_ is PROCESS. | 80 // Pass an index value except if the pointer_action_type_ is PROCESS. |
| 75 int index_; | 81 int index_; |
| 76 }; | 82 }; |
| 77 | 83 |
| 78 } // namespace content | 84 } // namespace content |
| 79 | 85 |
| 80 #endif // CONTENT_COMMON_INPUT_SYNTHETIC_POINTER_ACTION_PARAMS_H_ | 86 #endif // CONTENT_COMMON_INPUT_SYNTHETIC_POINTER_ACTION_PARAMS_H_ |
| OLD | NEW |