[Easy Unlock] Fix a DCHECK: Load localized string correctly.
[chromium-blink-merge.git] / chrome / common / extensions / api / automation_internal.idl
blobe95701decfb01da1e090c82ec5a5ece54484769d
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 dictionary Rect {
10 long left;
11 long top;
12 long width;
13 long height;
16 // A compact representation of the accessibility information for a
17 // single web object, in a form that can be serialized and sent from
18 // one process to another.
19 // See ui/accessibility/ax_node_data.h
20 dictionary AXNodeData {
21 long id;
22 DOMString role;
23 object state;
24 Rect location;
26 object? boolAttributes;
27 object? floatAttributes;
28 object? htmlAttributes;
29 object? intAttributes;
30 object? intlistAttributes;
31 object? stringAttributes;
32 long[] childIds;
35 dictionary AXTreeUpdate {
36 // ID of the node, if any, which should be invalidated before the new data
37 // is applied.
38 long nodeIdToClear;
40 // A vector of nodes to update according to the rules described in
41 // ui/accesibility/ax_tree_update.h.
42 AXNodeData[] nodes;
45 // Data for an accessibility event and/or an atomic change to an accessibility
46 // tree. See ui/accessibility/ax_tree_update.h for an extended explanation of
47 // the tree update format.
48 dictionary AXEventParams {
49 // The process id of the renderer host.
50 long processID;
52 // The routing id of the web contents that this update is for.
53 long routingID;
55 // ID of the node that the event applies to.
56 long targetID;
58 // The type of event that this update represents.
59 DOMString eventType;
61 // Serialized changes to the tree structure and node data that should be
62 // applied before processing the event.
63 AXTreeUpdate update;
66 // All possible actions that can be performed on automation nodes.
67 enum ActionType {
68 focus,
69 doDefault,
70 makeVisible,
71 setSelection
74 // Arguments required for all actions supplied to performAction.
75 dictionary PerformActionRequiredParams {
76 long processID;
77 long routingID;
78 long automationNodeID;
79 ActionType actionType;
82 // Arguments for the set_selection action supplied to performAction.
83 dictionary SetSelectionParams {
84 long startIndex;
85 long endIndex;
88 // Returns the process id and routing id of the tab whose accessibility was
89 // enabled using enable().
90 callback EnableTabCallback = void(long processID, long routingID);
92 // Callback called when enableDesktop() returns.
93 callback EnableDesktopCallback = void();
95 interface Functions {
96 // Enable automation of the tab with the given id, or the active tab if no
97 // tab id is given, and retrieves its process and routing ids for use in
98 // future updates.
99 static void enableTab(optional long tabId, EnableTabCallback callback);
101 // Enables desktop automation.
102 static void enableDesktop(EnableDesktopCallback callback);
104 // Performs an action on an automation node.
105 static void performAction(PerformActionRequiredParams args,
106 object opt_args);
109 interface Events {
110 // Fired when an accessibility event occurs
111 static void onAccessibilityEvent(AXEventParams update);
113 static void onAccessibilityTreeDestroyed(long processID, long routingID);