Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Unified Diff: chrome/renderer/extensions/automation_internal_custom_bindings.h

Issue 1457683009: Complete live region support in ChromeVox Next. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed last feedback Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 94e659db49367975c4e500cf5d63cbac24eb091c..a7c0b75d6b3f41f54951457eb3446c3d5f43b799 100644
--- a/chrome/renderer/extensions/automation_internal_custom_bindings.h
+++ b/chrome/renderer/extensions/automation_internal_custom_bindings.h
@@ -29,6 +29,11 @@ struct TreeCache {
ui::AXTree tree;
};
+struct TreeChangeObserver {
+ int id;
+ api::automation::TreeChangeObserverFilter filter;
+};
+
// The native component of custom bindings for the chrome.automationInternal
// API.
class AutomationInternalCustomBindings : public ObjectBackedNativeHandler,
@@ -74,6 +79,11 @@ class AutomationInternalCustomBindings : public ObjectBackedNativeHandler,
void DestroyAccessibilityTree(
const v8::FunctionCallbackInfo<v8::Value>& args);
+ void AddTreeChangeObserver(const v8::FunctionCallbackInfo<v8::Value>& args);
+
+ void RemoveTreeChangeObserver(
+ const v8::FunctionCallbackInfo<v8::Value>& args);
+
void RouteTreeIDFunction(const std::string& name,
void (*callback)(v8::Isolate* isolate,
v8::ReturnValue<v8::Value> result,
@@ -159,6 +169,8 @@ class AutomationInternalCustomBindings : public ObjectBackedNativeHandler,
void OnAccessibilityEvent(const ExtensionMsg_AccessibilityEventParams& params,
bool is_active_profile);
+ void UpdateOverallTreeChangeObserverFilter();
+
// AXTreeDelegate implementation.
void OnTreeDataChanged(ui::AXTree* tree) override;
void OnNodeWillBeDeleted(ui::AXTree* tree, ui::AXNode* node) override;
@@ -168,15 +180,20 @@ class AutomationInternalCustomBindings : public ObjectBackedNativeHandler,
void OnAtomicUpdateFinished(ui::AXTree* tree,
bool root_changed,
const std::vector<Change>& changes) override;
-
void SendTreeChangeEvent(api::automation::TreeChangeType change_type,
ui::AXTree* tree,
ui::AXNode* node);
+ void SendChildTreeIDEvent(ui::AXTree* tree, ui::AXNode* node);
+ void SendNodesRemovedEvent(ui::AXTree* tree, const std::vector<int>& ids);
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_;
bool is_active_profile_;
+ std::vector<TreeChangeObserver> tree_change_observers_;
+ api::automation::TreeChangeObserverFilter
+ tree_change_observer_overall_filter_;
+ std::vector<int> deleted_node_ids_;
DISALLOW_COPY_AND_ASSIGN(AutomationInternalCustomBindings);
};

Powered by Google App Engine
This is Rietveld 408576698