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 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
703 // original size. | 711 // original size. |
704 static void getImageData(long maxWidth, long maxHeight); | 712 static void getImageData(long maxWidth, long maxHeight); |
705 | 713 |
706 // Does a hit test of the given global screen coordinates, and fires | 714 // Does a hit test of the given global screen coordinates, and fires |
707 // eventToFire on the resulting object. | 715 // eventToFire on the resulting object. |
708 static void hitTest(long x, long y, EventType eventToFire); | 716 static void hitTest(long x, long y, EventType eventToFire); |
709 | 717 |
710 // Scrolls this node to make it visible. | 718 // Scrolls this node to make it visible. |
711 static void makeVisible(); | 719 static void makeVisible(); |
712 | 720 |
| 721 // Performs custom action. |
| 722 static void performCustomAction(long customActionId); |
| 723 |
713 // Sets selection within a text field. | 724 // Sets selection within a text field. |
714 static void setSelection(long startIndex, long endIndex); | 725 static void setSelection(long startIndex, long endIndex); |
715 | 726 |
716 // Clears focus and sets this node as the starting point for the next | 727 // Clears focus and sets this node as the starting point for the next |
717 // time the user presses Tab or Shift+Tab. | 728 // time the user presses Tab or Shift+Tab. |
718 static void setSequentialFocusNavigationStartingPoint(); | 729 static void setSequentialFocusNavigationStartingPoint(); |
719 | 730 |
720 // Show the context menu for this element, as if the user right-clicked. | 731 // Show the context menu for this element, as if the user right-clicked. |
721 static void showContextMenu(); | 732 static void showContextMenu(); |
722 | 733 |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
807 // Everything in the tree between the two node/offset pairs gets included | 818 // Everything in the tree between the two node/offset pairs gets included |
808 // in the selection. The anchor is where the user started the selection, | 819 // in the selection. The anchor is where the user started the selection, |
809 // while the focus is the point at which the selection gets extended | 820 // while the focus is the point at which the selection gets extended |
810 // e.g. when dragging with a mouse or using the keyboard. For nodes with | 821 // e.g. when dragging with a mouse or using the keyboard. For nodes with |
811 // the role staticText, the offset gives the character offset within | 822 // the role staticText, the offset gives the character offset within |
812 // the value where the selection starts or ends, respectively. | 823 // the value where the selection starts or ends, respectively. |
813 [nocompile] static void setDocumentSelection( | 824 [nocompile] static void setDocumentSelection( |
814 SetDocumentSelectionParams params); | 825 SetDocumentSelectionParams params); |
815 }; | 826 }; |
816 }; | 827 }; |
OLD | NEW |