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

Side by Side Diff: content/browser/accessibility/browser_accessibility.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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/browser/accessibility/browser_accessibility.h" 5 #include "content/browser/accessibility/browser_accessibility.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <iterator> 10 #include <iterator>
(...skipping 1003 matching lines...) Expand 10 before | Expand all | Expand 10 after
1014 1014
1015 return name; 1015 return name;
1016 } 1016 }
1017 1017
1018 std::vector<int> BrowserAccessibility::GetLineStartOffsets() const { 1018 std::vector<int> BrowserAccessibility::GetLineStartOffsets() const {
1019 if (!instance_active()) 1019 if (!instance_active())
1020 return std::vector<int>(); 1020 return std::vector<int>();
1021 return node()->GetOrComputeLineStartOffsets(); 1021 return node()->GetOrComputeLineStartOffsets();
1022 } 1022 }
1023 1023
1024 BrowserAccessibility::AXPlatformPositionInstance 1024 AXPlatformPosition::ConcreteInstance BrowserAccessibility::CreatePositionAt(
1025 BrowserAccessibility::CreatePositionAt(int offset, 1025 int offset,
1026 ui::AXTextAffinity affinity) const { 1026 ui::AXTextAffinity affinity) const {
1027 DCHECK(manager_); 1027 DCHECK(manager_);
1028 return AXPlatformPosition::CreateTextPosition(manager_->ax_tree_id(), GetId(), 1028 return AXPlatformPosition::CreateConcreteTextPosition(
1029 offset, affinity); 1029 manager_->ax_tree_id(), GetId(), offset, affinity);
1030 } 1030 }
1031 1031
1032 base::string16 BrowserAccessibility::GetInnerText() const { 1032 base::string16 BrowserAccessibility::GetInnerText() const {
1033 if (IsTextOnlyObject()) 1033 if (IsTextOnlyObject())
1034 return GetString16Attribute(ui::AX_ATTR_NAME); 1034 return GetString16Attribute(ui::AX_ATTR_NAME);
1035 1035
1036 base::string16 text; 1036 base::string16 text;
1037 for (size_t i = 0; i < InternalChildCount(); ++i) 1037 for (size_t i = 0; i < InternalChildCount(); ++i)
1038 text += InternalGetChild(i)->GetInnerText(); 1038 text += InternalGetChild(i)->GetInnerText();
1039 return text; 1039 return text;
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
1160 1160
1161 if (data.action == ui::AX_ACTION_FOCUS) { 1161 if (data.action == ui::AX_ACTION_FOCUS) {
1162 manager_->SetFocus(*this); 1162 manager_->SetFocus(*this);
1163 return true; 1163 return true;
1164 } 1164 }
1165 1165
1166 return false; 1166 return false;
1167 } 1167 }
1168 1168
1169 } // namespace content 1169 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/accessibility/browser_accessibility.h ('k') | content/browser/accessibility/browser_accessibility_cocoa.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698