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 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 305 }; | 305 }; |
| 306 | 306 |
| 307 // A listener for changes on the <code>AutomationNode</code> tree. | 307 // A listener for changes on the <code>AutomationNode</code> tree. |
| 308 callback TreeChangeObserver = void(TreeChange treeChange); | 308 callback TreeChangeObserver = void(TreeChange treeChange); |
| 309 | 309 |
| 310 // A single node in an Automation tree. | 310 // A single node in an Automation tree. |
| 311 [nocompile, noinline_doc] dictionary AutomationNode { | 311 [nocompile, noinline_doc] dictionary AutomationNode { |
| 312 // The root node of the tree containing this AutomationNode. | 312 // The root node of the tree containing this AutomationNode. |
| 313 AutomationNode root; | 313 AutomationNode root; |
| 314 | 314 |
| 315 // Whether this AutomationNode is root node. | 315 // Whether this AutomationNode is a root node. |
| 316 boolean isRootNode; | 316 boolean isRootNode; |
| 317 | 317 |
| 318 // The role of this node. | 318 // The role of this node. |
| 319 automation.RoleType role; | 319 automation.RoleType role; |
| 320 | 320 |
| 321 // The $(ref:automation.StateType)s describing this node. | 321 // The $(ref:automation.StateType)s describing this node. |
| 322 object state; | 322 object state; |
| 323 | 323 |
| 324 // The rendered location (as a bounding box) of this node within the frame. | 324 // The rendered location (as a bounding box) of this node within the frame. |
| 325 automation.Rect location; | 325 automation.Rect location; |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 415 long textSelStart; | 415 long textSelStart; |
| 416 | 416 |
| 417 // The character index of the end of the selection within this editable | 417 // The character index of the end of the selection within this editable |
| 418 // text element; -1 if no selection. | 418 // text element; -1 if no selection. |
| 419 long textSelEnd; | 419 long textSelEnd; |
| 420 | 420 |
| 421 // The input type, like email or number. | 421 // The input type, like email or number. |
| 422 DOMString textInputType; | 422 DOMString textInputType; |
| 423 | 423 |
| 424 // | 424 // |
| 425 // Tree selection attributes (available on root nodes only) | |
| 426 // | |
| 427 | |
| 428 // The anchor node of the tree selection, if any. | |
| 429 AutomationNode? anchorObject; | |
| 430 // The anchor offset of the tree selection, if any. | |
| 431 long? anchorOffset; | |
| 432 // The focus node of the tree selection, if any. | |
| 433 AutomationNode? focusObject; | |
| 434 // The focus offset of the tree selection, if any. | |
| 435 long? focusOffset; | |
| 436 | |
| 437 // | |
| 425 // Range attributes. | 438 // Range attributes. |
| 426 // | 439 // |
| 427 | 440 |
| 428 // The current value for this range. | 441 // The current value for this range. |
| 429 double valueForRange; | 442 double valueForRange; |
| 430 | 443 |
| 431 // The minimum possible value for this range. | 444 // The minimum possible value for this range. |
| 432 double minValueForRange; | 445 double minValueForRange; |
| 433 | 446 |
| 434 // The maximum possible value for this range. | 447 // The maximum possible value for this range. |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 546 [nocompile] static void getDesktop(RootCallback callback); | 559 [nocompile] static void getDesktop(RootCallback callback); |
| 547 | 560 |
| 548 // Add a tree change observer. Tree change observers are static/global, they | 561 // Add a tree change observer. Tree change observers are static/global, they |
| 549 // listen to changes across all trees. | 562 // listen to changes across all trees. |
| 550 [nocompile] static void addTreeChangeObserver( | 563 [nocompile] static void addTreeChangeObserver( |
| 551 TreeChangeObserver observer); | 564 TreeChangeObserver observer); |
| 552 | 565 |
| 553 // Remove a tree change observer. | 566 // Remove a tree change observer. |
| 554 [nocompile] static void removeTreeChangeObserver( | 567 [nocompile] static void removeTreeChangeObserver( |
| 555 TreeChangeObserver observer); | 568 TreeChangeObserver observer); |
| 569 | |
| 570 // Sets the selection in a tree. This creates a selection in a single | |
| 571 // tree (anchorObject and focusObject must have the same root). | |
| 572 // Everything in the tree between the two node/offset pairs gets included | |
| 573 // in the selection. The anchor is where the user started the selection, | |
| 574 // while the focus is the point at which the selection gets extended | |
| 575 // e.g. when dragging with a mouse or using the keyboard. For nodes with | |
| 576 // the role staticText, the offset gives the character offset within | |
| 577 // the value where the selection starts or ends, respectively. | |
| 578 [nocompile] static void setDocumentSelection( | |
| 579 [instanceOf=AutomationNode] object anchorObject, | |
| 580 long anchorOffset, | |
| 581 [instanceOf=AutomationNode] object focusObject, | |
| 582 long focusOffset); | |
|
not at google - send to devlin
2015/10/05 12:56:02
I'd make this an object with properties "anchorObj
| |
| 556 }; | 583 }; |
| 557 }; | 584 }; |
| OLD | NEW |