| 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()); |
| 134 BrowserAccessibility* result = nullptr; | 135 BrowserAccessibility* result = nullptr; |
| 135 | 136 |
| 136 if (child_index == 0 && HasIntAttribute(ui::AX_ATTR_CHILD_TREE_ID)) { | 137 if (HasIntAttribute(ui::AX_ATTR_CHILD_TREE_ID)) { |
| 137 BrowserAccessibilityManager* child_manager = | 138 BrowserAccessibilityManager* child_manager = |
| 138 BrowserAccessibilityManager::FromID( | 139 BrowserAccessibilityManager::FromID( |
| 139 GetIntAttribute(ui::AX_ATTR_CHILD_TREE_ID)); | 140 GetIntAttribute(ui::AX_ATTR_CHILD_TREE_ID)); |
| 140 if (child_manager && child_manager->GetRoot()->GetParent() == this) | 141 if (child_manager && child_manager->GetRoot()->GetParent() == this) |
| 141 result = child_manager->GetRoot(); | 142 result = child_manager->GetRoot(); |
| 142 } else { | 143 } else { |
| 143 result = InternalGetChild(child_index); | 144 result = InternalGetChild(child_index); |
| 144 } | 145 } |
| 145 | 146 |
| 146 return result; | 147 return result; |
| (...skipping 1039 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1186 break; | 1187 break; |
| 1187 | 1188 |
| 1188 manager = root->GetParent()->manager(); | 1189 manager = root->GetParent()->manager(); |
| 1189 root = manager->GetRoot(); | 1190 root = manager->GetRoot(); |
| 1190 } | 1191 } |
| 1191 | 1192 |
| 1192 return bounds; | 1193 return bounds; |
| 1193 } | 1194 } |
| 1194 | 1195 |
| 1195 } // namespace content | 1196 } // namespace content |
| OLD | NEW |