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 // TODO(dtseng): Refer to |
44 callback EnableCallback = void(long routing_id); | 47 // content/browser/accessibility/browser_accessibility_manager.h:BrowserAccess ibilityDelegate |
dmazzoni
2014/04/01 17:05:25
nit: wrap to 80 chars
aboxhall
2014/04/01 17:49:51
Difficult to do. I think this could stay as-is, or
David Tseng
2014/04/01 21:27:15
I removed this TODO. I initially thought I could r
| |
48 // (which should live in ui/accessibility). | |
49 enum ActionType { | |
50 focus, | |
51 do_default, | |
52 make_visible, | |
53 set_selection | |
54 }; | |
55 | |
56 // Returns the process_id and routing_id of the tab whose accessibility was | |
57 // enabled using enable(). | |
58 callback EnableCallback = void(long process_id, long routing_id); | |
45 | 59 |
46 interface Functions { | 60 interface Functions { |
47 // Enable automation of the active tab and retrieves its routing id for use | 61 // Enable automation of the active tab and retrieves its routing id for use |
48 // in future updates. | 62 // in future updates. |
49 static void enableCurrentTab(EnableCallback callback); | 63 static void enableCurrentTab(EnableCallback callback); |
64 | |
65 static void performAction(long processId, | |
66 long routingId, | |
67 long automationId, | |
68 ActionType actionType, | |
69 long[] opt_args); | |
dmazzoni
2014/04/01 17:05:25
What about args that aren't a long, is there a cha
aboxhall
2014/04/01 17:49:51
Suggestion: use an object for opt_args and pass by
David Tseng
2014/04/01 21:27:15
Updated with the object approach.
| |
50 }; | 70 }; |
51 | 71 |
52 interface Events { | 72 interface Events { |
53 // Fired when an accessibility event occurs | 73 // Fired when an accessibility event occurs |
54 static void onAccessibilityEvent(AXEventParams update); | 74 static void onAccessibilityEvent(AXEventParams update); |
55 }; | 75 }; |
56 }; | 76 }; |
OLD | NEW |