Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 UI_ACCESSIBILITY_AX_TREE_H_ | 5 #ifndef UI_ACCESSIBILITY_AX_TREE_H_ |
| 6 #define UI_ACCESSIBILITY_AX_TREE_H_ | 6 #define UI_ACCESSIBILITY_AX_TREE_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <set> | 10 #include <set> |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 34 // In addition, one additional notification is fired at the end of an | 34 // In addition, one additional notification is fired at the end of an |
| 35 // atomic update, and it provides a vector of nodes that were added or | 35 // atomic update, and it provides a vector of nodes that were added or |
| 36 // changed, for final postprocessing: | 36 // changed, for final postprocessing: |
| 37 // OnAtomicUpdateFinished | 37 // OnAtomicUpdateFinished |
| 38 // | 38 // |
| 39 class AX_EXPORT AXTreeDelegate { | 39 class AX_EXPORT AXTreeDelegate { |
| 40 public: | 40 public: |
| 41 AXTreeDelegate(); | 41 AXTreeDelegate(); |
| 42 virtual ~AXTreeDelegate(); | 42 virtual ~AXTreeDelegate(); |
| 43 | 43 |
| 44 // Called before a node's data gets updated. | |
| 45 virtual void OnNodeDataWillChange(const AXNodeData& old_node_data, | |
|
dmazzoni
2016/02/19 23:20:23
For completeness I'd pass the AXTree* and AXNode*
| |
| 46 const AXNodeData& new_node_data) = 0; | |
| 47 | |
| 44 // Called when tree data changes. | 48 // Called when tree data changes. |
| 45 virtual void OnTreeDataChanged(AXTree* tree) = 0; | 49 virtual void OnTreeDataChanged(AXTree* tree) = 0; |
| 46 | 50 |
| 47 // Called just before a node is deleted. Its id and data will be valid, | 51 // Called just before a node is deleted. Its id and data will be valid, |
| 48 // but its links to parents and children are invalid. This is called | 52 // but its links to parents and children are invalid. This is called |
| 49 // in the middle of an update, the tree may be in an invalid state! | 53 // in the middle of an update, the tree may be in an invalid state! |
| 50 virtual void OnNodeWillBeDeleted(AXTree* tree, AXNode* node) = 0; | 54 virtual void OnNodeWillBeDeleted(AXTree* tree, AXNode* node) = 0; |
| 51 | 55 |
| 52 // Same as OnNodeWillBeDeleted, but only called once for an entire subtree. | 56 // Same as OnNodeWillBeDeleted, but only called once for an entire subtree. |
| 53 // This is called in the middle of an update, the tree may be in an | 57 // This is called in the middle of an update, the tree may be in an |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 159 AXTreeDelegate* delegate_; | 163 AXTreeDelegate* delegate_; |
| 160 AXNode* root_; | 164 AXNode* root_; |
| 161 base::hash_map<int32_t, AXNode*> id_map_; | 165 base::hash_map<int32_t, AXNode*> id_map_; |
| 162 std::string error_; | 166 std::string error_; |
| 163 AXTreeData data_; | 167 AXTreeData data_; |
| 164 }; | 168 }; |
| 165 | 169 |
| 166 } // namespace ui | 170 } // namespace ui |
| 167 | 171 |
| 168 #endif // UI_ACCESSIBILITY_AX_TREE_H_ | 172 #endif // UI_ACCESSIBILITY_AX_TREE_H_ |
| OLD | NEW |