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 3// found in the LICENSE file. 4 5// IPC messages for accessibility. 6// Multiply-included message file, hence no include guard. 7 8#include "base/basictypes.h" 9#include "content/common/content_export.h" 10#include "content/common/view_message_enums.h" 11#include "content/public/common/common_param_traits.h" 12#include "ipc/ipc_message_macros.h" 13#include "ipc/ipc_message_utils.h" 14#include "ipc/ipc_param_traits.h" 15#include "ipc/param_traits_macros.h" 16#include "third_party/WebKit/public/web/WebAXEnums.h" 17#include "ui/accessibility/ax_node_data.h" 18#include "ui/accessibility/ax_tree_update.h" 19 20#undef IPC_MESSAGE_EXPORT 21#define IPC_MESSAGE_EXPORT CONTENT_EXPORT 22 23#define IPC_MESSAGE_START AccessibilityMsgStart 24 25IPC_ENUM_TRAITS_MAX_VALUE(ui::AXEvent, ui::AX_EVENT_LAST) 26IPC_ENUM_TRAITS_MAX_VALUE(ui::AXRole, ui::AX_ROLE_LAST) 27 28IPC_ENUM_TRAITS_MAX_VALUE(ui::AXBoolAttribute, ui::AX_BOOL_ATTRIBUTE_LAST) 29IPC_ENUM_TRAITS_MAX_VALUE(ui::AXFloatAttribute, ui::AX_FLOAT_ATTRIBUTE_LAST) 30IPC_ENUM_TRAITS_MAX_VALUE(ui::AXIntAttribute, ui::AX_INT_ATTRIBUTE_LAST) 31IPC_ENUM_TRAITS_MAX_VALUE(ui::AXIntListAttribute, 32 ui::AX_INT_LIST_ATTRIBUTE_LAST) 33IPC_ENUM_TRAITS_MAX_VALUE(ui::AXStringAttribute, ui::AX_STRING_ATTRIBUTE_LAST) 34 35IPC_STRUCT_TRAITS_BEGIN(ui::AXNodeData) 36 IPC_STRUCT_TRAITS_MEMBER(id) 37 IPC_STRUCT_TRAITS_MEMBER(role) 38 IPC_STRUCT_TRAITS_MEMBER(state) 39 IPC_STRUCT_TRAITS_MEMBER(location) 40 IPC_STRUCT_TRAITS_MEMBER(string_attributes) 41 IPC_STRUCT_TRAITS_MEMBER(int_attributes) 42 IPC_STRUCT_TRAITS_MEMBER(float_attributes) 43 IPC_STRUCT_TRAITS_MEMBER(bool_attributes) 44 IPC_STRUCT_TRAITS_MEMBER(intlist_attributes) 45 IPC_STRUCT_TRAITS_MEMBER(html_attributes) 46 IPC_STRUCT_TRAITS_MEMBER(child_ids) 47IPC_STRUCT_TRAITS_END() 48 49IPC_STRUCT_TRAITS_BEGIN(ui::AXTreeUpdate) 50 IPC_STRUCT_TRAITS_MEMBER(node_id_to_clear) 51 IPC_STRUCT_TRAITS_MEMBER(nodes) 52IPC_STRUCT_TRAITS_END() 53 54IPC_STRUCT_BEGIN(AccessibilityHostMsg_EventParams) 55 // The tree update. 56 IPC_STRUCT_MEMBER(ui::AXTreeUpdate, update) 57 58 // Type of event. 59 IPC_STRUCT_MEMBER(ui::AXEvent, event_type) 60 61 // ID of the node that the event applies to. 62 IPC_STRUCT_MEMBER(int, id) 63IPC_STRUCT_END() 64 65IPC_STRUCT_BEGIN(AccessibilityHostMsg_LocationChangeParams) 66 // ID of the object whose location is changing. 67 IPC_STRUCT_MEMBER(int, id) 68 69 // The object's new location, in frame-relative coordinates (same 70 // as the coordinates in AccessibilityNodeData). 71 IPC_STRUCT_MEMBER(gfx::Rect, new_location) 72IPC_STRUCT_END() 73 74// Messages sent from the browser to the renderer. 75 76// Relay a request from assistive technology to set focus to a given node. 77IPC_MESSAGE_ROUTED1(AccessibilityMsg_SetFocus, 78 int /* object id */) 79 80// Relay a request from assistive technology to perform the default action 81// on a given node. 82IPC_MESSAGE_ROUTED1(AccessibilityMsg_DoDefaultAction, 83 int /* object id */) 84 85// Relay a request from assistive technology to make a given object 86// visible by scrolling as many scrollable containers as possible. 87// In addition, if it's not possible to make the entire object visible, 88// scroll so that the |subfocus| rect is visible at least. The subfocus 89// rect is in local coordinates of the object itself. 90IPC_MESSAGE_ROUTED2(AccessibilityMsg_ScrollToMakeVisible, 91 int /* object id */, 92 gfx::Rect /* subfocus */) 93 94// Relay a request from assistive technology to move a given object 95// to a specific location, in the WebContents area coordinate space, i.e. 96// (0, 0) is the top-left corner of the WebContents. 97IPC_MESSAGE_ROUTED2(AccessibilityMsg_ScrollToPoint, 98 int /* object id */, 99 gfx::Point /* new location */) 100 101// Relay a request from assistive technology to set the cursor or 102// selection within an editable text element. 103IPC_MESSAGE_ROUTED3(AccessibilityMsg_SetTextSelection, 104 int /* object id */, 105 int /* New start offset */, 106 int /* New end offset */) 107 108// Determine the accessibility object under a given point and reply with 109// a AccessibilityHostMsg_HitTestResult with the same id. 110IPC_MESSAGE_ROUTED1(AccessibilityMsg_HitTest, 111 gfx::Point /* location to test */); 112 113// Tells the render view that a AccessibilityHostMsg_Events 114// message was processed and it can send addition events. 115IPC_MESSAGE_ROUTED0(AccessibilityMsg_Events_ACK) 116 117// Kill the renderer because we got a fatal error in the accessibility tree. 118IPC_MESSAGE_ROUTED0(AccessibilityMsg_FatalError) 119 120// Messages sent from the renderer to the browser. 121 122// Sent to notify the browser about renderer accessibility events. 123// The browser responds with a AccessibilityMsg_Events_ACK. 124IPC_MESSAGE_ROUTED1( 125 AccessibilityHostMsg_Events, 126 std::vector<AccessibilityHostMsg_EventParams>) 127 128// Sent to update the browser of the location of accessibility objects. 129IPC_MESSAGE_ROUTED1( 130 AccessibilityHostMsg_LocationChanges, 131 std::vector<AccessibilityHostMsg_LocationChangeParams>) 132