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

Unified Diff: content/common/ax_node_impl.cc

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
Index: content/common/ax_node_impl.cc
diff --git a/content/common/ax_node_impl.cc b/content/common/ax_node_impl.cc
new file mode 100644
index 0000000000000000000000000000000000000000..917827a199c7cb3bcfb480bccee20ad8d23cda04
--- /dev/null
+++ b/content/common/ax_node_impl.cc
@@ -0,0 +1,59 @@
+// 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.
+
+#include "content/common/ax_node_impl.h"
+
+namespace content {
+
+AXNodeImpl::AXNodeImpl()
+ : index_in_parent_(0),
+ parent_(NULL) {
+}
+
+AXNodeImpl::~AXNodeImpl() {
+}
+
+int32 AXNodeImpl::GetId() const {
+ return data_.id;
+}
+
+AXNode* AXNodeImpl::GetParent() const {
+ return parent_;
+}
+
+int AXNodeImpl::GetChildCount() const {
+ return static_cast<int>(children_.size());
+}
+
+AXNode* AXNodeImpl::ChildAtIndex(int index) const {
+ return children_[index];
+}
+
+const AXNodeData& AXNodeImpl::data() const {
+ return data_;
+}
+
+void AXNodeImpl::Init(AXNodeImpl* parent, int32 id, int32 index_in_parent) {
+ parent_ = parent;
+ data_.id = id;
+ index_in_parent_ = index_in_parent;
+}
+
+void AXNodeImpl::SetData(const AXNodeData& src) {
+ data_ = src;
+}
+
+void AXNodeImpl::UpdateIndexInParent(int index_in_parent) {
+ index_in_parent_ = index_in_parent;
+}
+
+void AXNodeImpl::SwapChildren(std::vector<AXNodeImpl*>& children) {
+ children.swap(children_);
+}
+
+void AXNodeImpl::Destroy() {
+ delete this;
+}
+
+} // namespace content

Powered by Google App Engine
This is Rietveld 408576698