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 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 // must be one of: | 269 // must be one of: |
270 // <ul> | 270 // <ul> |
271 // <li>string</li> | 271 // <li>string</li> |
272 // <li>integer</li> | 272 // <li>integer</li> |
273 // <li>float</li> | 273 // <li>float</li> |
274 // <li>boolean</li> | 274 // <li>boolean</li> |
275 // </ul> | 275 // </ul> |
276 object? attributes; | 276 object? attributes; |
277 }; | 277 }; |
278 | 278 |
| 279 // Arguments for the setDocumentSelection() function. |
| 280 [nocompile, noinline_doc] dictionary SetDocumentSelectionParams { |
| 281 // The node where the selection begins. |
| 282 [instanceOf=AutomationNode] object anchorObject; |
| 283 // The offset in the anchor node where the selection begins. |
| 284 long anchorOffset; |
| 285 // The node where the selection ends. |
| 286 [instanceOf=AutomationNode] object focusObject; |
| 287 // The offset within the focus node where the selection ends. |
| 288 long focusOffset; |
| 289 }; |
| 290 |
279 // Called when the result for a <code>query</code> is available. | 291 // Called when the result for a <code>query</code> is available. |
280 callback QueryCallback = void(AutomationNode node); | 292 callback QueryCallback = void(AutomationNode node); |
281 | 293 |
282 // An event in the Automation tree. | 294 // An event in the Automation tree. |
283 [nocompile, noinline_doc] dictionary AutomationEvent { | 295 [nocompile, noinline_doc] dictionary AutomationEvent { |
284 // The $(ref:automation.AutomationNode) to which the event was targeted. | 296 // The $(ref:automation.AutomationNode) to which the event was targeted. |
285 AutomationNode target; | 297 AutomationNode target; |
286 | 298 |
287 // The type of the event. | 299 // The type of the event. |
288 EventType type; | 300 EventType type; |
(...skipping 16 matching lines...) Expand all Loading... |
305 }; | 317 }; |
306 | 318 |
307 // A listener for changes on the <code>AutomationNode</code> tree. | 319 // A listener for changes on the <code>AutomationNode</code> tree. |
308 callback TreeChangeObserver = void(TreeChange treeChange); | 320 callback TreeChangeObserver = void(TreeChange treeChange); |
309 | 321 |
310 // A single node in an Automation tree. | 322 // A single node in an Automation tree. |
311 [nocompile, noinline_doc] dictionary AutomationNode { | 323 [nocompile, noinline_doc] dictionary AutomationNode { |
312 // The root node of the tree containing this AutomationNode. | 324 // The root node of the tree containing this AutomationNode. |
313 AutomationNode root; | 325 AutomationNode root; |
314 | 326 |
315 // Whether this AutomationNode is root node. | 327 // Whether this AutomationNode is a root node. |
316 boolean isRootNode; | 328 boolean isRootNode; |
317 | 329 |
318 // The role of this node. | 330 // The role of this node. |
319 automation.RoleType role; | 331 automation.RoleType role; |
320 | 332 |
321 // The $(ref:automation.StateType)s describing this node. | 333 // The $(ref:automation.StateType)s describing this node. |
322 object state; | 334 object state; |
323 | 335 |
324 // The rendered location (as a bounding box) of this node within the frame. | 336 // The rendered location (as a bounding box) of this node within the frame. |
325 automation.Rect location; | 337 automation.Rect location; |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
415 long textSelStart; | 427 long textSelStart; |
416 | 428 |
417 // The character index of the end of the selection within this editable | 429 // The character index of the end of the selection within this editable |
418 // text element; -1 if no selection. | 430 // text element; -1 if no selection. |
419 long textSelEnd; | 431 long textSelEnd; |
420 | 432 |
421 // The input type, like email or number. | 433 // The input type, like email or number. |
422 DOMString textInputType; | 434 DOMString textInputType; |
423 | 435 |
424 // | 436 // |
| 437 // Tree selection attributes (available on root nodes only) |
| 438 // |
| 439 |
| 440 // The anchor node of the tree selection, if any. |
| 441 AutomationNode? anchorObject; |
| 442 // The anchor offset of the tree selection, if any. |
| 443 long? anchorOffset; |
| 444 // The focus node of the tree selection, if any. |
| 445 AutomationNode? focusObject; |
| 446 // The focus offset of the tree selection, if any. |
| 447 long? focusOffset; |
| 448 |
| 449 // |
425 // Range attributes. | 450 // Range attributes. |
426 // | 451 // |
427 | 452 |
428 // The current value for this range. | 453 // The current value for this range. |
429 double valueForRange; | 454 double valueForRange; |
430 | 455 |
431 // The minimum possible value for this range. | 456 // The minimum possible value for this range. |
432 double minValueForRange; | 457 double minValueForRange; |
433 | 458 |
434 // The maximum possible value for this range. | 459 // 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); | 571 [nocompile] static void getDesktop(RootCallback callback); |
547 | 572 |
548 // Add a tree change observer. Tree change observers are static/global, they | 573 // Add a tree change observer. Tree change observers are static/global, they |
549 // listen to changes across all trees. | 574 // listen to changes across all trees. |
550 [nocompile] static void addTreeChangeObserver( | 575 [nocompile] static void addTreeChangeObserver( |
551 TreeChangeObserver observer); | 576 TreeChangeObserver observer); |
552 | 577 |
553 // Remove a tree change observer. | 578 // Remove a tree change observer. |
554 [nocompile] static void removeTreeChangeObserver( | 579 [nocompile] static void removeTreeChangeObserver( |
555 TreeChangeObserver observer); | 580 TreeChangeObserver observer); |
| 581 |
| 582 // Sets the selection in a tree. This creates a selection in a single |
| 583 // tree (anchorObject and focusObject must have the same root). |
| 584 // Everything in the tree between the two node/offset pairs gets included |
| 585 // in the selection. The anchor is where the user started the selection, |
| 586 // while the focus is the point at which the selection gets extended |
| 587 // e.g. when dragging with a mouse or using the keyboard. For nodes with |
| 588 // the role staticText, the offset gives the character offset within |
| 589 // the value where the selection starts or ends, respectively. |
| 590 [nocompile] static void setDocumentSelection( |
| 591 SetDocumentSelectionParams params); |
556 }; | 592 }; |
557 }; | 593 }; |
OLD | NEW |