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 "chrome/common/extensions/api/automation.h" | 9 #include "chrome/common/extensions/api/automation.h" |
10 #include "extensions/renderer/object_backed_native_handler.h" | 10 #include "extensions/renderer/object_backed_native_handler.h" |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 void DestroyAccessibilityTree( | 65 void DestroyAccessibilityTree( |
66 const v8::FunctionCallbackInfo<v8::Value>& args); | 66 const v8::FunctionCallbackInfo<v8::Value>& args); |
67 | 67 |
68 // | 68 // |
69 // Access the cached accessibility trees and properties of their nodes. | 69 // Access the cached accessibility trees and properties of their nodes. |
70 // | 70 // |
71 | 71 |
72 // Args: int ax_tree_id, Returns: int root_node_id. | 72 // Args: int ax_tree_id, Returns: int root_node_id. |
73 void GetRootID(const v8::FunctionCallbackInfo<v8::Value>& args); | 73 void GetRootID(const v8::FunctionCallbackInfo<v8::Value>& args); |
74 | 74 |
| 75 // Args: int ax_tree_id, Returns: string url. |
| 76 void GetDocURL(const v8::FunctionCallbackInfo<v8::Value>& args); |
| 77 |
| 78 // Args: int ax_tree_id, Returns: string title. |
| 79 void GetDocTitle(const v8::FunctionCallbackInfo<v8::Value>& args); |
| 80 |
| 81 // Args: int ax_tree_id, Returns: bool, true if doc loaded. |
| 82 void GetDocLoaded(const v8::FunctionCallbackInfo<v8::Value>& args); |
| 83 |
| 84 // Args: int ax_tree_id, Returns: float loading progress. |
| 85 void GetDocLoadingProgress(const v8::FunctionCallbackInfo<v8::Value>& args); |
| 86 |
| 87 // Args: int ax_tree_id, Returns: int selection anchor object ID. |
| 88 void GetAnchorObjectID(const v8::FunctionCallbackInfo<v8::Value>& args); |
| 89 |
| 90 // Args: int ax_tree_id, Returns: int selection anchor offset. |
| 91 void GetAnchorOffset(const v8::FunctionCallbackInfo<v8::Value>& args); |
| 92 |
| 93 // Args: int ax_tree_id, Returns: int selection focus object ID. |
| 94 void GetFocusObjectID(const v8::FunctionCallbackInfo<v8::Value>& args); |
| 95 |
| 96 // Args: int ax_tree_id, Returns: int selection focus offset. |
| 97 void GetFocusOffset(const v8::FunctionCallbackInfo<v8::Value>& args); |
| 98 |
75 // Args: int ax_tree_id, int node_id, Returns: int parent_node_id. | 99 // Args: int ax_tree_id, int node_id, Returns: int parent_node_id. |
76 void GetParentID(const v8::FunctionCallbackInfo<v8::Value>& args); | 100 void GetParentID(const v8::FunctionCallbackInfo<v8::Value>& args); |
77 | 101 |
78 // Args: int ax_tree_id, int node_id, Returns: int child_count. | 102 // Args: int ax_tree_id, int node_id, Returns: int child_count. |
79 void GetChildCount(const v8::FunctionCallbackInfo<v8::Value>& args); | 103 void GetChildCount(const v8::FunctionCallbackInfo<v8::Value>& args); |
80 | 104 |
81 // Args: int ax_tree_id, int node_id, Returns: int child_id. | 105 // Args: int ax_tree_id, int node_id, Returns: int child_id. |
82 void GetChildIDAtIndex(const v8::FunctionCallbackInfo<v8::Value>& args); | 106 void GetChildIDAtIndex(const v8::FunctionCallbackInfo<v8::Value>& args); |
83 | 107 |
84 // Args: int ax_tree_id, int node_id, Returns: int index_in_parent. | 108 // Args: int ax_tree_id, int node_id, Returns: int index_in_parent. |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 | 169 |
146 // Create a V8 string from a string. | 170 // Create a V8 string from a string. |
147 v8::Local<v8::Value> CreateV8String(const char* str); | 171 v8::Local<v8::Value> CreateV8String(const char* str); |
148 v8::Local<v8::Value> CreateV8String(const std::string& str); | 172 v8::Local<v8::Value> CreateV8String(const std::string& str); |
149 | 173 |
150 // Handle accessibility events from the browser process. | 174 // Handle accessibility events from the browser process. |
151 void OnAccessibilityEvent(const ExtensionMsg_AccessibilityEventParams& params, | 175 void OnAccessibilityEvent(const ExtensionMsg_AccessibilityEventParams& params, |
152 bool is_active_profile); | 176 bool is_active_profile); |
153 | 177 |
154 // AXTreeDelegate implementation. | 178 // AXTreeDelegate implementation. |
| 179 void OnTreeDataChanged(ui::AXTree* tree) override; |
155 void OnNodeWillBeDeleted(ui::AXTree* tree, ui::AXNode* node) override; | 180 void OnNodeWillBeDeleted(ui::AXTree* tree, ui::AXNode* node) override; |
156 void OnSubtreeWillBeDeleted(ui::AXTree* tree, ui::AXNode* node) override; | 181 void OnSubtreeWillBeDeleted(ui::AXTree* tree, ui::AXNode* node) override; |
157 void OnNodeCreated(ui::AXTree* tree, ui::AXNode* node) override; | 182 void OnNodeCreated(ui::AXTree* tree, ui::AXNode* node) override; |
158 void OnNodeChanged(ui::AXTree* tree, ui::AXNode* node) override; | 183 void OnNodeChanged(ui::AXTree* tree, ui::AXNode* node) override; |
159 void OnAtomicUpdateFinished(ui::AXTree* tree, | 184 void OnAtomicUpdateFinished(ui::AXTree* tree, |
160 bool root_changed, | 185 bool root_changed, |
161 const std::vector<Change>& changes) override; | 186 const std::vector<Change>& changes) override; |
162 | 187 |
163 void SendTreeChangeEvent(api::automation::TreeChangeType change_type, | 188 void SendTreeChangeEvent(api::automation::TreeChangeType change_type, |
164 ui::AXTree* tree, | 189 ui::AXTree* tree, |
165 ui::AXNode* node); | 190 ui::AXNode* node); |
166 | 191 |
167 base::hash_map<int, TreeCache*> tree_id_to_tree_cache_map_; | 192 base::hash_map<int, TreeCache*> tree_id_to_tree_cache_map_; |
168 base::hash_map<ui::AXTree*, TreeCache*> axtree_to_tree_cache_map_; | 193 base::hash_map<ui::AXTree*, TreeCache*> axtree_to_tree_cache_map_; |
169 scoped_refptr<AutomationMessageFilter> message_filter_; | 194 scoped_refptr<AutomationMessageFilter> message_filter_; |
170 bool is_active_profile_; | 195 bool is_active_profile_; |
171 | 196 |
172 DISALLOW_COPY_AND_ASSIGN(AutomationInternalCustomBindings); | 197 DISALLOW_COPY_AND_ASSIGN(AutomationInternalCustomBindings); |
173 }; | 198 }; |
174 | 199 |
175 } // namespace extensions | 200 } // namespace extensions |
176 | 201 |
177 #endif // CHROME_RENDERER_EXTENSIONS_AUTOMATION_INTERNAL_CUSTOM_BINDINGS_H_ | 202 #endif // CHROME_RENDERER_EXTENSIONS_AUTOMATION_INTERNAL_CUSTOM_BINDINGS_H_ |
OLD | NEW |