Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(365)

Side by Side Diff: content/browser/accessibility/browser_accessibility.cc

Issue 919343006: accessibility: Simpler code using ChildAtIndex() method. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "base/logging.h" 7 #include "base/logging.h"
8 #include "base/strings/string_number_conversions.h" 8 #include "base/strings/string_number_conversions.h"
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 uint32 BrowserAccessibility::InternalChildCount() const { 123 uint32 BrowserAccessibility::InternalChildCount() const {
124 if (!node_ || !manager_) 124 if (!node_ || !manager_)
125 return 0; 125 return 0;
126 return static_cast<uint32>(node_->child_count()); 126 return static_cast<uint32>(node_->child_count());
127 } 127 }
128 128
129 BrowserAccessibility* BrowserAccessibility::InternalGetChild( 129 BrowserAccessibility* BrowserAccessibility::InternalGetChild(
130 uint32 child_index) const { 130 uint32 child_index) const {
131 if (!node_ || !manager_) 131 if (!node_ || !manager_)
132 return NULL; 132 return NULL;
133 return manager_->GetFromAXNode(node_->children()[child_index]); 133 return manager_->GetFromAXNode(node_->ChildAtIndex(child_index));
134 } 134 }
135 135
136 BrowserAccessibility* BrowserAccessibility::GetParent() const { 136 BrowserAccessibility* BrowserAccessibility::GetParent() const {
137 if (!node_ || !manager_) 137 if (!node_ || !manager_)
138 return NULL; 138 return NULL;
139 ui::AXNode* parent = node_->parent(); 139 ui::AXNode* parent = node_->parent();
140 if (parent) 140 if (parent)
141 return manager_->GetFromAXNode(parent); 141 return manager_->GetFromAXNode(parent);
142 142
143 if (!manager_->delegate()) 143 if (!manager_->delegate())
(...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after
709 } 709 }
710 need_to_offset_web_area = true; 710 need_to_offset_web_area = true;
711 } 711 }
712 parent = parent->GetParentForBoundsCalculation(); 712 parent = parent->GetParentForBoundsCalculation();
713 } 713 }
714 714
715 return bounds; 715 return bounds;
716 } 716 }
717 717
718 } // namespace content 718 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698