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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(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 #include "content/common/ax_node_impl.h"
6
7 namespace content {
8
9 AXNodeImpl::AXNodeImpl()
10 : index_in_parent_(0),
11 parent_(NULL) {
12 }
13
14 AXNodeImpl::~AXNodeImpl() {
15 }
16
17 int32 AXNodeImpl::GetId() const {
18 return data_.id;
19 }
20
21 AXNode* AXNodeImpl::GetParent() const {
22 return parent_;
23 }
24
25 int AXNodeImpl::GetChildCount() const {
26 return static_cast<int>(children_.size());
27 }
28
29 AXNode* AXNodeImpl::ChildAtIndex(int index) const {
30 return children_[index];
31 }
32
33 const AXNodeData& AXNodeImpl::data() const {
34 return data_;
35 }
36
37 void AXNodeImpl::Init(AXNodeImpl* parent, int32 id, int32 index_in_parent) {
38 parent_ = parent;
39 data_.id = id;
40 index_in_parent_ = index_in_parent;
41 }
42
43 void AXNodeImpl::SetData(const AXNodeData& src) {
44 data_ = src;
45 }
46
47 void AXNodeImpl::UpdateIndexInParent(int index_in_parent) {
48 index_in_parent_ = index_in_parent;
49 }
50
51 void AXNodeImpl::SwapChildren(std::vector<AXNodeImpl*>& children) {
52 children.swap(children_);
53 }
54
55 void AXNodeImpl::Destroy() {
56 delete this;
57 }
58
59 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698