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 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 enum TreeChangeObserverFilter { | 359 enum TreeChangeObserverFilter { |
360 noTreeChanges, | 360 noTreeChanges, |
361 liveRegionTreeChanges, | 361 liveRegionTreeChanges, |
362 textMarkerChanges, | 362 textMarkerChanges, |
363 allTreeChanges | 363 allTreeChanges |
364 }; | 364 }; |
365 | 365 |
366 // A listener for changes on the <code>AutomationNode</code> tree. | 366 // A listener for changes on the <code>AutomationNode</code> tree. |
367 callback TreeChangeObserver = void(TreeChange treeChange); | 367 callback TreeChangeObserver = void(TreeChange treeChange); |
368 | 368 |
| 369 dictionary CustomAction { |
| 370 long id; |
| 371 DOMString description; |
| 372 }; |
| 373 |
369 // A single node in an Automation tree. | 374 // A single node in an Automation tree. |
370 [nocompile, noinline_doc] dictionary AutomationNode { | 375 [nocompile, noinline_doc] dictionary AutomationNode { |
371 // The root node of the tree containing this AutomationNode. | 376 // The root node of the tree containing this AutomationNode. |
372 AutomationNode? root; | 377 AutomationNode? root; |
373 | 378 |
374 // Whether this AutomationNode is a root node. | 379 // Whether this AutomationNode is a root node. |
375 boolean isRootNode; | 380 boolean isRootNode; |
376 | 381 |
377 // The role of this node. | 382 // The role of this node. |
378 RoleType? role; | 383 RoleType? role; |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
442 // name, via the $(ref:automation.AutomationNode.name) attribute. | 447 // name, via the $(ref:automation.AutomationNode.name) attribute. |
443 AutomationNode[]? labelledBy; | 448 AutomationNode[]? labelledBy; |
444 | 449 |
445 // The node referred to by <code>aria-activedescendant</code>, where | 450 // The node referred to by <code>aria-activedescendant</code>, where |
446 // applicable | 451 // applicable |
447 AutomationNode? activeDescendant; | 452 AutomationNode? activeDescendant; |
448 | 453 |
449 // The target of an in-page link. | 454 // The target of an in-page link. |
450 AutomationNode? inPageLinkTarget; | 455 AutomationNode? inPageLinkTarget; |
451 | 456 |
| 457 // An array of custom actions. |
| 458 CustomAction[]? customActions; |
| 459 |
452 // | 460 // |
453 // Link attributes. | 461 // Link attributes. |
454 // | 462 // |
455 | 463 |
456 // The URL that this link will navigate to. | 464 // The URL that this link will navigate to. |
457 DOMString? url; | 465 DOMString? url; |
458 | 466 |
459 // | 467 // |
460 // Document attributes. | 468 // Document attributes. |
461 // | 469 // |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
715 // original size. | 723 // original size. |
716 static void getImageData(long maxWidth, long maxHeight); | 724 static void getImageData(long maxWidth, long maxHeight); |
717 | 725 |
718 // Does a hit test of the given global screen coordinates, and fires | 726 // Does a hit test of the given global screen coordinates, and fires |
719 // eventToFire on the resulting object. | 727 // eventToFire on the resulting object. |
720 static void hitTest(long x, long y, EventType eventToFire); | 728 static void hitTest(long x, long y, EventType eventToFire); |
721 | 729 |
722 // Scrolls this node to make it visible. | 730 // Scrolls this node to make it visible. |
723 static void makeVisible(); | 731 static void makeVisible(); |
724 | 732 |
| 733 // Performs custom action. |
| 734 static void performCustomAction(long customActionId); |
| 735 |
725 // Sets selection within a text field. | 736 // Sets selection within a text field. |
726 static void setSelection(long startIndex, long endIndex); | 737 static void setSelection(long startIndex, long endIndex); |
727 | 738 |
728 // Clears focus and sets this node as the starting point for the next | 739 // Clears focus and sets this node as the starting point for the next |
729 // time the user presses Tab or Shift+Tab. | 740 // time the user presses Tab or Shift+Tab. |
730 static void setSequentialFocusNavigationStartingPoint(); | 741 static void setSequentialFocusNavigationStartingPoint(); |
731 | 742 |
732 // Show the context menu for this element, as if the user right-clicked. | 743 // Show the context menu for this element, as if the user right-clicked. |
733 static void showContextMenu(); | 744 static void showContextMenu(); |
734 | 745 |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
819 // Everything in the tree between the two node/offset pairs gets included | 830 // Everything in the tree between the two node/offset pairs gets included |
820 // in the selection. The anchor is where the user started the selection, | 831 // in the selection. The anchor is where the user started the selection, |
821 // while the focus is the point at which the selection gets extended | 832 // while the focus is the point at which the selection gets extended |
822 // e.g. when dragging with a mouse or using the keyboard. For nodes with | 833 // e.g. when dragging with a mouse or using the keyboard. For nodes with |
823 // the role staticText, the offset gives the character offset within | 834 // the role staticText, the offset gives the character offset within |
824 // the value where the selection starts or ends, respectively. | 835 // the value where the selection starts or ends, respectively. |
825 [nocompile] static void setDocumentSelection( | 836 [nocompile] static void setDocumentSelection( |
826 SetDocumentSelectionParams params); | 837 SetDocumentSelectionParams params); |
827 }; | 838 }; |
828 }; | 839 }; |
OLD | NEW |