| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |