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 1039 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1187 break; | 1186 break; |
1188 | 1187 |
1189 manager = root->GetParent()->manager(); | 1188 manager = root->GetParent()->manager(); |
1190 root = manager->GetRoot(); | 1189 root = manager->GetRoot(); |
1191 } | 1190 } |
1192 | 1191 |
1193 return bounds; | 1192 return bounds; |
1194 } | 1193 } |
1195 | 1194 |
1196 } // namespace content | 1195 } // namespace content |
OLD | NEW |