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

Unified Diff: content/public/common/ax_tree.h

Issue 67283004: First step to move common accessibility code out of content. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Moved out of public api Created 7 years, 1 month 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
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_

Powered by Google App Engine
This is Rietveld 408576698