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

Unified Diff: content/browser/accessibility/browser_accessibility_cocoa.mm

Issue 25943003: Support accessible inline text boxes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix tests, implement support for IsLeaf everywhere Created 7 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/accessibility/browser_accessibility_cocoa.mm
diff --git a/content/browser/accessibility/browser_accessibility_cocoa.mm b/content/browser/accessibility/browser_accessibility_cocoa.mm
index be9ff5b329df1404dec89c851af00ec0b2e8236d..c3f443cb50dedf66db8207387621926ef32edb78 100644
--- a/content/browser/accessibility/browser_accessibility_cocoa.mm
+++ b/content/browser/accessibility/browser_accessibility_cocoa.mm
@@ -353,11 +353,11 @@ NSDictionary* attributeToMethodNameMap = nil;
// accessibility children of this object.
- (NSArray*)children {
if (!children_) {
- children_.reset([[NSMutableArray alloc]
- initWithCapacity:browserAccessibility_->child_count()] );
- for (uint32 index = 0;
- index < browserAccessibility_->child_count();
- ++index) {
+ uint32 childCount = browserAccessibility_->child_count();
+ if (browserAccessibility_->IsLeaf())
+ childCount = 0;
aboxhall 2013/10/23 16:15:21 Extra-trivial nit: how about uint32 childCount = 0
+ children_.reset([[NSMutableArray alloc] initWithCapacity:childCount]);
+ for (uint32 index = 0; index < childCount; ++index) {
BrowserAccessibilityCocoa* child =
browserAccessibility_->GetChild(index)->ToBrowserAccessibilityCocoa();
if ([child isIgnored])

Powered by Google App Engine
This is Rietveld 408576698