Index: content/common/ax_node_impl.h |
diff --git a/content/common/ax_node_impl.h b/content/common/ax_node_impl.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..d900f6c8f81c573b524406007db432b5fd9b5de3 |
--- /dev/null |
+++ b/content/common/ax_node_impl.h |
@@ -0,0 +1,60 @@ |
+// 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_COMMON_AX_NODE_IMPL_H_ |
+#define CONTENT_COMMON_AX_NODE_IMPL_H_ |
+ |
+#include "content/public/common/ax_node.h" |
+#include "content/public/common/ax_node_data.h" |
+ |
+namespace content { |
+ |
+class CONTENT_EXPORT AXNodeImpl : public AXNode { |
+ public: |
+ AXNodeImpl(); |
+ virtual ~AXNodeImpl(); |
+ |
+ // AXNode implementation. |
+ virtual int32 GetId() const OVERRIDE; |
+ virtual AXNode* GetParent() const OVERRIDE; |
+ virtual int GetChildCount() const OVERRIDE; |
+ virtual AXNode* ChildAtIndex(int index) const OVERRIDE; |
+ virtual const AXNodeData& data() const OVERRIDE; |
+ |
+ const std::vector<AXNodeImpl*>& children() const { return children_; } |
+ |
+ // Initialize the node. This sets up its place in the tree but does |
+ // not set its data yet. After initialization, only index_in_parent |
+ // is allowed to change, the others are guaranteed to never change. |
+ virtual void Init(AXNodeImpl* parent, int32 id, int32 index_in_parent); |
+ |
+ // Set the node's accessibility data. This may be done during initial |
+ // initialization or later when the node data changes. |
+ virtual void SetData(const AXNodeData& src); |
+ |
+ // Update the index in parent if siblings were inserted or deleted. |
+ void UpdateIndexInParent(int index_in_parent); |
+ |
+ // Swap the internal children vector with |children|. This instance |
+ // now owns all of the passed children. |
+ virtual void SwapChildren(std::vector<AXNodeImpl*>& children); |
+ |
+ // This is called when the AXTree no longer includes this node in the |
+ // tree. Reference counting is used on some platforms because the |
+ // operating system may hold onto a reference to an AXNode |
+ // object even after we're through with it, so this may decrement the |
+ // reference count and clear out the object's data. |
+ virtual void Destroy(); |
+ |
+ private: |
+ int index_in_parent_; |
+ AXNodeImpl* parent_; |
+ std::vector<AXNodeImpl*> children_; |
+ AXNodeData data_; |
+}; |
+ |
+ |
+} // namespace content |
+ |
+#endif // CONTENT_COMMON_AX_NODE_IMPL_H_ |