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 "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
11 #include "content/common/content_param_traits.h" | 11 #include "content/common/content_param_traits.h" |
12 #include "content/common/edit_command.h" | 12 #include "content/common/edit_command.h" |
| 13 #include "content/common/input/event_packet.h" |
| 14 #include "content/common/input/input_event.h" |
| 15 #include "content/common/input/input_event_state.h" |
13 #include "content/port/common/input_event_ack_state.h" | 16 #include "content/port/common/input_event_ack_state.h" |
14 #include "content/public/common/common_param_traits.h" | 17 #include "content/public/common/common_param_traits.h" |
15 #include "ipc/ipc_message_macros.h" | 18 #include "ipc/ipc_message_macros.h" |
16 #include "third_party/WebKit/public/web/WebInputEvent.h" | 19 #include "third_party/WebKit/public/web/WebInputEvent.h" |
17 #include "ui/base/latency_info.h" | 20 #include "ui/base/latency_info.h" |
18 #include "ui/gfx/point.h" | 21 #include "ui/gfx/point.h" |
19 #include "ui/gfx/rect.h" | 22 #include "ui/gfx/rect.h" |
20 | 23 |
21 #undef IPC_MESSAGE_EXPORT | 24 #undef IPC_MESSAGE_EXPORT |
22 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT | 25 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT |
23 | 26 |
24 #ifdef IPC_MESSAGE_START | 27 #ifdef IPC_MESSAGE_START |
25 #error IPC_MESSAGE_START | 28 #error IPC_MESSAGE_START |
26 #endif | 29 #endif |
27 | 30 |
28 #define IPC_MESSAGE_START InputMsgStart | 31 #define IPC_MESSAGE_START InputMsgStart |
29 | 32 |
30 IPC_ENUM_TRAITS(content::InputEventAckState) | 33 IPC_ENUM_TRAITS(content::InputEventAckState) |
| 34 IPC_ENUM_TRAITS(content::InputEventState) |
| 35 IPC_ENUM_TRAITS(content::InputEventType) |
31 | 36 |
32 IPC_STRUCT_TRAITS_BEGIN(content::EditCommand) | 37 IPC_STRUCT_TRAITS_BEGIN(content::EditCommand) |
33 IPC_STRUCT_TRAITS_MEMBER(name) | 38 IPC_STRUCT_TRAITS_MEMBER(name) |
34 IPC_STRUCT_TRAITS_MEMBER(value) | 39 IPC_STRUCT_TRAITS_MEMBER(value) |
35 IPC_STRUCT_TRAITS_END() | 40 IPC_STRUCT_TRAITS_END() |
36 | 41 |
| 42 IPC_STRUCT_TRAITS_BEGIN(content::InputEvent) |
| 43 IPC_STRUCT_TRAITS_MEMBER(id) |
| 44 IPC_STRUCT_TRAITS_MEMBER(type) |
| 45 IPC_STRUCT_TRAITS_MEMBER(message) |
| 46 IPC_STRUCT_TRAITS_MEMBER(state) |
| 47 IPC_STRUCT_TRAITS_END() |
| 48 |
| 49 IPC_STRUCT_TRAITS_BEGIN(content::EventPacket) |
| 50 IPC_STRUCT_TRAITS_MEMBER(id) |
| 51 IPC_STRUCT_TRAITS_MEMBER(events) |
| 52 IPC_STRUCT_TRAITS_END() |
| 53 |
37 // Sends an input event to the render widget. | 54 // Sends an input event to the render widget. |
38 IPC_MESSAGE_ROUTED3(InputMsg_HandleInputEvent, | 55 IPC_MESSAGE_ROUTED3(InputMsg_HandleInputEvent, |
39 IPC::WebInputEventPointer /* event */, | 56 IPC::WebInputEventPointer /* event */, |
40 ui::LatencyInfo /* latency_info */, | 57 ui::LatencyInfo /* latency_info */, |
41 bool /* is_keyboard_shortcut */) | 58 bool /* is_keyboard_shortcut */) |
42 | 59 |
43 // Sends the cursor visibility state to the render widget. | 60 // Sends the cursor visibility state to the render widget. |
44 IPC_MESSAGE_ROUTED1(InputMsg_CursorVisibilityChange, | 61 IPC_MESSAGE_ROUTED1(InputMsg_CursorVisibilityChange, |
45 bool /* is_visible */) | 62 bool /* is_visible */) |
46 | 63 |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 // Expects a SelectRange_ACK message when finished. | 123 // Expects a SelectRange_ACK message when finished. |
107 IPC_MESSAGE_ROUTED2(InputMsg_SelectRange, | 124 IPC_MESSAGE_ROUTED2(InputMsg_SelectRange, |
108 gfx::Point /* start */, | 125 gfx::Point /* start */, |
109 gfx::Point /* end */) | 126 gfx::Point /* end */) |
110 | 127 |
111 // Requests the renderer to move the caret selection toward the point. | 128 // Requests the renderer to move the caret selection toward the point. |
112 // Expects a MoveCaret_ACK message when finished. | 129 // Expects a MoveCaret_ACK message when finished. |
113 IPC_MESSAGE_ROUTED1(InputMsg_MoveCaret, | 130 IPC_MESSAGE_ROUTED1(InputMsg_MoveCaret, |
114 gfx::Point /* location */) | 131 gfx::Point /* location */) |
115 | 132 |
| 133 IPC_MESSAGE_ROUTED1(InputMsg_HandleEventPacket, |
| 134 content::EventPacket /* packet */) |
| 135 |
116 #if defined(OS_ANDROID) | 136 #if defined(OS_ANDROID) |
117 // Sent when the user clicks on the find result bar to activate a find result. | 137 // Sent when the user clicks on the find result bar to activate a find result. |
118 // The point (x,y) is in fractions of the content document's width and height. | 138 // The point (x,y) is in fractions of the content document's width and height. |
119 IPC_MESSAGE_ROUTED3(InputMsg_ActivateNearestFindResult, | 139 IPC_MESSAGE_ROUTED3(InputMsg_ActivateNearestFindResult, |
120 int /* request_id */, | 140 int /* request_id */, |
121 float /* x */, | 141 float /* x */, |
122 float /* y */) | 142 float /* y */) |
123 #endif | 143 #endif |
124 | 144 |
125 // ----------------------------------------------------------------------------- | 145 // ----------------------------------------------------------------------------- |
126 // Messages sent from the renderer to the browser. | 146 // Messages sent from the renderer to the browser. |
127 | 147 |
128 // Acknowledges receipt of a InputMsg_HandleInputEvent message. | 148 // Acknowledges receipt of a InputMsg_HandleInputEvent message. |
129 IPC_MESSAGE_ROUTED3(InputHostMsg_HandleInputEvent_ACK, | 149 IPC_MESSAGE_ROUTED3(InputHostMsg_HandleInputEvent_ACK, |
130 WebKit::WebInputEvent::Type, | 150 WebKit::WebInputEvent::Type, |
131 content::InputEventAckState /* ack_result */, | 151 content::InputEventAckState /* ack_result */, |
132 ui::LatencyInfo /* latency_info */) | 152 ui::LatencyInfo /* latency_info */) |
133 | 153 |
| 154 // Acknowledges receipt of a InputMsg_HandleEventPacket message. |
| 155 IPC_MESSAGE_ROUTED1(InputHostMsg_HandleEventPacket_ACK, |
| 156 content::EventPacket /* acked_packet */) |
| 157 |
134 | 158 |
135 // Adding a new message? Stick to the sort order above: first platform | 159 // Adding a new message? Stick to the sort order above: first platform |
136 // independent InputMsg, then ifdefs for platform specific InputMsg, then | 160 // independent InputMsg, then ifdefs for platform specific InputMsg, then |
137 // platform independent InputHostMsg, then ifdefs for platform specific | 161 // platform independent InputHostMsg, then ifdefs for platform specific |
138 // InputHostMsg. | 162 // InputHostMsg. |
OLD | NEW |