• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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/accessibility_node_data.h"
10 #include "content/common/content_export.h"
11 #include "content/common/view_message_enums.h"
12 #include "content/public/common/common_param_traits.h"
13 #include "ipc/ipc_message_macros.h"
14 #include "ipc/ipc_message_utils.h"
15 #include "ipc/ipc_param_traits.h"
16 #include "ipc/param_traits_macros.h"
17 #include "third_party/WebKit/public/web/WebAXEnums.h"
18 
19 #undef IPC_MESSAGE_EXPORT
20 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT
21 
22 #define IPC_MESSAGE_START AccessibilityMsgStart
23 
24 IPC_ENUM_TRAITS(blink::WebAXEvent)
25 IPC_ENUM_TRAITS(blink::WebAXRole)
26 
27 IPC_ENUM_TRAITS(content::AccessibilityNodeData::BoolAttribute)
28 IPC_ENUM_TRAITS(content::AccessibilityNodeData::FloatAttribute)
29 IPC_ENUM_TRAITS(content::AccessibilityNodeData::IntAttribute)
30 IPC_ENUM_TRAITS(content::AccessibilityNodeData::IntListAttribute)
31 IPC_ENUM_TRAITS(content::AccessibilityNodeData::StringAttribute)
32 
33 IPC_STRUCT_TRAITS_BEGIN(content::AccessibilityNodeData)
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()
46 
47 IPC_STRUCT_BEGIN(AccessibilityHostMsg_EventParams)
48   // Vector of nodes in the tree that need to be updated before
49   // sending the event.
50   IPC_STRUCT_MEMBER(std::vector<content::AccessibilityNodeData>, nodes)
51 
52   // Type of event.
53   IPC_STRUCT_MEMBER(blink::WebAXEvent, event_type)
54 
55   // ID of the node that the event applies to.
56   IPC_STRUCT_MEMBER(int, id)
57 IPC_STRUCT_END()
58 
59 // Messages sent from the browser to the renderer.
60 
61 // Relay a request from assistive technology to set focus to a given node.
62 IPC_MESSAGE_ROUTED1(AccessibilityMsg_SetFocus,
63                     int /* object id */)
64 
65 // Relay a request from assistive technology to perform the default action
66 // on a given node.
67 IPC_MESSAGE_ROUTED1(AccessibilityMsg_DoDefaultAction,
68                     int /* object id */)
69 
70 // Relay a request from assistive technology to make a given object
71 // visible by scrolling as many scrollable containers as possible.
72 // In addition, if it's not possible to make the entire object visible,
73 // scroll so that the |subfocus| rect is visible at least. The subfocus
74 // rect is in local coordinates of the object itself.
75 IPC_MESSAGE_ROUTED2(AccessibilityMsg_ScrollToMakeVisible,
76                     int /* object id */,
77                     gfx::Rect /* subfocus */)
78 
79 // Relay a request from assistive technology to move a given object
80 // to a specific location, in the WebContents area coordinate space, i.e.
81 // (0, 0) is the top-left corner of the WebContents.
82 IPC_MESSAGE_ROUTED2(AccessibilityMsg_ScrollToPoint,
83                     int /* object id */,
84                     gfx::Point /* new location */)
85 
86 // Relay a request from assistive technology to set the cursor or
87 // selection within an editable text element.
88 IPC_MESSAGE_ROUTED3(AccessibilityMsg_SetTextSelection,
89                     int /* object id */,
90                     int /* New start offset */,
91                     int /* New end offset */)
92 
93 // Tells the render view that a AccessibilityHostMsg_Events
94 // message was processed and it can send addition events.
95 IPC_MESSAGE_ROUTED0(AccessibilityMsg_Events_ACK)
96 
97 
98 // Kill the renderer because we got a fatal error in the accessibility tree.
99 IPC_MESSAGE_ROUTED0(AccessibilityMsg_FatalError)
100 
101 // Messages sent from the renderer to the browser.
102 
103 // Sent to notify the browser about renderer accessibility events.
104 // The browser responds with a AccessibilityMsg_Events_ACK.
105 IPC_MESSAGE_ROUTED1(
106     AccessibilityHostMsg_Events,
107     std::vector<AccessibilityHostMsg_EventParams>)
108