| 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 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 124 } | 124 } |
| 125 | 125 |
| 126 bool BrowserAccessibility::IsTextOnlyObject() const { | 126 bool BrowserAccessibility::IsTextOnlyObject() const { |
| 127 return GetRole() == ui::AX_ROLE_STATIC_TEXT || | 127 return GetRole() == ui::AX_ROLE_STATIC_TEXT || |
| 128 GetRole() == ui::AX_ROLE_LINE_BREAK || | 128 GetRole() == ui::AX_ROLE_LINE_BREAK || |
| 129 GetRole() == ui::AX_ROLE_INLINE_TEXT_BOX; | 129 GetRole() == ui::AX_ROLE_INLINE_TEXT_BOX; |
| 130 } | 130 } |
| 131 | 131 |
| 132 BrowserAccessibility* BrowserAccessibility::PlatformGetChild( | 132 BrowserAccessibility* BrowserAccessibility::PlatformGetChild( |
| 133 uint32_t child_index) const { | 133 uint32_t child_index) const { |
| 134 DCHECK_LT(child_index, PlatformChildCount()); | |
| 135 BrowserAccessibility* result = nullptr; | 134 BrowserAccessibility* result = nullptr; |
| 136 | 135 |
| 137 if (HasIntAttribute(ui::AX_ATTR_CHILD_TREE_ID)) { | 136 if (child_index == 0 && HasIntAttribute(ui::AX_ATTR_CHILD_TREE_ID)) { |
| 138 BrowserAccessibilityManager* child_manager = | 137 BrowserAccessibilityManager* child_manager = |
| 139 BrowserAccessibilityManager::FromID( | 138 BrowserAccessibilityManager::FromID( |
| 140 GetIntAttribute(ui::AX_ATTR_CHILD_TREE_ID)); | 139 GetIntAttribute(ui::AX_ATTR_CHILD_TREE_ID)); |
| 141 if (child_manager && child_manager->GetRoot()->GetParent() == this) | 140 if (child_manager && child_manager->GetRoot()->GetParent() == this) |
| 142 result = child_manager->GetRoot(); | 141 result = child_manager->GetRoot(); |
| 143 } else { | 142 } else { |
| 144 result = InternalGetChild(child_index); | 143 result = InternalGetChild(child_index); |
| 145 } | 144 } |
| 146 | 145 |
| 147 return result; | 146 return result; |
| (...skipping 1023 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1171 break; | 1170 break; |
| 1172 | 1171 |
| 1173 manager = root->GetParent()->manager(); | 1172 manager = root->GetParent()->manager(); |
| 1174 root = manager->GetRoot(); | 1173 root = manager->GetRoot(); |
| 1175 } | 1174 } |
| 1176 | 1175 |
| 1177 return bounds; | 1176 return bounds; |
| 1178 } | 1177 } |
| 1179 | 1178 |
| 1180 } // namespace content | 1179 } // namespace content |
| OLD | NEW |