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 |
(...skipping 10 matching lines...) Expand all Loading... | |
21 object? int_attributes; | 21 object? int_attributes; |
22 object? intlist_attributes; | 22 object? intlist_attributes; |
23 object? string_attributes; | 23 object? string_attributes; |
24 long[] child_ids; | 24 long[] child_ids; |
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 process_id; | |
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 routing_id; |
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 event_type; |
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 dictionary SetSelectionParams { | |
54 long start_index; | |
55 long end_index; | |
56 }; | |
57 | |
58 // Returns the process_id and routing_id of the tab whose accessibility was | |
59 // enabled using enable(). | |
60 callback EnableCallback = void(long process_id, long routing_id); | |
45 | 61 |
46 interface Functions { | 62 interface Functions { |
47 // Enable automation of the active tab and retrieves its routing id for use | 63 // Enable automation of the active tab and retrieves its routing id for use |
48 // in future updates. | 64 // in future updates. |
49 static void enableCurrentTab(EnableCallback callback); | 65 static void enableCurrentTab(EnableCallback callback); |
66 | |
67 static void performAction(long processId, | |
68 long routingId, | |
69 long automationId, | |
70 ActionType actionType, | |
71 object opt_args); | |
aboxhall
2014/04/01 21:39:52
Tabs :(
David Tseng
2014/04/01 21:58:18
Should I add a TODO to accept a tab id?
aboxhall
2014/04/01 22:05:09
Sorry, I meant there were tab characters in here!
| |
50 }; | 72 }; |
51 | 73 |
52 interface Events { | 74 interface Events { |
53 // Fired when an accessibility event occurs | 75 // Fired when an accessibility event occurs |
54 static void onAccessibilityEvent(AXEventParams update); | 76 static void onAccessibilityEvent(AXEventParams update); |
55 }; | 77 }; |
56 }; | 78 }; |
OLD | NEW |