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 #ifndef CHROME_RENDERER_EXTENSIONS_AUTOMATION_INTERNAL_CUSTOM_BINDINGS_H_ | 5 #ifndef CHROME_RENDERER_EXTENSIONS_AUTOMATION_INTERNAL_CUSTOM_BINDINGS_H_ |
6 #define CHROME_RENDERER_EXTENSIONS_AUTOMATION_INTERNAL_CUSTOM_BINDINGS_H_ | 6 #define CHROME_RENDERER_EXTENSIONS_AUTOMATION_INTERNAL_CUSTOM_BINDINGS_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "chrome/common/extensions/api/automation.h" | 10 #include "chrome/common/extensions/api/automation.h" |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 // removed from our cache. | 78 // removed from our cache. |
79 // Args: int ax_tree_id | 79 // Args: int ax_tree_id |
80 void DestroyAccessibilityTree( | 80 void DestroyAccessibilityTree( |
81 const v8::FunctionCallbackInfo<v8::Value>& args); | 81 const v8::FunctionCallbackInfo<v8::Value>& args); |
82 | 82 |
83 void AddTreeChangeObserver(const v8::FunctionCallbackInfo<v8::Value>& args); | 83 void AddTreeChangeObserver(const v8::FunctionCallbackInfo<v8::Value>& args); |
84 | 84 |
85 void RemoveTreeChangeObserver( | 85 void RemoveTreeChangeObserver( |
86 const v8::FunctionCallbackInfo<v8::Value>& args); | 86 const v8::FunctionCallbackInfo<v8::Value>& args); |
87 | 87 |
| 88 void GetFocus(const v8::FunctionCallbackInfo<v8::Value>& args); |
| 89 |
| 90 // Given an initial TreeCache, return the TreeCache and node of the focused |
| 91 // node within this tree or a focused descendant tree. |
| 92 bool GetFocusInternal(TreeCache* top_cache, |
| 93 TreeCache** out_cache, |
| 94 ui::AXNode** out_node); |
| 95 |
88 void RouteTreeIDFunction(const std::string& name, | 96 void RouteTreeIDFunction(const std::string& name, |
89 void (*callback)(v8::Isolate* isolate, | 97 void (*callback)(v8::Isolate* isolate, |
90 v8::ReturnValue<v8::Value> result, | 98 v8::ReturnValue<v8::Value> result, |
91 TreeCache* cache)); | 99 TreeCache* cache)); |
92 | 100 |
93 void RouteNodeIDFunction(const std::string& name, | 101 void RouteNodeIDFunction(const std::string& name, |
94 void (*callback)(v8::Isolate* isolate, | 102 void (*callback)(v8::Isolate* isolate, |
95 v8::ReturnValue<v8::Value> result, | 103 v8::ReturnValue<v8::Value> result, |
96 TreeCache* cache, | 104 TreeCache* cache, |
97 ui::AXNode* node)); | 105 ui::AXNode* node)); |
(...skipping 10 matching lines...) Expand all Loading... |
108 v8::ReturnValue<v8::Value> result, | 116 v8::ReturnValue<v8::Value> result, |
109 TreeCache* cache, | 117 TreeCache* cache, |
110 ui::AXNode* node, | 118 ui::AXNode* node, |
111 int start, | 119 int start, |
112 int end)); | 120 int end)); |
113 | 121 |
114 // | 122 // |
115 // Access the cached accessibility trees and properties of their nodes. | 123 // Access the cached accessibility trees and properties of their nodes. |
116 // | 124 // |
117 | 125 |
118 // Args: int ax_tree_id, int node_id, Returns: int parent_node_id. | |
119 void GetParentID(const v8::FunctionCallbackInfo<v8::Value>& args); | |
120 | |
121 // Args: int ax_tree_id, int node_id, Returns: int child_count. | |
122 void GetChildCount(const v8::FunctionCallbackInfo<v8::Value>& args); | |
123 | |
124 // Args: int ax_tree_id, int node_id, Returns: int child_id. | 126 // Args: int ax_tree_id, int node_id, Returns: int child_id. |
125 void GetChildIDAtIndex(const v8::FunctionCallbackInfo<v8::Value>& args); | 127 void GetChildIDAtIndex(const v8::FunctionCallbackInfo<v8::Value>& args); |
126 | 128 |
127 // Args: int ax_tree_id, int node_id, Returns: int index_in_parent. | |
128 void GetIndexInParent(const v8::FunctionCallbackInfo<v8::Value>& args); | |
129 | |
130 // Args: int ax_tree_id, int node_id | 129 // Args: int ax_tree_id, int node_id |
131 // Returns: JS object with a string key for each state flag that's set. | 130 // Returns: JS object with a string key for each state flag that's set. |
132 void GetState(const v8::FunctionCallbackInfo<v8::Value>& args); | 131 void GetState(const v8::FunctionCallbackInfo<v8::Value>& args); |
133 | 132 |
134 // Args: int ax_tree_id, int node_id, Returns: string role_name | |
135 void GetRole(const v8::FunctionCallbackInfo<v8::Value>& args); | |
136 | |
137 // Args: int ax_tree_id, int node_id | |
138 // Returns: JS object with {left, top, width, height} | |
139 void GetLocation(const v8::FunctionCallbackInfo<v8::Value>& args); | |
140 | |
141 // Args: int ax_tree_id, int node_id, string attribute_name | |
142 // Returns: string attribute_value. | |
143 void GetStringAttribute(const v8::FunctionCallbackInfo<v8::Value>& args); | |
144 | |
145 // Args: int ax_tree_id, int node_id, string attribute_name | |
146 // Returns: bool attribute_value. | |
147 void GetBoolAttribute(const v8::FunctionCallbackInfo<v8::Value>& args); | |
148 | |
149 // Args: int ax_tree_id, int node_id, string attribute_name | |
150 // Returns: int attribute_value. | |
151 void GetIntAttribute(const v8::FunctionCallbackInfo<v8::Value>& args); | |
152 | |
153 // Args: int ax_tree_id, int node_id, string attribute_name | |
154 // Returns: float attribute_value. | |
155 void GetFloatAttribute(const v8::FunctionCallbackInfo<v8::Value>& args); | |
156 | |
157 // Args: int ax_tree_id, int node_id, string attribute_name | |
158 // Returns: JS array of int attribute_values. | |
159 void GetIntListAttribute(const v8::FunctionCallbackInfo<v8::Value>& args); | |
160 | |
161 // Args: int ax_tree_id, int node_id, string attribute_name | |
162 // Returns: string attribute_value. | |
163 void GetHtmlAttribute(const v8::FunctionCallbackInfo<v8::Value>& args); | |
164 | |
165 // | 133 // |
166 // Helper functions. | 134 // Helper functions. |
167 // | 135 // |
168 | 136 |
169 // Handle accessibility events from the browser process. | 137 // Handle accessibility events from the browser process. |
170 void OnAccessibilityEvent(const ExtensionMsg_AccessibilityEventParams& params, | 138 void OnAccessibilityEvent(const ExtensionMsg_AccessibilityEventParams& params, |
171 bool is_active_profile); | 139 bool is_active_profile); |
172 | 140 |
173 void UpdateOverallTreeChangeObserverFilter(); | 141 void UpdateOverallTreeChangeObserverFilter(); |
174 | 142 |
(...skipping 20 matching lines...) Expand all Loading... |
195 api::automation::TreeChangeObserverFilter | 163 api::automation::TreeChangeObserverFilter |
196 tree_change_observer_overall_filter_; | 164 tree_change_observer_overall_filter_; |
197 std::vector<int> deleted_node_ids_; | 165 std::vector<int> deleted_node_ids_; |
198 | 166 |
199 DISALLOW_COPY_AND_ASSIGN(AutomationInternalCustomBindings); | 167 DISALLOW_COPY_AND_ASSIGN(AutomationInternalCustomBindings); |
200 }; | 168 }; |
201 | 169 |
202 } // namespace extensions | 170 } // namespace extensions |
203 | 171 |
204 #endif // CHROME_RENDERER_EXTENSIONS_AUTOMATION_INTERNAL_CUSTOM_BINDINGS_H_ | 172 #endif // CHROME_RENDERER_EXTENSIONS_AUTOMATION_INTERNAL_CUSTOM_BINDINGS_H_ |
OLD | NEW |