OLD | NEW |
---|---|
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 // This is the implementation layer of the chrome.automation API, and is | 5 // This is the implementation layer of the chrome.automation API, and is |
6 // essentially a translation of the internal accessibility tree update system | 6 // essentially a translation of the internal accessibility tree update system |
7 // into an extension API. | 7 // into an extension API. |
8 namespace automationInternal { | 8 namespace automationInternal { |
9 // A compact representation of the accessibility information for a | 9 // A compact representation of the accessibility information for a |
10 // single web object, in a form that can be serialized and sent from | 10 // single web object, in a form that can be serialized and sent from |
11 // one process to another. | 11 // one process to another. |
12 // See ui/accessibility/ax_node_data.h | 12 // See ui/accessibility/ax_node_data.h |
13 dictionary AXNodeData { | 13 dictionary AXNodeData { |
14 long id; | 14 long id; |
15 DOMString role; | 15 DOMString role; |
16 object state; | 16 object state; |
17 // TODO(aboxhall): include location data; | 17 // TODO(aboxhall): include location data; |
18 object? bool_attributes; | 18 object? boolAttributes; |
19 object? float_attributes; | 19 object? floatAttributes; |
20 object? html_attributes; | 20 object? htmlAttributes; |
21 object? int_attributes; | 21 object? intAttributes; |
22 object? intlist_attributes; | 22 object? intlistAttributes; |
23 object? string_attributes; | 23 object? stringAttributes; |
24 long[] child_ids; | 24 long[] childIDs; |
25 }; | 25 }; |
26 | 26 |
27 // Data for an accessibility event and/or an atomic change to an accessibility | 27 // Data for an accessibility event and/or an atomic change to an accessibility |
28 // tree. See ui/accessibility/ax_tree_update.h for an extended explanation of | 28 // tree. See ui/accessibility/ax_tree_update.h for an extended explanation of |
29 // the tree update format. | 29 // the tree update format. |
30 dictionary AXEventParams { | 30 dictionary AXEventParams { |
31 // The process id of the renderer host. | |
32 long processID; | |
33 | |
31 // The routing id of the web contents that this update is for. | 34 // The routing id of the web contents that this update is for. |
32 long routing_id; | 35 long routingID; |
33 | 36 |
34 // The type of event that this update represents. | 37 // The type of event that this update represents. |
35 DOMString event_type; | 38 DOMString eventType; |
36 | 39 |
37 // A vector of nodes to update according to the rules described in | 40 // A vector of nodes to update according to the rules described in |
38 // ui/ax_tree_update.h. | 41 // ui/ax_tree_update.h. |
39 AXNodeData[] nodes; | 42 AXNodeData[] nodes; |
40 }; | 43 }; |
41 | 44 |
42 // Returns the routing_id of the tab whose accessibility was enabled using | 45 // All possible actions that can be performed on automation nodes. |
43 // enable(). | 46 enum ActionType { |
44 callback EnableCallback = void(long routing_id); | 47 focus, |
48 do_default, | |
49 make_visible, | |
50 set_selection | |
51 }; | |
52 | |
53 // Arguments required for all actions supplied to performAction. | |
54 dictionary PerformActionRequiredParams { | |
55 long processID; | |
56 long routingID; | |
57 long automationNodeID; | |
58 ActionType actionType; | |
59 }; | |
60 | |
61 // Arguments for the set_selection action supplied to performAction. | |
62 dictionary SetSelectionParams { | |
63 long startIndex; | |
64 long endIndex; | |
65 }; | |
66 | |
67 // Returns the process id and routing id of the tab whose accessibility was | |
68 // enabled using enable(). | |
69 callback EnableCallback = void(long processID, long routingID); | |
45 | 70 |
46 interface Functions { | 71 interface Functions { |
47 // Enable automation of the active tab and retrieves its routing id for use | 72 // Enable automation of the active tab and retrieves its routing id for use |
48 // in future updates. | 73 // in future updates. |
49 static void enableCurrentTab(EnableCallback callback); | 74 static void enableCurrentTab(EnableCallback callback); |
75 | |
76 static void performAction(PerformActionRequiredParams args, | |
77 object opt_args); | |
not at google - send to devlin
2014/04/03 18:57:13
you could use object? here to actually indicate it
David Tseng
2014/04/03 23:05:19
The schema compiler doesn't like this:
chrome/comm
not at google - send to devlin
2014/04/04 16:30:57
Oh interesting. JSON schema supports optional para
| |
50 }; | 78 }; |
51 | 79 |
52 interface Events { | 80 interface Events { |
53 // Fired when an accessibility event occurs | 81 // Fired when an accessibility event occurs |
54 static void onAccessibilityEvent(AXEventParams update); | 82 static void onAccessibilityEvent(AXEventParams update); |
55 }; | 83 }; |
56 }; | 84 }; |
OLD | NEW |