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

Side by Side Diff: content/common/input_messages.h

Issue 19624005: Add InputEvent and EventPacket types for batched input delivery (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Code review Created 7 years, 3 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 unified diff | Download patch
OLDNEW
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/input_event.h"
14 #include "content/common/input/input_event_disposition.h"
15 #include "content/common/input/input_param_traits.h"
16 #include "content/common/input/ipc_input_event_payload.h"
17 #include "content/common/input/event_packet.h"
13 #include "content/port/common/input_event_ack_state.h" 18 #include "content/port/common/input_event_ack_state.h"
14 #include "content/public/common/common_param_traits.h" 19 #include "content/public/common/common_param_traits.h"
15 #include "ipc/ipc_message_macros.h" 20 #include "ipc/ipc_message_macros.h"
16 #include "third_party/WebKit/public/web/WebInputEvent.h" 21 #include "third_party/WebKit/public/web/WebInputEvent.h"
17 #include "ui/base/latency_info.h" 22 #include "ui/base/latency_info.h"
18 #include "ui/gfx/point.h" 23 #include "ui/gfx/point.h"
19 #include "ui/gfx/rect.h" 24 #include "ui/gfx/rect.h"
20 25
21 #undef IPC_MESSAGE_EXPORT 26 #undef IPC_MESSAGE_EXPORT
22 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT 27 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT
23 28
24 #ifdef IPC_MESSAGE_START 29 #ifdef IPC_MESSAGE_START
25 #error IPC_MESSAGE_START 30 #error IPC_MESSAGE_START
26 #endif 31 #endif
27 32
28 #define IPC_MESSAGE_START InputMsgStart 33 #define IPC_MESSAGE_START InputMsgStart
29 34
35 IPC_ENUM_TRAITS(content::InputEvent::Payload::Type)
palmer 2013/09/03 23:12:47 IPC_ENUM_TRAITS() is deprecated; use IPC_ENUM_TRAI
jdduke (slow) 2013/09/04 17:53:24 Done.
30 IPC_ENUM_TRAITS(content::InputEventAckState) 36 IPC_ENUM_TRAITS(content::InputEventAckState)
palmer 2013/09/03 23:12:47 Might as well change this one now, too.
jdduke (slow) 2013/09/04 17:53:24 Done.
37 IPC_ENUM_TRAITS(content::InputEventDisposition)
31 38
32 IPC_STRUCT_TRAITS_BEGIN(content::EditCommand) 39 IPC_STRUCT_TRAITS_BEGIN(content::EditCommand)
33 IPC_STRUCT_TRAITS_MEMBER(name) 40 IPC_STRUCT_TRAITS_MEMBER(name)
34 IPC_STRUCT_TRAITS_MEMBER(value) 41 IPC_STRUCT_TRAITS_MEMBER(value)
35 IPC_STRUCT_TRAITS_END() 42 IPC_STRUCT_TRAITS_END()
36 43
44 IPC_STRUCT_TRAITS_BEGIN(content::EventPacket)
45 IPC_STRUCT_TRAITS_MEMBER(id)
46 IPC_STRUCT_TRAITS_MEMBER(events)
47 IPC_STRUCT_TRAITS_END()
48
49 IPC_STRUCT_TRAITS_BEGIN(content::IPCInputEventPayload)
50 IPC_STRUCT_TRAITS_MEMBER(message)
51 IPC_STRUCT_TRAITS_END()
52
37 // Sends an input event to the render widget. 53 // Sends an input event to the render widget.
38 IPC_MESSAGE_ROUTED3(InputMsg_HandleInputEvent, 54 IPC_MESSAGE_ROUTED3(InputMsg_HandleInputEvent,
39 IPC::WebInputEventPointer /* event */, 55 IPC::WebInputEventPointer /* event */,
40 ui::LatencyInfo /* latency_info */, 56 ui::LatencyInfo /* latency_info */,
41 bool /* is_keyboard_shortcut */) 57 bool /* is_keyboard_shortcut */)
42 58
59 // Sends an event packet to the render widget.
60 IPC_MESSAGE_ROUTED2(InputMsg_HandleEventPacket,
61 content::EventPacket /* event_packet */,
62 content::InputEventDispositions /* dispositions */)
63
43 // Sends the cursor visibility state to the render widget. 64 // Sends the cursor visibility state to the render widget.
44 IPC_MESSAGE_ROUTED1(InputMsg_CursorVisibilityChange, 65 IPC_MESSAGE_ROUTED1(InputMsg_CursorVisibilityChange,
45 bool /* is_visible */) 66 bool /* is_visible */)
46 67
47 // This message notifies the renderer that the next key event is bound to one 68 // This message notifies the renderer that the next key event is bound to one
48 // or more pre-defined edit commands. If the next key event is not handled 69 // or more pre-defined edit commands. If the next key event is not handled
49 // by webkit, the specified edit commands shall be executed against current 70 // by webkit, the specified edit commands shall be executed against current
50 // focused frame. 71 // focused frame.
51 // Parameters 72 // Parameters
52 // * edit_commands (see chrome/common/edit_command_types.h) 73 // * edit_commands (see chrome/common/edit_command_types.h)
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 145
125 // ----------------------------------------------------------------------------- 146 // -----------------------------------------------------------------------------
126 // Messages sent from the renderer to the browser. 147 // Messages sent from the renderer to the browser.
127 148
128 // Acknowledges receipt of a InputMsg_HandleInputEvent message. 149 // Acknowledges receipt of a InputMsg_HandleInputEvent message.
129 IPC_MESSAGE_ROUTED3(InputHostMsg_HandleInputEvent_ACK, 150 IPC_MESSAGE_ROUTED3(InputHostMsg_HandleInputEvent_ACK,
130 WebKit::WebInputEvent::Type, 151 WebKit::WebInputEvent::Type,
131 content::InputEventAckState /* ack_result */, 152 content::InputEventAckState /* ack_result */,
132 ui::LatencyInfo /* latency_info */) 153 ui::LatencyInfo /* latency_info */)
133 154
155 IPC_MESSAGE_ROUTED2(InputHostMsg_HandleEventPacket_ACK,
156 int64 /* event_packet_id */,
157 content::InputEventDispositions /* dispositions */)
158
134 159
135 // Adding a new message? Stick to the sort order above: first platform 160 // Adding a new message? Stick to the sort order above: first platform
136 // independent InputMsg, then ifdefs for platform specific InputMsg, then 161 // independent InputMsg, then ifdefs for platform specific InputMsg, then
137 // platform independent InputHostMsg, then ifdefs for platform specific 162 // platform independent InputHostMsg, then ifdefs for platform specific
138 // InputHostMsg. 163 // InputHostMsg.
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698