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 | 10 |
(...skipping 1144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1155 | 1155 |
1156 return name; | 1156 return name; |
1157 } | 1157 } |
1158 | 1158 |
1159 std::vector<int> BrowserAccessibility::GetLineStartOffsets() const { | 1159 std::vector<int> BrowserAccessibility::GetLineStartOffsets() const { |
1160 if (!instance_active()) | 1160 if (!instance_active()) |
1161 return std::vector<int>(); | 1161 return std::vector<int>(); |
1162 return node()->GetOrComputeLineStartOffsets(); | 1162 return node()->GetOrComputeLineStartOffsets(); |
1163 } | 1163 } |
1164 | 1164 |
| 1165 BrowserAccessibility::AXPlatformPositionInstance |
| 1166 BrowserAccessibility::CreatePositionAt(int offset) const { |
| 1167 DCHECK(manager_); |
| 1168 return AXPlatformPosition::CreateTextPosition( |
| 1169 manager_->ax_tree_id(), GetId(), offset, ui::AX_TEXT_AFFINITY_DOWNSTREAM); |
| 1170 } |
| 1171 |
1165 base::string16 BrowserAccessibility::GetInnerText() const { | 1172 base::string16 BrowserAccessibility::GetInnerText() const { |
1166 if (IsTextOnlyObject()) | 1173 if (IsTextOnlyObject()) |
1167 return GetString16Attribute(ui::AX_ATTR_NAME); | 1174 return GetString16Attribute(ui::AX_ATTR_NAME); |
1168 | 1175 |
1169 base::string16 text; | 1176 base::string16 text; |
1170 for (size_t i = 0; i < InternalChildCount(); ++i) | 1177 for (size_t i = 0; i < InternalChildCount(); ++i) |
1171 text += InternalGetChild(i)->GetInnerText(); | 1178 text += InternalGetChild(i)->GetInnerText(); |
1172 return text; | 1179 return text; |
1173 } | 1180 } |
1174 | 1181 |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1231 } | 1238 } |
1232 } | 1239 } |
1233 | 1240 |
1234 node = container; | 1241 node = container; |
1235 } | 1242 } |
1236 | 1243 |
1237 return gfx::ToEnclosingRect(bounds); | 1244 return gfx::ToEnclosingRect(bounds); |
1238 } | 1245 } |
1239 | 1246 |
1240 } // namespace content | 1247 } // namespace content |
OLD | NEW |