| 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 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 310 | 310 |
| 311 // A change to the Automation tree. | 311 // A change to the Automation tree. |
| 312 [nocompile, noinline_doc] dictionary TreeChange { | 312 [nocompile, noinline_doc] dictionary TreeChange { |
| 313 // The $(ref:automation.AutomationNode) that changed. | 313 // The $(ref:automation.AutomationNode) that changed. |
| 314 AutomationNode target; | 314 AutomationNode target; |
| 315 | 315 |
| 316 // The type of change. | 316 // The type of change. |
| 317 TreeChangeType type; | 317 TreeChangeType type; |
| 318 }; | 318 }; |
| 319 | 319 |
| 320 // Possible tree changes to listen to using addTreeChangeObserver. |
| 321 // Note that listening to all tree changes can be expensive. |
| 322 enum TreeChangeObserverFilter { |
| 323 noTreeChanges, |
| 324 liveRegionTreeChanges, |
| 325 allTreeChanges |
| 326 }; |
| 327 |
| 320 // A listener for changes on the <code>AutomationNode</code> tree. | 328 // A listener for changes on the <code>AutomationNode</code> tree. |
| 321 callback TreeChangeObserver = void(TreeChange treeChange); | 329 callback TreeChangeObserver = void(TreeChange treeChange); |
| 322 | 330 |
| 323 // A single node in an Automation tree. | 331 // A single node in an Automation tree. |
| 324 [nocompile, noinline_doc] dictionary AutomationNode { | 332 [nocompile, noinline_doc] dictionary AutomationNode { |
| 325 // The root node of the tree containing this AutomationNode. | 333 // The root node of the tree containing this AutomationNode. |
| 326 AutomationNode root; | 334 AutomationNode root; |
| 327 | 335 |
| 328 // Whether this AutomationNode is a root node. | 336 // Whether this AutomationNode is a root node. |
| 329 boolean isRootNode; | 337 boolean isRootNode; |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 487 // The number of columns that this cell spans (default is 1). | 495 // The number of columns that this cell spans (default is 1). |
| 488 long tableCellColumnSpan; | 496 long tableCellColumnSpan; |
| 489 | 497 |
| 490 // The zero-based index of the row that this cell is in. | 498 // The zero-based index of the row that this cell is in. |
| 491 long tableCellRowIndex; | 499 long tableCellRowIndex; |
| 492 | 500 |
| 493 // The number of rows that this cell spans (default is 1). | 501 // The number of rows that this cell spans (default is 1). |
| 494 long tableCellRowSpan; | 502 long tableCellRowSpan; |
| 495 | 503 |
| 496 // | 504 // |
| 505 // Live region attributes. |
| 506 // |
| 507 |
| 508 // The type of region if this is the root of a live region. |
| 509 // Possible values are 'polite' and 'assertive'. |
| 510 DOMString liveStatus; |
| 511 |
| 512 // The value of aria-relevant for a live region. |
| 513 DOMString liveRelevant; |
| 514 |
| 515 // The value of aria-atomic for a live region. |
| 516 boolean liveAtomic; |
| 517 |
| 518 // The value of aria-busy for a live region. |
| 519 boolean liveBusy; |
| 520 |
| 521 // The type of live region if this node is inside a live region. |
| 522 DOMString containerLiveStatus; |
| 523 |
| 524 // The value of aria-relevant if this node is inside a live region. |
| 525 DOMString containerLiveRelevant; |
| 526 |
| 527 // The value of aria-atomic if this node is inside a live region. |
| 528 boolean containerLiveAtomic; |
| 529 |
| 530 // The value of aria-busy if this node is inside a live region. |
| 531 boolean containerLiveBusy; |
| 532 |
| 533 // |
| 497 // Walking the tree. | 534 // Walking the tree. |
| 498 // | 535 // |
| 499 | 536 |
| 500 AutomationNode[] children; | 537 AutomationNode[] children; |
| 501 AutomationNode parent; | 538 AutomationNode parent; |
| 502 AutomationNode firstChild; | 539 AutomationNode firstChild; |
| 503 AutomationNode lastChild; | 540 AutomationNode lastChild; |
| 504 AutomationNode previousSibling; | 541 AutomationNode previousSibling; |
| 505 AutomationNode nextSibling; | 542 AutomationNode nextSibling; |
| 506 | 543 |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 572 // tree with a placeholder root node; listen for the "loadComplete" event to | 609 // tree with a placeholder root node; listen for the "loadComplete" event to |
| 573 // get a notification that the tree has fully loaded (the previous root node | 610 // get a notification that the tree has fully loaded (the previous root node |
| 574 // reference will stop working at or before this point). | 611 // reference will stop working at or before this point). |
| 575 [nocompile] static void getTree(optional long tabId, RootCallback callback); | 612 [nocompile] static void getTree(optional long tabId, RootCallback callback); |
| 576 | 613 |
| 577 // Get the automation tree for the whole desktop which consists of all on | 614 // Get the automation tree for the whole desktop which consists of all on |
| 578 // screen views. Note this API is currently only supported on Chrome OS. | 615 // screen views. Note this API is currently only supported on Chrome OS. |
| 579 [nocompile] static void getDesktop(RootCallback callback); | 616 [nocompile] static void getDesktop(RootCallback callback); |
| 580 | 617 |
| 581 // Add a tree change observer. Tree change observers are static/global, they | 618 // Add a tree change observer. Tree change observers are static/global, they |
| 582 // listen to changes across all trees. | 619 // listen to changes across all trees. Pass a filter to determine what |
| 620 // specific tree changes to listen to, and note that listnening to all |
| 621 // tree changes can be expensive. |
| 583 [nocompile] static void addTreeChangeObserver( | 622 [nocompile] static void addTreeChangeObserver( |
| 584 TreeChangeObserver observer); | 623 TreeChangeObserverFilter filter, TreeChangeObserver observer); |
| 585 | 624 |
| 586 // Remove a tree change observer. | 625 // Remove a tree change observer. |
| 587 [nocompile] static void removeTreeChangeObserver( | 626 [nocompile] static void removeTreeChangeObserver( |
| 588 TreeChangeObserver observer); | 627 TreeChangeObserver observer); |
| 589 | 628 |
| 590 // Sets the selection in a tree. This creates a selection in a single | 629 // Sets the selection in a tree. This creates a selection in a single |
| 591 // tree (anchorObject and focusObject must have the same root). | 630 // tree (anchorObject and focusObject must have the same root). |
| 592 // Everything in the tree between the two node/offset pairs gets included | 631 // Everything in the tree between the two node/offset pairs gets included |
| 593 // in the selection. The anchor is where the user started the selection, | 632 // in the selection. The anchor is where the user started the selection, |
| 594 // while the focus is the point at which the selection gets extended | 633 // while the focus is the point at which the selection gets extended |
| 595 // e.g. when dragging with a mouse or using the keyboard. For nodes with | 634 // e.g. when dragging with a mouse or using the keyboard. For nodes with |
| 596 // the role staticText, the offset gives the character offset within | 635 // the role staticText, the offset gives the character offset within |
| 597 // the value where the selection starts or ends, respectively. | 636 // the value where the selection starts or ends, respectively. |
| 598 [nocompile] static void setDocumentSelection( | 637 [nocompile] static void setDocumentSelection( |
| 599 SetDocumentSelectionParams params); | 638 SetDocumentSelectionParams params); |
| 600 }; | 639 }; |
| 601 }; | 640 }; |
| OLD | NEW |