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

Unified Diff: content/common/ax_node_impl.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: Refactored AXTreeImpl::UpdateNode 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
« no previous file with comments | « no previous file | content/common/ax_node_impl.cc » ('j') | content/common/ax_tree_source.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_
« no previous file with comments | « no previous file | content/common/ax_node_impl.cc » ('j') | content/common/ax_tree_source.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698