Index: chrome/renderer/extensions/automation_internal_custom_bindings.h |
diff --git a/chrome/renderer/extensions/automation_internal_custom_bindings.h b/chrome/renderer/extensions/automation_internal_custom_bindings.h |
index 1bc8a795daa7a631cf7bf71cffbc3134e78c2fb9..edb90fe7646394891b05ccd03bf4d86fa01087d9 100644 |
--- a/chrome/renderer/extensions/automation_internal_custom_bindings.h |
+++ b/chrome/renderer/extensions/automation_internal_custom_bindings.h |
@@ -17,9 +17,21 @@ namespace extensions { |
class AutomationMessageFilter; |
+struct TreeCache { |
+ TreeCache(); |
+ ~TreeCache(); |
+ |
+ int tab_id; |
+ int tree_id; |
+ |
+ gfx::Vector2d location_offset; |
+ ui::AXTree tree; |
+}; |
+ |
// The native component of custom bindings for the chrome.automationInternal |
// API. |
-class AutomationInternalCustomBindings : public ObjectBackedNativeHandler { |
+class AutomationInternalCustomBindings : public ObjectBackedNativeHandler, |
+ public ui::AXTreeDelegate { |
public: |
explicit AutomationInternalCustomBindings(ScriptContext* context); |
@@ -39,10 +51,72 @@ class AutomationInternalCustomBindings : public ObjectBackedNativeHandler { |
// Get the routing ID for the extension. |
void GetRoutingID(const v8::FunctionCallbackInfo<v8::Value>& args); |
+ // |
David Tseng
2015/06/10 17:48:16
?
aboxhall
2015/06/11 15:05:38
Contentless comment.
Were you going to add more c
dmazzoni
2015/06/11 19:09:12
Done.
|
+ void DestroyAccessibilityTree( |
+ const v8::FunctionCallbackInfo<v8::Value>& args); |
+ |
+ void GetRootID( |
+ const v8::FunctionCallbackInfo<v8::Value>& args); |
+ |
+ bool GetNodeHelper( |
aboxhall
2015/06/11 15:05:38
Maybe group these by routed vs local?
dmazzoni
2015/06/11 19:09:12
Done.
|
+ const v8::FunctionCallbackInfo<v8::Value>& args, |
+ TreeCache** out_cache, |
+ ui::AXNode** out_node); |
+ void SetReturnValueFromBaseValue( |
+ const v8::FunctionCallbackInfo<v8::Value>& args, |
+ base::Value* value); |
+ |
+ void GetParentID( |
+ const v8::FunctionCallbackInfo<v8::Value>& args); |
+ void GetChildCount( |
+ const v8::FunctionCallbackInfo<v8::Value>& args); |
+ void GetChildIDAtIndex( |
+ const v8::FunctionCallbackInfo<v8::Value>& args); |
+ void GetIndexInParent( |
+ const v8::FunctionCallbackInfo<v8::Value>& args); |
+ |
+ void GetState( |
+ const v8::FunctionCallbackInfo<v8::Value>& args); |
+ void GetRole( |
+ const v8::FunctionCallbackInfo<v8::Value>& args); |
+ void GetLocation( |
+ const v8::FunctionCallbackInfo<v8::Value>& args); |
+ |
+ bool GetAttributeHelper( |
+ const v8::FunctionCallbackInfo<v8::Value>& args, |
+ ui::AXNode** out_node, |
+ std::string* out_attribute_name); |
+ |
+ void GetStringAttribute( |
+ const v8::FunctionCallbackInfo<v8::Value>& args); |
+ void GetBoolAttribute( |
+ const v8::FunctionCallbackInfo<v8::Value>& args); |
+ void GetIntAttribute( |
+ const v8::FunctionCallbackInfo<v8::Value>& args); |
+ void GetFloatAttribute( |
+ const v8::FunctionCallbackInfo<v8::Value>& args); |
+ void GetIntListAttribute( |
+ const v8::FunctionCallbackInfo<v8::Value>& args); |
+ |
// Handle accessibility events from the browser process. |
void OnAccessibilityEvent( |
const ExtensionMsg_AccessibilityEventParams& params); |
+ // AXTreeDelegate implementation. |
+ void OnNodeWillBeDeleted(ui::AXTree* tree, ui::AXNode* node) override; |
+ void OnSubtreeWillBeDeleted(ui::AXTree* tree, ui::AXNode* node) override; |
+ void OnNodeCreated(ui::AXTree* tree, ui::AXNode* node) override; |
+ void OnNodeChanged(ui::AXTree* tree, ui::AXNode* node) override; |
+ void OnAtomicUpdateFinished(ui::AXTree* tree, |
+ bool root_changed, |
+ const std::vector<Change>& changes) override; |
+ |
+ void SendTreeChangeEvent(const char *change_type, |
+ ui::AXTree* tree, |
+ ui::AXNode* node); |
+ |
+ base::hash_map<int, TreeCache*> tree_id_to_tree_cache_map_; |
+ base::hash_map<ui::AXTree*, TreeCache*> axtree_to_tree_cache_map_; |
scoped_refptr<AutomationMessageFilter> message_filter_; |
DISALLOW_COPY_AND_ASSIGN(AutomationInternalCustomBindings); |