Simplify serialization/conversion of accessibility -> automation data.
[chromium-blink-merge.git] / chrome / common / extensions / api / automation_internal.idl
blob28bc8eb98afd25f7d874961f994486ef8325f2ad
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 // A compact representation of the accessibility information for a
10 // single web object, in a form that can be serialized and sent from
11 // one process to another.
12 // See ui/accessibility/ax_node_data.h
13 dictionary AXNodeData {
14 long id;
15 DOMString role;
16 object state;
17 // TODO(aboxhall): include location data;
18 object? boolAttributes;
19 object? floatAttributes;
20 object? htmlAttributes;
21 object? intAttributes;
22 object? intlistAttributes;
23 object? stringAttributes;
24 long[] childIds;
27 // Data for an accessibility event and/or an atomic change to an accessibility
28 // tree. See ui/accessibility/ax_tree_update.h for an extended explanation of
29 // the tree update format.
30 dictionary AXEventParams {
31 // The process id of the renderer host.
32 long processID;
34 // The routing id of the web contents that this update is for.
35 long routingID;
37 // The type of event that this update represents.
38 DOMString eventType;
40 // A vector of nodes to update according to the rules described in
41 // ui/ax_tree_update.h.
42 AXNodeData[] nodes;
45 // All possible actions that can be performed on automation nodes.
46 enum ActionType {
47 focus,
48 do_default,
49 make_visible,
50 set_selection
53 // Arguments required for all actions supplied to performAction.
54 dictionary PerformActionRequiredParams {
55 long processID;
56 long routingID;
57 long automationNodeID;
58 ActionType actionType;
61 // Arguments for the set_selection action supplied to performAction.
62 dictionary SetSelectionParams {
63 long startIndex;
64 long endIndex;
67 // Returns the process id and routing id of the tab whose accessibility was
68 // enabled using enable().
69 callback EnableCallback = void(long processID, long routingID);
71 interface Functions {
72 // Enable automation of the active tab and retrieves its routing id for use
73 // in future updates.
74 static void enableCurrentTab(EnableCallback callback);
76 static void performAction(PerformActionRequiredParams args,
77 object opt_args);
80 interface Events {
81 // Fired when an accessibility event occurs
82 static void onAccessibilityEvent(AXEventParams update);