Chromium Code Reviews| 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 // The <code>chrome.automation</code> API allows developers to access the | 5 // The <code>chrome.automation</code> API allows developers to access the |
| 6 // automation (accessibility) tree for the browser. The tree resembles the DOM | 6 // automation (accessibility) tree for the browser. The tree resembles the DOM |
| 7 // tree, but only exposes the <em>semantic</em> structure of a page. It can be | 7 // tree, but only exposes the <em>semantic</em> structure of a page. It can be |
| 8 // used to programmatically interact with a page by examining names, roles, and | 8 // used to programmatically interact with a page by examining names, roles, and |
| 9 // states, listening for events, and performing actions on nodes. | 9 // states, listening for events, and performing actions on nodes. |
| 10 [nocompile] namespace automation { | 10 [nocompile] namespace automation { |
| (...skipping 598 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 609 // tab if no tabID is given, enabling automation if necessary. Returns a | 609 // tab if no tabID is given, enabling automation if necessary. Returns a |
| 610 // tree with a placeholder root node; listen for the "loadComplete" event to | 610 // tree with a placeholder root node; listen for the "loadComplete" event to |
| 611 // get a notification that the tree has fully loaded (the previous root node | 611 // get a notification that the tree has fully loaded (the previous root node |
| 612 // reference will stop working at or before this point). | 612 // reference will stop working at or before this point). |
| 613 [nocompile] static void getTree(optional long tabId, RootCallback callback); | 613 [nocompile] static void getTree(optional long tabId, RootCallback callback); |
| 614 | 614 |
| 615 // Get the automation tree for the whole desktop which consists of all on | 615 // Get the automation tree for the whole desktop which consists of all on |
| 616 // screen views. Note this API is currently only supported on Chrome OS. | 616 // screen views. Note this API is currently only supported on Chrome OS. |
| 617 [nocompile] static void getDesktop(RootCallback callback); | 617 [nocompile] static void getDesktop(RootCallback callback); |
| 618 | 618 |
| 619 // Get the automation node that currently has focus, globally. Will return | |
| 620 // null if the none of the nodes in any loaded trees have focus. | |
|
David Tseng
2016/01/28 02:00:56
nit: if none of
dmazzoni
2016/01/30 00:02:41
Done.
| |
| 621 [nocompile] static AutomationNode getFocus(); | |
| 622 | |
| 619 // Add a tree change observer. Tree change observers are static/global, they | 623 // Add a tree change observer. Tree change observers are static/global, they |
| 620 // listen to changes across all trees. Pass a filter to determine what | 624 // listen to changes across all trees. Pass a filter to determine what |
| 621 // specific tree changes to listen to, and note that listnening to all | 625 // specific tree changes to listen to, and note that listnening to all |
| 622 // tree changes can be expensive. | 626 // tree changes can be expensive. |
| 623 [nocompile] static void addTreeChangeObserver( | 627 [nocompile] static void addTreeChangeObserver( |
| 624 TreeChangeObserverFilter filter, TreeChangeObserver observer); | 628 TreeChangeObserverFilter filter, TreeChangeObserver observer); |
| 625 | 629 |
| 626 // Remove a tree change observer. | 630 // Remove a tree change observer. |
| 627 [nocompile] static void removeTreeChangeObserver( | 631 [nocompile] static void removeTreeChangeObserver( |
| 628 TreeChangeObserver observer); | 632 TreeChangeObserver observer); |
| 629 | 633 |
| 630 // Sets the selection in a tree. This creates a selection in a single | 634 // Sets the selection in a tree. This creates a selection in a single |
| 631 // tree (anchorObject and focusObject must have the same root). | 635 // tree (anchorObject and focusObject must have the same root). |
| 632 // Everything in the tree between the two node/offset pairs gets included | 636 // Everything in the tree between the two node/offset pairs gets included |
| 633 // in the selection. The anchor is where the user started the selection, | 637 // in the selection. The anchor is where the user started the selection, |
| 634 // while the focus is the point at which the selection gets extended | 638 // while the focus is the point at which the selection gets extended |
| 635 // e.g. when dragging with a mouse or using the keyboard. For nodes with | 639 // e.g. when dragging with a mouse or using the keyboard. For nodes with |
| 636 // the role staticText, the offset gives the character offset within | 640 // the role staticText, the offset gives the character offset within |
| 637 // the value where the selection starts or ends, respectively. | 641 // the value where the selection starts or ends, respectively. |
| 638 [nocompile] static void setDocumentSelection( | 642 [nocompile] static void setDocumentSelection( |
| 639 SetDocumentSelectionParams params); | 643 SetDocumentSelectionParams params); |
| 640 }; | 644 }; |
| 641 }; | 645 }; |
| OLD | NEW |