Index: content/public/common/ax_tree.h |
diff --git a/content/public/common/ax_tree.h b/content/public/common/ax_tree.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..c3cf69d8489820beef081150f69fab3e3a10bc45 |
--- /dev/null |
+++ b/content/public/common/ax_tree.h |
@@ -0,0 +1,41 @@ |
+// Copyright (c) 2013 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CONTENT_PUBLIC_COMMON_AX_TREE_H_ |
+#define CONTENT_PUBLIC_COMMON_AX_TREE_H_ |
+ |
+#include "content/common/content_export.h" |
+#include "content/public/common/ax_node.h" |
+#include "content/public/common/ax_tree_update.h" |
+ |
+namespace content { |
+ |
+// AXTree is a live, managed tree of AXNode objects that can receive |
+// updates from another tree via AXTreeUpdates. |
+class CONTENT_EXPORT AXTree { |
+ public: |
+ static AXTree* Create(); |
David Tseng
2013/11/11 18:43:51
An AXTree initialized without any AXTreeUpdate's s
dmazzoni
2013/11/12 00:03:04
It was useful for unit testing...maybe we should h
|
+ static AXTree* Create(const AXTreeUpdate& initial_state); |
+ |
+ // AXTreeSource. |
+ virtual AXNode* GetRoot() const = 0; |
+ virtual int32 GetRootId() const = 0; |
+ virtual AXNode* GetFromId(int32 id) const = 0; |
+ virtual int32 GetId(const AXNode* node) const = 0; |
+ virtual int GetChildCount(const AXNode* node) const = 0; |
+ virtual AXNode* GetChildAtIndex(const AXNode* node, int index) const = 0; |
+ virtual int32 GetParentId(const AXNode* node) const = 0; |
+ virtual void Serialize(const AXNode* node, AXNodeData* out_data) const = 0; |
+ |
+ // Apply an update from another tree. |
+ virtual bool Unserialize(const AXTreeUpdate& update) = 0; |
+ |
+ protected: |
+ AXTree(); |
+ virtual ~AXTree(); |
+}; |
+ |
+} // namespace content |
+ |
+#endif // CONTENT_PUBLIC_COMMON_AX_TREE_H_ |