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.
5 // IPC messages for accessibility.
6 // Multiply-included message file, hence no include guard.
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"
19 #undef IPC_MESSAGE_EXPORT
20 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT
22 #define IPC_MESSAGE_START AccessibilityMsgStart
24 IPC_ENUM_TRAITS(ui::AXEvent
)
25 IPC_ENUM_TRAITS(ui::AXRole
)
27 IPC_ENUM_TRAITS(ui::AXBoolAttribute
)
28 IPC_ENUM_TRAITS(ui::AXFloatAttribute
)
29 IPC_ENUM_TRAITS(ui::AXIntAttribute
)
30 IPC_ENUM_TRAITS(ui::AXIntListAttribute
)
31 IPC_ENUM_TRAITS(ui::AXStringAttribute
)
33 IPC_STRUCT_TRAITS_BEGIN(ui::AXNodeData
)
34 IPC_STRUCT_TRAITS_MEMBER(id
)
35 IPC_STRUCT_TRAITS_MEMBER(role
)
36 IPC_STRUCT_TRAITS_MEMBER(state
)
37 IPC_STRUCT_TRAITS_MEMBER(location
)
38 IPC_STRUCT_TRAITS_MEMBER(string_attributes
)
39 IPC_STRUCT_TRAITS_MEMBER(int_attributes
)
40 IPC_STRUCT_TRAITS_MEMBER(float_attributes
)
41 IPC_STRUCT_TRAITS_MEMBER(bool_attributes
)
42 IPC_STRUCT_TRAITS_MEMBER(intlist_attributes
)
43 IPC_STRUCT_TRAITS_MEMBER(html_attributes
)
44 IPC_STRUCT_TRAITS_MEMBER(child_ids
)
45 IPC_STRUCT_TRAITS_END()
47 IPC_STRUCT_BEGIN(AccessibilityHostMsg_EventParams
)
48 // Vector of nodes in the tree that need to be updated before
50 IPC_STRUCT_MEMBER(std::vector
<ui::AXNodeData
>, nodes
)
53 IPC_STRUCT_MEMBER(ui::AXEvent
, event_type
)
55 // ID of the node that the event applies to.
56 IPC_STRUCT_MEMBER(int, id
)
59 IPC_STRUCT_BEGIN(AccessibilityHostMsg_LocationChangeParams
)
60 // ID of the object whose location is changing.
61 IPC_STRUCT_MEMBER(int, id
)
63 // The object's new location, in frame-relative coordinates (same
64 // as the coordinates in AccessibilityNodeData).
65 IPC_STRUCT_MEMBER(gfx::Rect
, new_location
)
68 // Messages sent from the browser to the renderer.
70 // Relay a request from assistive technology to set focus to a given node.
71 IPC_MESSAGE_ROUTED1(AccessibilityMsg_SetFocus
,
74 // Relay a request from assistive technology to perform the default action
76 IPC_MESSAGE_ROUTED1(AccessibilityMsg_DoDefaultAction
,
79 // Relay a request from assistive technology to make a given object
80 // visible by scrolling as many scrollable containers as possible.
81 // In addition, if it's not possible to make the entire object visible,
82 // scroll so that the |subfocus| rect is visible at least. The subfocus
83 // rect is in local coordinates of the object itself.
84 IPC_MESSAGE_ROUTED2(AccessibilityMsg_ScrollToMakeVisible
,
86 gfx::Rect
/* subfocus */)
88 // Relay a request from assistive technology to move a given object
89 // to a specific location, in the WebContents area coordinate space, i.e.
90 // (0, 0) is the top-left corner of the WebContents.
91 IPC_MESSAGE_ROUTED2(AccessibilityMsg_ScrollToPoint
,
93 gfx::Point
/* new location */)
95 // Relay a request from assistive technology to set the cursor or
96 // selection within an editable text element.
97 IPC_MESSAGE_ROUTED3(AccessibilityMsg_SetTextSelection
,
99 int /* New start offset */,
100 int /* New end offset */)
102 // Tells the render view that a AccessibilityHostMsg_Events
103 // message was processed and it can send addition events.
104 IPC_MESSAGE_ROUTED0(AccessibilityMsg_Events_ACK
)
107 // Kill the renderer because we got a fatal error in the accessibility tree.
108 IPC_MESSAGE_ROUTED0(AccessibilityMsg_FatalError
)
110 // Messages sent from the renderer to the browser.
112 // Sent to notify the browser about renderer accessibility events.
113 // The browser responds with a AccessibilityMsg_Events_ACK.
115 AccessibilityHostMsg_Events
,
116 std::vector
<AccessibilityHostMsg_EventParams
>)
118 // Sent to update the browser of the location of accessibility objects.
120 AccessibilityHostMsg_LocationChanges
,
121 std::vector
<AccessibilityHostMsg_LocationChangeParams
>)