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 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 if (!node_ || !manager_) | 289 if (!node_ || !manager_) |
290 return 0; | 290 return 0; |
291 return static_cast<uint32_t>(node_->child_count()); | 291 return static_cast<uint32_t>(node_->child_count()); |
292 } | 292 } |
293 | 293 |
294 BrowserAccessibility* BrowserAccessibility::InternalGetChild( | 294 BrowserAccessibility* BrowserAccessibility::InternalGetChild( |
295 uint32_t child_index) const { | 295 uint32_t child_index) const { |
296 if (!node_ || !manager_ || child_index >= InternalChildCount()) | 296 if (!node_ || !manager_ || child_index >= InternalChildCount()) |
297 return nullptr; | 297 return nullptr; |
298 | 298 |
299 const auto child_node = node_->ChildAtIndex(child_index); | 299 auto* child_node = node_->ChildAtIndex(child_index); |
300 DCHECK(child_node); | 300 DCHECK(child_node); |
301 return manager_->GetFromAXNode(child_node); | 301 return manager_->GetFromAXNode(child_node); |
302 } | 302 } |
303 | 303 |
304 BrowserAccessibility* BrowserAccessibility::GetParent() const { | 304 BrowserAccessibility* BrowserAccessibility::GetParent() const { |
305 if (!instance_active()) | 305 if (!instance_active()) |
306 return nullptr; | 306 return nullptr; |
307 | 307 |
308 ui::AXNode* parent = node_->parent(); | 308 ui::AXNode* parent = node_->parent(); |
309 if (parent) | 309 if (parent) |
(...skipping 893 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1203 break; | 1203 break; |
1204 | 1204 |
1205 manager = root->GetParent()->manager(); | 1205 manager = root->GetParent()->manager(); |
1206 root = manager->GetRoot(); | 1206 root = manager->GetRoot(); |
1207 } | 1207 } |
1208 | 1208 |
1209 return bounds; | 1209 return bounds; |
1210 } | 1210 } |
1211 | 1211 |
1212 } // namespace content | 1212 } // namespace content |
OLD | NEW |