Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CONTENT_PUBLIC_COMMON_AX_TREE_H_ | |
| 6 #define CONTENT_PUBLIC_COMMON_AX_TREE_H_ | |
| 7 | |
| 8 #include "content/common/content_export.h" | |
| 9 #include "content/public/common/ax_node.h" | |
| 10 #include "content/public/common/ax_tree_update.h" | |
| 11 | |
| 12 namespace content { | |
| 13 | |
| 14 // AXTree is a live, managed tree of AXNode objects that can receive | |
| 15 // updates from another tree via AXTreeUpdates. | |
| 16 class CONTENT_EXPORT AXTree { | |
| 17 public: | |
| 18 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
| |
| 19 static AXTree* Create(const AXTreeUpdate& initial_state); | |
| 20 | |
| 21 // AXTreeSource. | |
| 22 virtual AXNode* GetRoot() const = 0; | |
| 23 virtual int32 GetRootId() const = 0; | |
| 24 virtual AXNode* GetFromId(int32 id) const = 0; | |
| 25 virtual int32 GetId(const AXNode* node) const = 0; | |
| 26 virtual int GetChildCount(const AXNode* node) const = 0; | |
| 27 virtual AXNode* GetChildAtIndex(const AXNode* node, int index) const = 0; | |
| 28 virtual int32 GetParentId(const AXNode* node) const = 0; | |
| 29 virtual void Serialize(const AXNode* node, AXNodeData* out_data) const = 0; | |
| 30 | |
| 31 // Apply an update from another tree. | |
| 32 virtual bool Unserialize(const AXTreeUpdate& update) = 0; | |
| 33 | |
| 34 protected: | |
| 35 AXTree(); | |
| 36 virtual ~AXTree(); | |
| 37 }; | |
| 38 | |
| 39 } // namespace content | |
| 40 | |
| 41 #endif // CONTENT_PUBLIC_COMMON_AX_TREE_H_ | |
| OLD | NEW |