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 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 360 enum TreeChangeObserverFilter { | 360 enum TreeChangeObserverFilter { |
| 361 noTreeChanges, | 361 noTreeChanges, |
| 362 liveRegionTreeChanges, | 362 liveRegionTreeChanges, |
| 363 textMarkerChanges, | 363 textMarkerChanges, |
| 364 allTreeChanges | 364 allTreeChanges |
| 365 }; | 365 }; |
| 366 | 366 |
| 367 // A listener for changes on the <code>AutomationNode</code> tree. | 367 // A listener for changes on the <code>AutomationNode</code> tree. |
| 368 callback TreeChangeObserver = void(TreeChange treeChange); | 368 callback TreeChangeObserver = void(TreeChange treeChange); |
| 369 | 369 |
| 370 dictionary CustomAction { | |
| 371 long id; | |
| 372 DOMString description; | |
| 373 }; | |
| 374 | |
| 370 // A single node in an Automation tree. | 375 // A single node in an Automation tree. |
| 371 [nocompile, noinline_doc] dictionary AutomationNode { | 376 [nocompile, noinline_doc] dictionary AutomationNode { |
| 372 // The root node of the tree containing this AutomationNode. | 377 // The root node of the tree containing this AutomationNode. |
| 373 AutomationNode? root; | 378 AutomationNode? root; |
| 374 | 379 |
| 375 // Whether this AutomationNode is a root node. | 380 // Whether this AutomationNode is a root node. |
| 376 boolean isRootNode; | 381 boolean isRootNode; |
| 377 | 382 |
| 378 // The role of this node. | 383 // The role of this node. |
| 379 RoleType? role; | 384 RoleType? role; |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 440 // name, via the $(ref:automation.AutomationNode.name) attribute. | 445 // name, via the $(ref:automation.AutomationNode.name) attribute. |
| 441 AutomationNode[]? labelledBy; | 446 AutomationNode[]? labelledBy; |
| 442 | 447 |
| 443 // The node referred to by <code>aria-activedescendant</code>, where | 448 // The node referred to by <code>aria-activedescendant</code>, where |
| 444 // applicable | 449 // applicable |
| 445 AutomationNode? activeDescendant; | 450 AutomationNode? activeDescendant; |
| 446 | 451 |
| 447 // The target of an in-page link. | 452 // The target of an in-page link. |
| 448 AutomationNode? inPageLinkTarget; | 453 AutomationNode? inPageLinkTarget; |
| 449 | 454 |
| 455 // An array of custom actions. | |
| 456 CustomAction[]? customActions; | |
| 457 | |
| 450 // | 458 // |
| 451 // Link attributes. | 459 // Link attributes. |
| 452 // | 460 // |
| 453 | 461 |
| 454 // The URL that this link will navigate to. | 462 // The URL that this link will navigate to. |
| 455 DOMString? url; | 463 DOMString? url; |
| 456 | 464 |
| 457 // | 465 // |
| 458 // Document attributes. | 466 // Document attributes. |
| 459 // | 467 // |
| (...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 701 // original size. | 709 // original size. |
| 702 static void getImageData(long maxWidth, long maxHeight); | 710 static void getImageData(long maxWidth, long maxHeight); |
| 703 | 711 |
| 704 // Does a hit test of the given global screen coordinates, and fires | 712 // Does a hit test of the given global screen coordinates, and fires |
| 705 // eventToFire on the resulting object. | 713 // eventToFire on the resulting object. |
| 706 static void hitTest(long x, long y, EventType eventToFire); | 714 static void hitTest(long x, long y, EventType eventToFire); |
| 707 | 715 |
| 708 // Scrolls this node to make it visible. | 716 // Scrolls this node to make it visible. |
| 709 static void makeVisible(); | 717 static void makeVisible(); |
| 710 | 718 |
| 719 // Performs custom action. | |
| 720 static void performCustomAction(long customActionId); | |
|
dmazzoni
2017/06/06 03:06:00
Would it be cleaner if this took a CustomAction as
yawano
2017/06/08 09:25:29
Done. Yes, also it should be more extensible.
| |
| 721 | |
| 711 // Sets selection within a text field. | 722 // Sets selection within a text field. |
| 712 static void setSelection(long startIndex, long endIndex); | 723 static void setSelection(long startIndex, long endIndex); |
| 713 | 724 |
| 714 // Clears focus and sets this node as the starting point for the next | 725 // Clears focus and sets this node as the starting point for the next |
| 715 // time the user presses Tab or Shift+Tab. | 726 // time the user presses Tab or Shift+Tab. |
| 716 static void setSequentialFocusNavigationStartingPoint(); | 727 static void setSequentialFocusNavigationStartingPoint(); |
| 717 | 728 |
| 718 // Show the context menu for this element, as if the user right-clicked. | 729 // Show the context menu for this element, as if the user right-clicked. |
| 719 static void showContextMenu(); | 730 static void showContextMenu(); |
| 720 | 731 |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 805 // Everything in the tree between the two node/offset pairs gets included | 816 // Everything in the tree between the two node/offset pairs gets included |
| 806 // in the selection. The anchor is where the user started the selection, | 817 // in the selection. The anchor is where the user started the selection, |
| 807 // while the focus is the point at which the selection gets extended | 818 // while the focus is the point at which the selection gets extended |
| 808 // e.g. when dragging with a mouse or using the keyboard. For nodes with | 819 // e.g. when dragging with a mouse or using the keyboard. For nodes with |
| 809 // the role staticText, the offset gives the character offset within | 820 // the role staticText, the offset gives the character offset within |
| 810 // the value where the selection starts or ends, respectively. | 821 // the value where the selection starts or ends, respectively. |
| 811 [nocompile] static void setDocumentSelection( | 822 [nocompile] static void setDocumentSelection( |
| 812 SetDocumentSelectionParams params); | 823 SetDocumentSelectionParams params); |
| 813 }; | 824 }; |
| 814 }; | 825 }; |
| OLD | NEW |