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

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

Issue 2934953004: De-templatize ui::AXPosition
Patch Set: rebase Created 3 years, 6 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_position.h ('k') | ui/accessibility/ax_node_position_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/accessibility/ax_node_position.h" 5 #include "ui/accessibility/ax_node_position.h"
6 6
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "ui/accessibility/ax_enums.h" 8 #include "ui/accessibility/ax_enums.h"
9 9
10 namespace ui { 10 namespace ui {
11 11
12 AXTree* AXNodePosition::tree_ = nullptr; 12 AXTree* AXNodePosition::tree_ = nullptr;
13 13
14 AXNodePosition::AXNodePosition() {} 14 AXNodePosition::AXNodePosition() {}
15 15
16 AXNodePosition::~AXNodePosition() {} 16 AXNodePosition::~AXNodePosition() {}
17 17
18 AXNodePosition::AXPositionInstance AXNodePosition::Clone() const { 18 AXNodePosition::ConcreteInstance AXNodePosition::CloneConcrete() const {
19 return AXPositionInstance(new AXNodePosition(*this)); 19 return ConcreteInstance(new AXNodePosition(*this));
20 } 20 }
21 21
22 base::string16 AXNodePosition::GetInnerText() const { 22 base::string16 AXNodePosition::GetInnerText() const {
23 if (IsNullPosition()) 23 if (IsNullPosition())
24 return base::string16(); 24 return base::string16();
25 25
26 DCHECK(GetAnchor()); 26 DCHECK(GetAnchor());
27 base::string16 value = 27 base::string16 value =
28 GetAnchor()->data().GetString16Attribute(AX_ATTR_VALUE); 28 GetAnchor()->data().GetString16Attribute(AX_ATTR_VALUE);
29 if (!value.empty()) 29 if (!value.empty())
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 int previous_on_line_id; 131 int previous_on_line_id;
132 if (!node || 132 if (!node ||
133 !node->data().GetIntAttribute(AX_ATTR_PREVIOUS_ON_LINE_ID, 133 !node->data().GetIntAttribute(AX_ATTR_PREVIOUS_ON_LINE_ID,
134 &previous_on_line_id)) { 134 &previous_on_line_id)) {
135 return INVALID_ANCHOR_ID; 135 return INVALID_ANCHOR_ID;
136 } 136 }
137 return static_cast<int32_t>(previous_on_line_id); 137 return static_cast<int32_t>(previous_on_line_id);
138 } 138 }
139 139
140 } // namespace ui 140 } // namespace ui
OLDNEW
« no previous file with comments | « ui/accessibility/ax_node_position.h ('k') | ui/accessibility/ax_node_position_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698