| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 accessibility. | 5 // IPC messages for accessibility. |
| 6 // Multiply-included message file, hence no include guard. | 6 // Multiply-included message file, hence no include guard. |
| 7 | 7 |
| 8 #include "content/common/ax_content_node_data.h" | 8 #include "content/common/ax_content_node_data.h" |
| 9 #include "content/common/content_export.h" | 9 #include "content/common/content_export.h" |
| 10 #include "content/common/view_message_enums.h" | 10 #include "content/common/view_message_enums.h" |
| 11 #include "ipc/ipc_message_macros.h" | 11 #include "ipc/ipc_message_macros.h" |
| 12 #include "ipc/ipc_message_utils.h" | 12 #include "ipc/ipc_message_utils.h" |
| 13 #include "ipc/ipc_param_traits.h" | 13 #include "ipc/ipc_param_traits.h" |
| 14 #include "ipc/param_traits_macros.h" | 14 #include "ipc/param_traits_macros.h" |
| 15 #include "third_party/WebKit/public/web/WebAXEnums.h" | 15 #include "third_party/WebKit/public/web/WebAXEnums.h" |
| 16 #include "ui/accessibility/ax_action_data.h" |
| 16 #include "ui/accessibility/ax_node_data.h" | 17 #include "ui/accessibility/ax_node_data.h" |
| 17 #include "ui/accessibility/ax_relative_bounds.h" | 18 #include "ui/accessibility/ax_relative_bounds.h" |
| 18 #include "ui/accessibility/ax_tree_update.h" | 19 #include "ui/accessibility/ax_tree_update.h" |
| 19 #include "ui/gfx/transform.h" | 20 #include "ui/gfx/transform.h" |
| 20 | 21 |
| 21 #undef IPC_MESSAGE_EXPORT | 22 #undef IPC_MESSAGE_EXPORT |
| 22 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT | 23 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT |
| 23 | 24 |
| 24 #define IPC_MESSAGE_START AccessibilityMsgStart | 25 #define IPC_MESSAGE_START AccessibilityMsgStart |
| 25 | 26 |
| 26 IPC_ENUM_TRAITS_MAX_VALUE(content::AXContentIntAttribute, | 27 IPC_ENUM_TRAITS_MAX_VALUE(content::AXContentIntAttribute, |
| 27 content::AX_CONTENT_INT_ATTRIBUTE_LAST) | 28 content::AX_CONTENT_INT_ATTRIBUTE_LAST) |
| 29 IPC_ENUM_TRAITS_MAX_VALUE(ui::AXAction, ui::AX_ACTION_LAST) |
| 30 |
| 31 IPC_STRUCT_TRAITS_BEGIN(ui::AXActionData) |
| 32 IPC_STRUCT_TRAITS_MEMBER(action) |
| 33 IPC_STRUCT_TRAITS_MEMBER(target_node_id) |
| 34 IPC_STRUCT_TRAITS_MEMBER(flags) |
| 35 IPC_STRUCT_TRAITS_MEMBER(anchor_node_id) |
| 36 IPC_STRUCT_TRAITS_MEMBER(anchor_offset) |
| 37 IPC_STRUCT_TRAITS_MEMBER(focus_node_id) |
| 38 IPC_STRUCT_TRAITS_MEMBER(focus_offset) |
| 39 IPC_STRUCT_TRAITS_MEMBER(target_rect) |
| 40 IPC_STRUCT_TRAITS_MEMBER(target_point) |
| 41 IPC_STRUCT_TRAITS_MEMBER(value) |
| 42 IPC_STRUCT_TRAITS_END() |
| 28 | 43 |
| 29 IPC_STRUCT_TRAITS_BEGIN(content::AXContentNodeData) | 44 IPC_STRUCT_TRAITS_BEGIN(content::AXContentNodeData) |
| 30 IPC_STRUCT_TRAITS_MEMBER(id) | 45 IPC_STRUCT_TRAITS_MEMBER(id) |
| 31 IPC_STRUCT_TRAITS_MEMBER(role) | 46 IPC_STRUCT_TRAITS_MEMBER(role) |
| 32 IPC_STRUCT_TRAITS_MEMBER(state) | 47 IPC_STRUCT_TRAITS_MEMBER(state) |
| 33 IPC_STRUCT_TRAITS_MEMBER(location) | 48 IPC_STRUCT_TRAITS_MEMBER(location) |
| 34 IPC_STRUCT_TRAITS_MEMBER(transform) | 49 IPC_STRUCT_TRAITS_MEMBER(transform) |
| 35 IPC_STRUCT_TRAITS_MEMBER(string_attributes) | 50 IPC_STRUCT_TRAITS_MEMBER(string_attributes) |
| 36 IPC_STRUCT_TRAITS_MEMBER(int_attributes) | 51 IPC_STRUCT_TRAITS_MEMBER(int_attributes) |
| 37 IPC_STRUCT_TRAITS_MEMBER(float_attributes) | 52 IPC_STRUCT_TRAITS_MEMBER(float_attributes) |
| (...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 | 124 |
| 110 // The id of the accessibility object for the end of the match range. | 125 // The id of the accessibility object for the end of the match range. |
| 111 IPC_STRUCT_MEMBER(int, end_id) | 126 IPC_STRUCT_MEMBER(int, end_id) |
| 112 | 127 |
| 113 // The character offset into the text of the end object. | 128 // The character offset into the text of the end object. |
| 114 IPC_STRUCT_MEMBER(int, end_offset) | 129 IPC_STRUCT_MEMBER(int, end_offset) |
| 115 IPC_STRUCT_END() | 130 IPC_STRUCT_END() |
| 116 | 131 |
| 117 // Messages sent from the browser to the renderer. | 132 // Messages sent from the browser to the renderer. |
| 118 | 133 |
| 119 // Relay a request from assistive technology to set focus to a given node. | 134 // Relay a request from assistive technology to perform an action, |
| 120 IPC_MESSAGE_ROUTED1(AccessibilityMsg_SetFocus, | 135 // such as focusing or clicking on a node. |
| 121 int /* object id */) | 136 IPC_MESSAGE_ROUTED1(AccessibilityMsg_PerformAction, |
| 122 | 137 ui::AXActionData /* action parameters */) |
| 123 // Relay a request from assistive technology to perform the default action | |
| 124 // on a given node. | |
| 125 IPC_MESSAGE_ROUTED1(AccessibilityMsg_DoDefaultAction, | |
| 126 int /* object id */) | |
| 127 | |
| 128 // Relay a request from assistive technology to make a given object | |
| 129 // visible by scrolling as many scrollable containers as possible. | |
| 130 // In addition, if it's not possible to make the entire object visible, | |
| 131 // scroll so that the |subfocus| rect is visible at least. The subfocus | |
| 132 // rect is in local coordinates of the object itself. | |
| 133 IPC_MESSAGE_ROUTED2(AccessibilityMsg_ScrollToMakeVisible, | |
| 134 int /* object id */, | |
| 135 gfx::Rect /* subfocus */) | |
| 136 | |
| 137 // Relay a request from assistive technology to show the context menu for a | |
| 138 // given object. | |
| 139 IPC_MESSAGE_ROUTED1(AccessibilityMsg_ShowContextMenu, int /* object id */) | |
| 140 | |
| 141 // Relay a request from assistive technology to move a given object | |
| 142 // to a specific location, in the WebContents area coordinate space, i.e. | |
| 143 // (0, 0) is the top-left corner of the WebContents. | |
| 144 IPC_MESSAGE_ROUTED2(AccessibilityMsg_ScrollToPoint, | |
| 145 int /* object id */, | |
| 146 gfx::Point /* new location */) | |
| 147 | |
| 148 // Relay a request from assistive technology to set the scroll offset | |
| 149 // of an accessibility object that's a scroll container, to a specific | |
| 150 // offset. | |
| 151 IPC_MESSAGE_ROUTED2(AccessibilityMsg_SetScrollOffset, | |
| 152 int /* object id */, | |
| 153 gfx::Point /* new offset */) | |
| 154 | |
| 155 // Relay a request from assistive technology to set the cursor or | |
| 156 // selection within a document. | |
| 157 IPC_MESSAGE_ROUTED4(AccessibilityMsg_SetSelection, | |
| 158 int /* New anchor object id */, | |
| 159 int /* New anchor offset */, | |
| 160 int /* New focus object id */, | |
| 161 int /* New focus offset */) | |
| 162 | |
| 163 // Relay a request from assistive technology to set the value of an | |
| 164 // editable text element. | |
| 165 IPC_MESSAGE_ROUTED2(AccessibilityMsg_SetValue, | |
| 166 int /* object id */, | |
| 167 base::string16 /* Value */) | |
| 168 | 138 |
| 169 // Determine the accessibility object under a given point. | 139 // Determine the accessibility object under a given point. |
| 170 // | 140 // |
| 171 // If the target is an object with a child frame (like if the hit test | 141 // If the target is an object with a child frame (like if the hit test |
| 172 // result is an iframe element), it responds with | 142 // result is an iframe element), it responds with |
| 173 // AccessibilityHostMsg_ChildFrameHitTestResult so that the | 143 // AccessibilityHostMsg_ChildFrameHitTestResult so that the |
| 174 // hit test can be performed recursively on the child frame. Otherwise | 144 // hit test can be performed recursively on the child frame. Otherwise |
| 175 // it fires an accessibility event of type ui::AX_EVENT_HOVER on the target. | 145 // it fires an accessibility event of type ui::AX_EVENT_HOVER on the target. |
| 176 IPC_MESSAGE_ROUTED1(AccessibilityMsg_HitTest, | 146 IPC_MESSAGE_ROUTED1(AccessibilityMsg_HitTest, |
| 177 gfx::Point /* location to test */) | 147 gfx::Point /* location to test */) |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 IPC_MESSAGE_ROUTED2(AccessibilityHostMsg_ChildFrameHitTestResult, | 208 IPC_MESSAGE_ROUTED2(AccessibilityHostMsg_ChildFrameHitTestResult, |
| 239 gfx::Point /* location tested */, | 209 gfx::Point /* location tested */, |
| 240 int /* node id of result */) | 210 int /* node id of result */) |
| 241 | 211 |
| 242 // Sent in response to AccessibilityMsg_SnapshotTree. The callback id that was | 212 // Sent in response to AccessibilityMsg_SnapshotTree. The callback id that was |
| 243 // passed to the request will be returned in |callback_id|, along with | 213 // passed to the request will be returned in |callback_id|, along with |
| 244 // a standalone snapshot of the accessibility tree. | 214 // a standalone snapshot of the accessibility tree. |
| 245 IPC_MESSAGE_ROUTED2(AccessibilityHostMsg_SnapshotResponse, | 215 IPC_MESSAGE_ROUTED2(AccessibilityHostMsg_SnapshotResponse, |
| 246 int /* callback_id */, | 216 int /* callback_id */, |
| 247 content::AXContentTreeUpdate) | 217 content::AXContentTreeUpdate) |
| OLD | NEW |