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
3 // found in the LICENSE file.
5 // This is the implementation layer of the chrome.automation API, and is
6 // essentially a translation of the internal accessibility tree update system
7 // into an extension API.
8 namespace automationInternal
{
9 // Data for an accessibility event and/or an atomic change to an accessibility
10 // tree. See ui/accessibility/ax_tree_update.h for an extended explanation of
11 // the tree update format.
12 [nocompile
] dictionary AXEventParams
{
13 // The tree id of the web contents that this update is for.
16 // ID of the node that the event applies to.
19 // The type of event that this update represents.
23 // All possible actions that can be performed on automation nodes.
32 // Arguments required for all actions supplied to performAction.
33 dictionary PerformActionRequiredParams
{
35 long automationNodeID
;
36 ActionType actionType
;
39 // Arguments for the set_selection action supplied to performAction.
40 dictionary SetSelectionParams
{
45 // Arguments for the querySelector function.
46 dictionary QuerySelectorRequiredParams
{
48 long automationNodeID
;
52 // Arguments for the enableTab function.
53 dictionary EnableTabParams
{
58 // Returns the accessibility tree id of the web contents who's accessibility
59 // was enabled using enableTab().
60 callback EnableTabCallback
= void(long tree_id
);
62 // Callback called when enableDesktop() returns.
63 callback EnableDesktopCallback
= void();
65 // Callback called when querySelector() returns.
66 callback QuerySelectorCallback
= void(long resultAutomationNodeID
);
69 // Enable automation of the tab with the given id, or the active tab if no
70 // tab id is given, and retrieves accessibility tree id for use in
72 static
void enableTab
(EnableTabParams args
,
73 EnableTabCallback
callback);
75 // Enable automation of the frame with the given tree id.
76 static
void enableFrame
(long tree_id
);
78 // Enables desktop automation.
79 static
void enableDesktop
(long routingID
,
80 EnableDesktopCallback
callback);
82 // Performs an action on an automation node.
83 static
void performAction
(PerformActionRequiredParams args
,
86 // Performs a query selector query.
87 static
void querySelector
(QuerySelectorRequiredParams args
,
88 QuerySelectorCallback
callback);
92 // Fired when an accessibility event occurs
93 static
void onAccessibilityEvent
(AXEventParams update
);
95 static
void onAccessibilityTreeDestroyed
(long treeID
);
97 static
void onTreeChange
(long treeID
, long nodeID
, DOMString changeType
);