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

Unified Diff: ui/accessibility/ax_tree.h

Issue 2737043003: Add support for attribute change callbacks in AXNodeData. (Closed)
Patch Set: Address feedback, lambda in local var Created 3 years, 9 months 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
« no previous file with comments | « no previous file | ui/accessibility/ax_tree.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/accessibility/ax_tree.h
diff --git a/ui/accessibility/ax_tree.h b/ui/accessibility/ax_tree.h
index bcc0ce5fff9a7fdc16acc78606744c93f9ca2981..53cd9ea7baeda471161e5d92ccae6908eff9061d 100644
--- a/ui/accessibility/ax_tree.h
+++ b/ui/accessibility/ax_tree.h
@@ -49,6 +49,41 @@ class AX_EXPORT AXTreeDelegate {
const AXNodeData& old_node_data,
const AXNodeData& new_node_data) = 0;
+ // Individual callbacks for every attribute of AXNodeData that can change.
+ virtual void OnRoleChanged(AXTree* tree,
+ AXNode* node,
+ AXRole old_role,
+ AXRole new_role) {}
+ virtual void OnStateChanged(AXTree* tree,
+ AXNode* node,
+ AXState state,
+ bool new_value) {}
+ virtual void OnStringAttributeChanged(AXTree* tree,
+ AXNode* node,
+ AXStringAttribute attr,
+ const std::string& old_value,
+ const std::string& new_value) {}
+ virtual void OnIntAttributeChanged(AXTree* tree,
+ AXNode* node,
+ AXIntAttribute attr,
+ int32_t old_value,
+ int32_t new_value) {}
+ virtual void OnFloatAttributeChanged(AXTree* tree,
+ AXNode* node,
+ AXFloatAttribute attr,
+ float old_value,
+ float new_value) {}
+ virtual void OnBoolAttributeChanged(AXTree* tree,
+ AXNode* node,
+ AXBoolAttribute attr,
+ bool new_value) {}
+ virtual void OnIntListAttributeChanged(
+ AXTree* tree,
+ AXNode* node,
+ AXIntListAttribute attr,
+ const std::vector<int32_t>& old_value,
+ const std::vector<int32_t>& new_value) {}
+
// Called when tree data changes.
virtual void OnTreeDataChanged(AXTree* tree) = 0;
@@ -156,6 +191,8 @@ class AX_EXPORT AXTree {
bool is_new_root,
AXTreeUpdateState* update_state);
+ void CallNodeChangeCallbacks(AXNode* node, const AXNodeData& new_data);
+
void OnRootChanged();
// Notify the delegate that the subtree rooted at |node| will be destroyed,
« no previous file with comments | « no previous file | ui/accessibility/ax_tree.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698