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

Side by Side Diff: ui/accessibility/ax_node.cc

Issue 851853002: It is time. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Trying to reup because the last upload failed. Created 5 years, 11 months 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
« no previous file with comments | « ui/accessibility/ax_node.h ('k') | ui/accessibility/ax_node_data.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 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 "ui/accessibility/ax_node.h"
6
7 namespace ui {
8
9 AXNode::AXNode(AXNode* parent, int32 id, int32 index_in_parent)
10 : index_in_parent_(index_in_parent),
11 parent_(parent) {
12 data_.id = id;
13 }
14
15 AXNode::~AXNode() {
16 }
17
18 void AXNode::SetData(const AXNodeData& src) {
19 data_ = src;
20 }
21
22 void AXNode::SetLocation(const gfx::Rect& new_location) {
23 data_.location = new_location;
24 }
25
26 void AXNode::SetIndexInParent(int index_in_parent) {
27 index_in_parent_ = index_in_parent;
28 }
29
30 void AXNode::SwapChildren(std::vector<AXNode*>& children) {
31 children.swap(children_);
32 }
33
34 void AXNode::Destroy() {
35 delete this;
36 }
37
38 bool AXNode::IsDescendantOf(AXNode* ancestor) {
39 if (this == ancestor)
40 return true;
41 else if (parent())
42 return parent()->IsDescendantOf(ancestor);
43
44 return false;
45 }
46
47 } // namespace ui
OLDNEW
« no previous file with comments | « ui/accessibility/ax_node.h ('k') | ui/accessibility/ax_node_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698