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