Index: ui/accessibility/ax_tree.h |
diff --git a/ui/accessibility/ax_tree.h b/ui/accessibility/ax_tree.h |
index 78be5157ea593c6c146fb71775aeddb14ff139b6..134ddf6a7822587de5bfae742dc466eb2e64f2df 100644 |
--- a/ui/accessibility/ax_tree.h |
+++ b/ui/accessibility/ax_tree.h |
@@ -9,6 +9,8 @@ |
#include "base/containers/hash_tables.h" |
#include "ui/accessibility/ax_export.h" |
+#include "ui/accessibility/ax_node_data.h" |
+#include "ui/accessibility/ax_tree_data.h" |
#include "ui/accessibility/ax_tree_update.h" |
namespace ui { |
@@ -37,6 +39,9 @@ class AX_EXPORT AXTreeDelegate { |
AXTreeDelegate(); |
virtual ~AXTreeDelegate(); |
+ // Called when tree data changes. |
+ virtual void OnTreeDataChanged(AXTree* tree) = 0; |
+ |
// Called just before a node is deleted. Its id and data will be valid, |
// but its links to parents and children are invalid. This is called |
// in the middle of an update, the tree may be in an invalid state! |
@@ -88,20 +93,24 @@ class AX_EXPORT AXTreeDelegate { |
class AX_EXPORT AXTree { |
public: |
AXTree(); |
- explicit AXTree(const AXTreeUpdate<AXNodeData>& initial_state); |
+ explicit AXTree(const AXTreeUpdate& initial_state); |
virtual ~AXTree(); |
virtual void SetDelegate(AXTreeDelegate* delegate); |
AXNode* root() const { return root_; } |
+ const AXTreeData& data() const { return data_; } |
+ |
// Returns the AXNode with the given |id| if it is part of this AXTree. |
AXNode* GetFromId(int32 id) const; |
// Returns true on success. If it returns false, it's a fatal error |
// and this tree should be destroyed, and the source of the tree update |
// should not be trusted any longer. |
- virtual bool Unserialize(const AXTreeUpdate<AXNodeData>& update); |
+ virtual bool Unserialize(const AXTreeUpdate& update); |
+ |
+ virtual void UpdateData(const AXTreeData& data); |
// Return a multi-line indented string representation, for logging. |
std::string ToString() const; |
@@ -149,6 +158,7 @@ class AX_EXPORT AXTree { |
AXNode* root_; |
base::hash_map<int32, AXNode*> id_map_; |
std::string error_; |
+ AXTreeData data_; |
}; |
} // namespace ui |