OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 // IPC messages for input events and other messages that require processing in |
| 6 // order relative to input events. |
| 7 // Multiply-included message file, hence no include guard. |
| 8 |
| 9 #include "base/string16.h" |
| 10 #include "content/common/content_export.h" |
| 11 #include "content/common/content_param_traits.h" |
| 12 #include "content/common/edit_command.h" |
| 13 #include "content/port/common/input_event_ack_state.h" |
| 14 #include "content/public/common/common_param_traits.h" |
| 15 #include "ipc/ipc_message_macros.h" |
| 16 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" |
| 17 #include "ui/gfx/point.h" |
| 18 #include "ui/gfx/rect.h" |
| 19 |
| 20 #undef IPC_MESSAGE_EXPORT |
| 21 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT |
| 22 |
| 23 #ifdef IPC_MESSAGE_START |
| 24 #error IPC_MESSAGE_START |
| 25 #endif |
| 26 |
| 27 #define IPC_MESSAGE_START InputMsgStart |
| 28 |
| 29 IPC_ENUM_TRAITS(content::InputEventAckState) |
| 30 |
| 31 IPC_STRUCT_TRAITS_BEGIN(content::EditCommand) |
| 32 IPC_STRUCT_TRAITS_MEMBER(name) |
| 33 IPC_STRUCT_TRAITS_MEMBER(value) |
| 34 IPC_STRUCT_TRAITS_END() |
| 35 |
| 36 // Sends an input event to the render widget. |
| 37 IPC_MESSAGE_ROUTED2(InputMsg_HandleInputEvent, |
| 38 IPC::WebInputEventPointer /* event */, |
| 39 bool /* is_keyboard_shortcut */) |
| 40 |
| 41 // This message notifies the renderer that the next key event is bound to one |
| 42 // or more pre-defined edit commands. If the next key event is not handled |
| 43 // by webkit, the specified edit commands shall be executed against current |
| 44 // focused frame. |
| 45 // Parameters |
| 46 // * edit_commands (see chrome/common/edit_command_types.h) |
| 47 // Contains one or more edit commands. |
| 48 // See third_party/WebKit/Source/WebCore/editing/EditorCommand.cpp for detailed |
| 49 // definition of webkit edit commands. |
| 50 // |
| 51 // This message must be sent just before sending a key event. |
| 52 IPC_MESSAGE_ROUTED1(InputMsg_SetEditCommandsForNextKeyEvent, |
| 53 std::vector<content::EditCommand> /* edit_commands */) |
| 54 |
| 55 // Message payload is the name/value of a WebCore edit command to execute. |
| 56 IPC_MESSAGE_ROUTED2(InputMsg_ExecuteEditCommand, |
| 57 std::string, /* name */ |
| 58 std::string /* value */) |
| 59 |
| 60 IPC_MESSAGE_ROUTED0(InputMsg_MouseCaptureLost) |
| 61 |
| 62 // TODO(darin): figure out how this meshes with RestoreFocus |
| 63 IPC_MESSAGE_ROUTED1(InputMsg_SetFocus, |
| 64 bool /* enable */) |
| 65 |
| 66 // Tells the renderer to focus the first (last if reverse is true) focusable |
| 67 // node. |
| 68 IPC_MESSAGE_ROUTED1(InputMsg_SetInitialFocus, |
| 69 bool /* reverse */) |
| 70 |
| 71 // Tells the renderer to scroll the currently focused node into rect only if |
| 72 // the currently focused node is a Text node (textfield, text area or content |
| 73 // editable divs). |
| 74 IPC_MESSAGE_ROUTED1(InputMsg_ScrollFocusedEditableNodeIntoRect, gfx::Rect) |
| 75 |
| 76 // These messages are typically generated from context menus and request the |
| 77 // renderer to apply the specified operation to the current selection. |
| 78 IPC_MESSAGE_ROUTED0(InputMsg_Undo) |
| 79 IPC_MESSAGE_ROUTED0(InputMsg_Redo) |
| 80 IPC_MESSAGE_ROUTED0(InputMsg_Cut) |
| 81 IPC_MESSAGE_ROUTED0(InputMsg_Copy) |
| 82 #if defined(OS_MACOSX) |
| 83 IPC_MESSAGE_ROUTED0(InputMsg_CopyToFindPboard) |
| 84 #endif |
| 85 IPC_MESSAGE_ROUTED0(InputMsg_Paste) |
| 86 IPC_MESSAGE_ROUTED0(InputMsg_PasteAndMatchStyle) |
| 87 // Replaces the selected region or a word around the cursor with the |
| 88 // specified string. |
| 89 IPC_MESSAGE_ROUTED1(InputMsg_Replace, |
| 90 string16) |
| 91 // Replaces the misspelling in the selected region with the specified string. |
| 92 IPC_MESSAGE_ROUTED1(InputMsg_ReplaceMisspelling, |
| 93 string16) |
| 94 IPC_MESSAGE_ROUTED0(InputMsg_Delete) |
| 95 IPC_MESSAGE_ROUTED0(InputMsg_SelectAll) |
| 96 |
| 97 IPC_MESSAGE_ROUTED0(InputMsg_Unselect) |
| 98 |
| 99 // Requests the renderer to select the region between two points. |
| 100 // Expects a SelectRange_ACK message when finished. |
| 101 IPC_MESSAGE_ROUTED2(InputMsg_SelectRange, |
| 102 gfx::Point /* start */, |
| 103 gfx::Point /* end */) |
| 104 |
| 105 // Requests the renderer to move the caret selection toward the point. |
| 106 // Expects a MoveCaret_ACK message when finished. |
| 107 IPC_MESSAGE_ROUTED1(InputMsg_MoveCaret, |
| 108 gfx::Point /* location */) |
| 109 |
| 110 #if defined(OS_ANDROID) |
| 111 // Sent when the user clicks on the find result bar to activate a find result. |
| 112 // The point (x,y) is in fractions of the content document's width and height. |
| 113 IPC_MESSAGE_ROUTED3(InputMsg_ActivateNearestFindResult, |
| 114 int /* request_id */, |
| 115 float /* x */, |
| 116 float /* y */) |
| 117 #endif |
| 118 |
| 119 // ----------------------------------------------------------------------------- |
| 120 // Messages sent from the renderer to the browser. |
| 121 |
| 122 // Acknowledges receipt of a InputMsg_HandleInputEvent message. |
| 123 IPC_MESSAGE_ROUTED2(InputHostMsg_HandleInputEvent_ACK, |
| 124 WebKit::WebInputEvent::Type, |
| 125 content::InputEventAckState /* ack_result */) |
| 126 |
| 127 |
| 128 // Adding a new message? Stick to the sort order above: first platform |
| 129 // independent InputMsg, then ifdefs for platform specific InputMsg, then |
| 130 // platform independent InputHostMsg, then ifdefs for platform specific |
| 131 // InputHostMsg. |
OLD | NEW |