| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 // IPC messages for input events and other messages that require processing in | 5 // IPC messages for input events and other messages that require processing in |
| 6 // order relative to input events. | 6 // order relative to input events. |
| 7 // Multiply-included message file, hence no include guard. | 7 // Multiply-included message file, hence no include guard. |
| 8 | 8 |
| 9 #include "base/strings/string16.h" | 9 #include "base/strings/string16.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| 11 #include "content/common/content_export.h" | 11 #include "content/common/content_export.h" |
| 12 #include "content/common/content_param_traits.h" | 12 #include "content/common/content_param_traits.h" |
| 13 #include "content/common/edit_command.h" | 13 #include "content/common/edit_command.h" |
| 14 #include "content/common/input/did_overscroll_params.h" | 14 #include "content/common/input/did_overscroll_params.h" |
| 15 #include "content/common/input/input_event.h" | 15 #include "content/common/input/input_event.h" |
| 16 #include "content/common/input/input_event_ack.h" | 16 #include "content/common/input/input_event_ack.h" |
| 17 #include "content/common/input/input_event_ack_state.h" | 17 #include "content/common/input/input_event_ack_state.h" |
| 18 #include "content/common/input/input_event_dispatch_type.h" | 18 #include "content/common/input/input_event_dispatch_type.h" |
| 19 #include "content/common/input/input_param_traits.h" | 19 #include "content/common/input/input_param_traits.h" |
| 20 #include "content/common/input/synthetic_gesture_packet.h" | 20 #include "content/common/input/synthetic_gesture_packet.h" |
| 21 #include "content/common/input/synthetic_gesture_params.h" | 21 #include "content/common/input/synthetic_gesture_params.h" |
| 22 #include "content/common/input/synthetic_pinch_gesture_params.h" | 22 #include "content/common/input/synthetic_pinch_gesture_params.h" |
| 23 #include "content/common/input/synthetic_pointer_action_params.h" |
| 23 #include "content/common/input/synthetic_smooth_drag_gesture_params.h" | 24 #include "content/common/input/synthetic_smooth_drag_gesture_params.h" |
| 24 #include "content/common/input/synthetic_smooth_scroll_gesture_params.h" | 25 #include "content/common/input/synthetic_smooth_scroll_gesture_params.h" |
| 25 #include "content/common/input/synthetic_tap_gesture_params.h" | 26 #include "content/common/input/synthetic_tap_gesture_params.h" |
| 26 #include "content/common/input/touch_action.h" | 27 #include "content/common/input/touch_action.h" |
| 27 #include "content/public/common/common_param_traits.h" | 28 #include "content/public/common/common_param_traits.h" |
| 28 #include "ipc/ipc_message_macros.h" | 29 #include "ipc/ipc_message_macros.h" |
| 29 #include "third_party/WebKit/public/web/WebInputEvent.h" | 30 #include "third_party/WebKit/public/web/WebInputEvent.h" |
| 30 #include "ui/events/ipc/latency_info_param_traits.h" | 31 #include "ui/events/ipc/latency_info_param_traits.h" |
| 31 #include "ui/gfx/geometry/point.h" | 32 #include "ui/gfx/geometry/point.h" |
| 32 #include "ui/gfx/geometry/rect.h" | 33 #include "ui/gfx/geometry/rect.h" |
| 33 #include "ui/gfx/geometry/vector2d_f.h" | 34 #include "ui/gfx/geometry/vector2d_f.h" |
| 34 #include "ui/gfx/ipc/gfx_param_traits.h" | 35 #include "ui/gfx/ipc/gfx_param_traits.h" |
| 35 #include "ui/gfx/range/range.h" | 36 #include "ui/gfx/range/range.h" |
| 36 | 37 |
| 37 #undef IPC_MESSAGE_EXPORT | 38 #undef IPC_MESSAGE_EXPORT |
| 38 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT | 39 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT |
| 39 | 40 |
| 40 #ifdef IPC_MESSAGE_START | 41 #ifdef IPC_MESSAGE_START |
| 41 #error IPC_MESSAGE_START | 42 #error IPC_MESSAGE_START |
| 42 #endif | 43 #endif |
| 43 | 44 |
| 44 #define IPC_MESSAGE_START InputMsgStart | 45 #define IPC_MESSAGE_START InputMsgStart |
| 45 | 46 |
| 46 IPC_ENUM_TRAITS_MAX_VALUE( | 47 IPC_ENUM_TRAITS_MAX_VALUE( |
| 47 content::SyntheticGestureParams::GestureSourceType, | 48 content::SyntheticGestureParams::GestureSourceType, |
| 48 content::SyntheticGestureParams::GESTURE_SOURCE_TYPE_MAX) | 49 content::SyntheticGestureParams::GESTURE_SOURCE_TYPE_MAX) |
| 49 IPC_ENUM_TRAITS_MAX_VALUE( | 50 IPC_ENUM_TRAITS_MAX_VALUE( |
| 50 content::SyntheticGestureParams::GestureType, | 51 content::SyntheticGestureParams::GestureType, |
| 51 content::SyntheticGestureParams::SYNTHETIC_GESTURE_TYPE_MAX) | 52 content::SyntheticGestureParams::SYNTHETIC_GESTURE_TYPE_MAX) |
| 53 IPC_ENUM_TRAITS_MAX_VALUE( |
| 54 content::SyntheticGestureParams::PointerActionType, |
| 55 content::SyntheticGestureParams::PointerActionType::POINTER_ACTION_TYPE_MAX) |
| 52 IPC_ENUM_TRAITS_MAX_VALUE(content::InputEventDispatchType, | 56 IPC_ENUM_TRAITS_MAX_VALUE(content::InputEventDispatchType, |
| 53 content::InputEventDispatchType::DISPATCH_TYPE_MAX) | 57 content::InputEventDispatchType::DISPATCH_TYPE_MAX) |
| 54 IPC_ENUM_TRAITS_VALIDATE(content::TouchAction, ( | 58 IPC_ENUM_TRAITS_VALIDATE(content::TouchAction, ( |
| 55 value >= 0 && | 59 value >= 0 && |
| 56 value <= content::TOUCH_ACTION_MAX && | 60 value <= content::TOUCH_ACTION_MAX && |
| 57 (!(value & content::TOUCH_ACTION_NONE) || | 61 (!(value & content::TOUCH_ACTION_NONE) || |
| 58 (value == content::TOUCH_ACTION_NONE)) && | 62 (value == content::TOUCH_ACTION_NONE)) && |
| 59 (!(value & content::TOUCH_ACTION_PINCH_ZOOM) || | 63 (!(value & content::TOUCH_ACTION_PINCH_ZOOM) || |
| 60 (value == content::TOUCH_ACTION_MANIPULATION)))) | 64 (value == content::TOUCH_ACTION_MANIPULATION)))) |
| 61 | 65 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 IPC_STRUCT_TRAITS_MEMBER(anchor) | 105 IPC_STRUCT_TRAITS_MEMBER(anchor) |
| 102 IPC_STRUCT_TRAITS_MEMBER(relative_pointer_speed_in_pixels_s) | 106 IPC_STRUCT_TRAITS_MEMBER(relative_pointer_speed_in_pixels_s) |
| 103 IPC_STRUCT_TRAITS_END() | 107 IPC_STRUCT_TRAITS_END() |
| 104 | 108 |
| 105 IPC_STRUCT_TRAITS_BEGIN(content::SyntheticTapGestureParams) | 109 IPC_STRUCT_TRAITS_BEGIN(content::SyntheticTapGestureParams) |
| 106 IPC_STRUCT_TRAITS_PARENT(content::SyntheticGestureParams) | 110 IPC_STRUCT_TRAITS_PARENT(content::SyntheticGestureParams) |
| 107 IPC_STRUCT_TRAITS_MEMBER(position) | 111 IPC_STRUCT_TRAITS_MEMBER(position) |
| 108 IPC_STRUCT_TRAITS_MEMBER(duration_ms) | 112 IPC_STRUCT_TRAITS_MEMBER(duration_ms) |
| 109 IPC_STRUCT_TRAITS_END() | 113 IPC_STRUCT_TRAITS_END() |
| 110 | 114 |
| 115 IPC_STRUCT_TRAITS_BEGIN(content::SyntheticPointerActionParams) |
| 116 IPC_STRUCT_TRAITS_PARENT(content::SyntheticGestureParams) |
| 117 IPC_STRUCT_TRAITS_MEMBER(pointer_action_type) |
| 118 IPC_STRUCT_TRAITS_MEMBER(index()) |
| 119 IPC_STRUCT_TRAITS_MEMBER(position()) |
| 120 IPC_STRUCT_TRAITS_END() |
| 121 |
| 111 IPC_STRUCT_TRAITS_BEGIN(content::InputEventAck) | 122 IPC_STRUCT_TRAITS_BEGIN(content::InputEventAck) |
| 112 IPC_STRUCT_TRAITS_MEMBER(type) | 123 IPC_STRUCT_TRAITS_MEMBER(type) |
| 113 IPC_STRUCT_TRAITS_MEMBER(state) | 124 IPC_STRUCT_TRAITS_MEMBER(state) |
| 114 IPC_STRUCT_TRAITS_MEMBER(latency) | 125 IPC_STRUCT_TRAITS_MEMBER(latency) |
| 115 IPC_STRUCT_TRAITS_MEMBER(overscroll) | 126 IPC_STRUCT_TRAITS_MEMBER(overscroll) |
| 116 IPC_STRUCT_TRAITS_MEMBER(unique_touch_event_id) | 127 IPC_STRUCT_TRAITS_MEMBER(unique_touch_event_id) |
| 117 IPC_STRUCT_TRAITS_END() | 128 IPC_STRUCT_TRAITS_END() |
| 118 | 129 |
| 119 // Sends an input event to the render widget. | 130 // Sends an input event to the render widget. |
| 120 IPC_MESSAGE_ROUTED3(InputMsg_HandleInputEvent, | 131 IPC_MESSAGE_ROUTED3(InputMsg_HandleInputEvent, |
| (...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 // This IPC message sends the character bounds after every composition change | 299 // This IPC message sends the character bounds after every composition change |
| 289 // to always have correct bound info. | 300 // to always have correct bound info. |
| 290 IPC_MESSAGE_ROUTED2(InputHostMsg_ImeCompositionRangeChanged, | 301 IPC_MESSAGE_ROUTED2(InputHostMsg_ImeCompositionRangeChanged, |
| 291 gfx::Range /* composition range */, | 302 gfx::Range /* composition range */, |
| 292 std::vector<gfx::Rect> /* character bounds */) | 303 std::vector<gfx::Rect> /* character bounds */) |
| 293 | 304 |
| 294 // Adding a new message? Stick to the sort order above: first platform | 305 // Adding a new message? Stick to the sort order above: first platform |
| 295 // independent InputMsg, then ifdefs for platform specific InputMsg, then | 306 // independent InputMsg, then ifdefs for platform specific InputMsg, then |
| 296 // platform independent InputHostMsg, then ifdefs for platform specific | 307 // platform independent InputHostMsg, then ifdefs for platform specific |
| 297 // InputHostMsg. | 308 // InputHostMsg. |
| OLD | NEW |