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 // This is the implementation layer of the chrome.automation API, and is | 5 // This is the implementation layer of the chrome.automation API, and is |
6 // essentially a translation of the internal accessibility tree update system | 6 // essentially a translation of the internal accessibility tree update system |
7 // into an extension API. | 7 // into an extension API. |
8 namespace automationInternal { | 8 namespace automationInternal { |
9 dictionary Rect { | 9 dictionary Rect { |
10 long left; | 10 long left; |
(...skipping 28 matching lines...) Expand all Loading... |
39 | 39 |
40 // A vector of nodes to update according to the rules described in | 40 // A vector of nodes to update according to the rules described in |
41 // ui/accesibility/ax_tree_update.h. | 41 // ui/accesibility/ax_tree_update.h. |
42 AXNodeData[] nodes; | 42 AXNodeData[] nodes; |
43 }; | 43 }; |
44 | 44 |
45 // Data for an accessibility event and/or an atomic change to an accessibility | 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 | 46 // tree. See ui/accessibility/ax_tree_update.h for an extended explanation of |
47 // the tree update format. | 47 // the tree update format. |
48 dictionary AXEventParams { | 48 dictionary AXEventParams { |
49 // The process id of the renderer host. | 49 // The tree id of the web contents that this update is for. |
50 long processID; | 50 long treeID; |
51 | |
52 // The routing id of the web contents that this update is for. | |
53 long routingID; | |
54 | 51 |
55 // ID of the node that the event applies to. | 52 // ID of the node that the event applies to. |
56 long targetID; | 53 long targetID; |
57 | 54 |
58 // The type of event that this update represents. | 55 // The type of event that this update represents. |
59 DOMString eventType; | 56 DOMString eventType; |
60 | 57 |
61 // Serialized changes to the tree structure and node data that should be | 58 // Serialized changes to the tree structure and node data that should be |
62 // applied before processing the event. | 59 // applied before processing the event. |
63 AXTreeUpdate update; | 60 AXTreeUpdate update; |
64 }; | 61 }; |
65 | 62 |
66 // All possible actions that can be performed on automation nodes. | 63 // All possible actions that can be performed on automation nodes. |
67 enum ActionType { | 64 enum ActionType { |
68 focus, | 65 focus, |
69 doDefault, | 66 doDefault, |
70 makeVisible, | 67 makeVisible, |
71 setSelection | 68 setSelection |
72 }; | 69 }; |
73 | 70 |
74 // Arguments required for all actions supplied to performAction. | 71 // Arguments required for all actions supplied to performAction. |
75 dictionary PerformActionRequiredParams { | 72 dictionary PerformActionRequiredParams { |
76 long processID; | 73 long treeID; |
77 long routingID; | |
78 long automationNodeID; | 74 long automationNodeID; |
79 ActionType actionType; | 75 ActionType actionType; |
80 }; | 76 }; |
81 | 77 |
82 // Arguments for the set_selection action supplied to performAction. | 78 // Arguments for the set_selection action supplied to performAction. |
83 dictionary SetSelectionParams { | 79 dictionary SetSelectionParams { |
84 long startIndex; | 80 long startIndex; |
85 long endIndex; | 81 long endIndex; |
86 }; | 82 }; |
87 | 83 |
88 // Returns the process id and routing id of the tab whose accessibility was | 84 // Returns the accessibility tree id of the web contents who's accessibility |
89 // enabled using enable(). | 85 // was enabled using enableTab(). |
90 callback EnableTabCallback = void(long processID, long routingID); | 86 callback EnableTabCallback = void(long tree_id); |
91 | 87 |
92 // Callback called when enableDesktop() returns. | 88 // Callback called when enableDesktop() returns. |
93 callback EnableDesktopCallback = void(); | 89 callback EnableDesktopCallback = void(); |
94 | 90 |
95 interface Functions { | 91 interface Functions { |
96 // Enable automation of the tab with the given id, or the active tab if no | 92 // 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 | 93 // tab id is given, and retrieves accessibility tree id for use in |
98 // future updates. | 94 // future updates. |
99 static void enableTab(optional long tabId, EnableTabCallback callback); | 95 static void enableTab(optional long tabId, EnableTabCallback callback); |
100 | 96 |
| 97 // Enable automation of the frame with the given tree id. |
| 98 static void enableFrame(long tree_id); |
| 99 |
101 // Enables desktop automation. | 100 // Enables desktop automation. |
102 static void enableDesktop(EnableDesktopCallback callback); | 101 static void enableDesktop(EnableDesktopCallback callback); |
103 | 102 |
104 // Performs an action on an automation node. | 103 // Performs an action on an automation node. |
105 static void performAction(PerformActionRequiredParams args, | 104 static void performAction(PerformActionRequiredParams args, |
106 object opt_args); | 105 object opt_args); |
107 }; | 106 }; |
108 | 107 |
109 interface Events { | 108 interface Events { |
110 // Fired when an accessibility event occurs | 109 // Fired when an accessibility event occurs |
111 static void onAccessibilityEvent(AXEventParams update); | 110 static void onAccessibilityEvent(AXEventParams update); |
112 | 111 |
113 static void onAccessibilityTreeDestroyed(long processID, long routingID); | 112 static void onAccessibilityTreeDestroyed(long treeID); |
114 }; | 113 }; |
115 }; | 114 }; |
OLD | NEW |