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 { | 9 dictionary Rect { |
10 long left; | 10 long left; |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 long endIndex; | 81 long endIndex; |
82 }; | 82 }; |
83 | 83 |
84 // Arguments for the querySelector function. | 84 // Arguments for the querySelector function. |
85 dictionary QuerySelectorRequiredParams { | 85 dictionary QuerySelectorRequiredParams { |
86 long treeID; | 86 long treeID; |
87 long automationNodeID; | 87 long automationNodeID; |
88 DOMString selector; | 88 DOMString selector; |
89 }; | 89 }; |
90 | 90 |
| 91 // Arguments for the enableTab function. |
| 92 dictionary EnableTabParams { |
| 93 long routingID; |
| 94 long? tabID; |
| 95 }; |
| 96 |
91 // Returns the accessibility tree id of the web contents who's accessibility | 97 // Returns the accessibility tree id of the web contents who's accessibility |
92 // was enabled using enableTab(). | 98 // was enabled using enableTab(). |
93 callback EnableTabCallback = void(long tree_id); | 99 callback EnableTabCallback = void(long tree_id); |
94 | 100 |
95 // Callback called when enableDesktop() returns. | 101 // Callback called when enableDesktop() returns. |
96 callback EnableDesktopCallback = void(); | 102 callback EnableDesktopCallback = void(); |
97 | 103 |
98 // Callback called when querySelector() returns. | 104 // Callback called when querySelector() returns. |
99 callback QuerySelectorCallback = void(long resultAutomationNodeID); | 105 callback QuerySelectorCallback = void(long resultAutomationNodeID); |
100 | 106 |
101 interface Functions { | 107 interface Functions { |
102 // Enable automation of the tab with the given id, or the active tab if no | 108 // Enable automation of the tab with the given id, or the active tab if no |
103 // tab id is given, and retrieves accessibility tree id for use in | 109 // tab id is given, and retrieves accessibility tree id for use in |
104 // future updates. | 110 // future updates. |
105 static void enableTab(optional long tabId, EnableTabCallback callback); | 111 static void enableTab(EnableTabParams args, |
| 112 EnableTabCallback callback); |
106 | 113 |
107 // Enable automation of the frame with the given tree id. | 114 // Enable automation of the frame with the given tree id. |
108 static void enableFrame(long tree_id); | 115 static void enableFrame(long tree_id); |
109 | 116 |
110 // Enables desktop automation. | 117 // Enables desktop automation. |
111 static void enableDesktop(EnableDesktopCallback callback); | 118 static void enableDesktop(long routingID, |
| 119 EnableDesktopCallback callback); |
112 | 120 |
113 // Performs an action on an automation node. | 121 // Performs an action on an automation node. |
114 static void performAction(PerformActionRequiredParams args, | 122 static void performAction(PerformActionRequiredParams args, |
115 object opt_args); | 123 object opt_args); |
116 | 124 |
117 // Performs a query selector query. | 125 // Performs a query selector query. |
118 static void querySelector(QuerySelectorRequiredParams args, | 126 static void querySelector(QuerySelectorRequiredParams args, |
119 QuerySelectorCallback callback); | 127 QuerySelectorCallback callback); |
120 }; | 128 }; |
121 | 129 |
122 interface Events { | 130 interface Events { |
123 // Fired when an accessibility event occurs | 131 // Fired when an accessibility event occurs |
124 static void onAccessibilityEvent(AXEventParams update); | 132 static void onAccessibilityEvent(AXEventParams update); |
125 | 133 |
126 static void onAccessibilityTreeDestroyed(long treeID); | 134 static void onAccessibilityTreeDestroyed(long treeID); |
127 }; | 135 }; |
128 }; | 136 }; |
OLD | NEW |