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 dictionary Rect { |
| 10 long left; |
| 11 long top; |
| 12 long width; |
| 13 long height; |
| 14 }; |
| 15 |
| 16 // A compact representation of the accessibility information for a |
| 17 // single web object, in a form that can be serialized and sent from |
| 18 // one process to another. |
| 19 // See ui/accessibility/ax_node_data.h |
| 20 dictionary AXNodeData { |
| 21 long id; |
| 22 DOMString role; |
| 23 object state; |
| 24 Rect location; |
| 25 |
| 26 object? boolAttributes; |
| 27 object? floatAttributes; |
| 28 object? htmlAttributes; |
| 29 object? intAttributes; |
| 30 object? intlistAttributes; |
| 31 object? stringAttributes; |
| 32 long[] childIds; |
| 33 }; |
| 34 |
| 35 dictionary AXTreeUpdate { |
| 36 // ID of the node, if any, which should be invalidated before the new data |
| 37 // is applied. |
| 38 long nodeIdToClear; |
| 39 |
| 40 // A vector of nodes to update according to the rules described in |
| 41 // ui/accessibility/ax_tree_update.h. |
| 42 AXNodeData[] nodes; |
| 43 }; |
| 44 |
9 // Data for an accessibility event and/or an atomic change to an accessibility | 45 // Data for an accessibility event and/or an atomic change to an accessibility |
10 // tree. See ui/accessibility/ax_tree_update.h for an extended explanation of | 46 // tree. See ui/accessibility/ax_tree_update.h for an extended explanation of |
11 // the tree update format. | 47 // the tree update format. |
12 [nocompile] dictionary AXEventParams { | 48 dictionary AXEventParams { |
13 // The tree id of the web contents that this update is for. | 49 // The tree id of the web contents that this update is for. |
14 long treeID; | 50 long treeID; |
15 | 51 |
16 // ID of the node that the event applies to. | 52 // ID of the node that the event applies to. |
17 long targetID; | 53 long targetID; |
18 | 54 |
19 // The type of event that this update represents. | 55 // The type of event that this update represents. |
20 DOMString eventType; | 56 DOMString eventType; |
| 57 |
| 58 // Serialized changes to the tree structure and node data that should be |
| 59 // applied before processing the event. |
| 60 AXTreeUpdate update; |
21 }; | 61 }; |
22 | 62 |
23 // All possible actions that can be performed on automation nodes. | 63 // All possible actions that can be performed on automation nodes. |
24 enum ActionType { | 64 enum ActionType { |
25 focus, | 65 focus, |
26 doDefault, | 66 doDefault, |
27 makeVisible, | 67 makeVisible, |
28 setSelection, | 68 setSelection, |
29 showContextMenu | 69 showContextMenu |
30 }; | 70 }; |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 // Performs a query selector query. | 126 // Performs a query selector query. |
87 static void querySelector(QuerySelectorRequiredParams args, | 127 static void querySelector(QuerySelectorRequiredParams args, |
88 QuerySelectorCallback callback); | 128 QuerySelectorCallback callback); |
89 }; | 129 }; |
90 | 130 |
91 interface Events { | 131 interface Events { |
92 // Fired when an accessibility event occurs | 132 // Fired when an accessibility event occurs |
93 static void onAccessibilityEvent(AXEventParams update); | 133 static void onAccessibilityEvent(AXEventParams update); |
94 | 134 |
95 static void onAccessibilityTreeDestroyed(long treeID); | 135 static void onAccessibilityTreeDestroyed(long treeID); |
96 | |
97 static void onTreeChange(long treeID, long nodeID, DOMString changeType); | |
98 }; | 136 }; |
99 }; | 137 }; |
OLD | NEW |