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

Side by Side Diff: content/browser/accessibility/browser_accessibility_cocoa.mm

Issue 692643005: ARIA state/property(aria-relevant,aria-busy) are not exposed correctly on MAC. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Incorporating comments Created 6 years, 1 month 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 | content/renderer/accessibility/blink_ax_tree_source.cc » ('j') | 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 <execinfo.h> 5 #include <execinfo.h>
6 6
7 #import "content/browser/accessibility/browser_accessibility_cocoa.h" 7 #import "content/browser/accessibility/browser_accessibility_cocoa.h"
8 8
9 #include <map> 9 #include <map>
10 10
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 browserAccessibility_, ui::AX_ATTR_ACCESS_KEY); 144 browserAccessibility_, ui::AX_ATTR_ACCESS_KEY);
145 } 145 }
146 146
147 - (NSNumber*)ariaAtomic { 147 - (NSNumber*)ariaAtomic {
148 bool boolValue = browserAccessibility_->GetBoolAttribute( 148 bool boolValue = browserAccessibility_->GetBoolAttribute(
149 ui::AX_ATTR_LIVE_ATOMIC); 149 ui::AX_ATTR_LIVE_ATOMIC);
150 return [NSNumber numberWithBool:boolValue]; 150 return [NSNumber numberWithBool:boolValue];
151 } 151 }
152 152
153 - (NSNumber*)ariaBusy { 153 - (NSNumber*)ariaBusy {
154 bool boolValue = browserAccessibility_->GetBoolAttribute( 154 return [NSNumber numberWithBool:
155 ui::AX_ATTR_LIVE_BUSY); 155 GetState(browserAccessibility_, ui::AX_STATE_BUSY)];
156 return [NSNumber numberWithBool:boolValue];
157 } 156 }
158 157
159 - (NSString*)ariaLive { 158 - (NSString*)ariaLive {
160 return NSStringForStringAttribute( 159 return NSStringForStringAttribute(
161 browserAccessibility_, ui::AX_ATTR_LIVE_STATUS); 160 browserAccessibility_, ui::AX_ATTR_LIVE_STATUS);
162 } 161 }
163 162
164 - (NSString*)ariaRelevant { 163 - (NSString*)ariaRelevant {
165 return NSStringForStringAttribute( 164 return NSStringForStringAttribute(
166 browserAccessibility_, ui::AX_ATTR_LIVE_RELEVANT); 165 browserAccessibility_, ui::AX_ATTR_LIVE_RELEVANT);
(...skipping 1150 matching lines...) Expand 10 before | Expand all | Expand 10 after
1317 [ret addObjectsFromArray:[NSArray arrayWithObjects: 1316 [ret addObjectsFromArray:[NSArray arrayWithObjects:
1318 NSAccessibilityURLAttribute, 1317 NSAccessibilityURLAttribute,
1319 nil]]; 1318 nil]];
1320 } 1319 }
1321 1320
1322 // Live regions. 1321 // Live regions.
1323 if (browserAccessibility_->HasStringAttribute( 1322 if (browserAccessibility_->HasStringAttribute(
1324 ui::AX_ATTR_LIVE_STATUS)) { 1323 ui::AX_ATTR_LIVE_STATUS)) {
1325 [ret addObjectsFromArray:[NSArray arrayWithObjects: 1324 [ret addObjectsFromArray:[NSArray arrayWithObjects:
1326 @"AXARIALive", 1325 @"AXARIALive",
1326 nil]];
1327 }
1328 if (browserAccessibility_->HasStringAttribute(
1329 ui::AX_ATTR_LIVE_RELEVANT)) {
1330 [ret addObjectsFromArray:[NSArray arrayWithObjects:
1327 @"AXARIARelevant", 1331 @"AXARIARelevant",
1328 nil]]; 1332 nil]];
1329 } 1333 }
1330 if (browserAccessibility_->HasStringAttribute( 1334 if (browserAccessibility_->HasBoolAttribute(
1331 ui::AX_ATTR_CONTAINER_LIVE_STATUS)) { 1335 ui::AX_ATTR_LIVE_ATOMIC)) {
1332 [ret addObjectsFromArray:[NSArray arrayWithObjects: 1336 [ret addObjectsFromArray:[NSArray arrayWithObjects:
1333 @"AXARIAAtomic", 1337 @"AXARIAAtomic",
1338 nil]];
1339 }
1340 if (browserAccessibility_->HasBoolAttribute(
1341 ui::AX_ATTR_LIVE_BUSY)) {
1342 [ret addObjectsFromArray:[NSArray arrayWithObjects:
1334 @"AXARIABusy", 1343 @"AXARIABusy",
1335 nil]]; 1344 nil]];
1336 } 1345 }
1337 1346
1338 //Add expanded attribute only if it has expanded or collapsed state. 1347 //Add expanded attribute only if it has expanded or collapsed state.
1339 if (GetState(browserAccessibility_,ui::AX_STATE_EXPANDED) || 1348 if (GetState(browserAccessibility_, ui::AX_STATE_EXPANDED) ||
1340 GetState(browserAccessibility_,ui::AX_STATE_COLLAPSED)) { 1349 GetState(browserAccessibility_, ui::AX_STATE_COLLAPSED)) {
1341 [ret addObjectsFromArray:[NSArray arrayWithObjects: 1350 [ret addObjectsFromArray:[NSArray arrayWithObjects:
1342 NSAccessibilityExpandedAttribute, 1351 NSAccessibilityExpandedAttribute,
1343 nil]]; 1352 nil]];
1344 } 1353 }
1345 1354
1346 // Title UI Element. 1355 // Title UI Element.
1347 if (browserAccessibility_->HasIntAttribute(ui::AX_ATTR_TITLE_UI_ELEMENT) || 1356 if (browserAccessibility_->HasIntAttribute(ui::AX_ATTR_TITLE_UI_ELEMENT) ||
1348 (browserAccessibility_->HasIntListAttribute(ui::AX_ATTR_LABELLEDBY_IDS) && 1357 (browserAccessibility_->HasIntListAttribute(ui::AX_ATTR_LABELLEDBY_IDS) &&
1349 browserAccessibility_->GetIntListAttribute(ui::AX_ATTR_LABELLEDBY_IDS) 1358 browserAccessibility_->GetIntListAttribute(ui::AX_ATTR_LABELLEDBY_IDS)
1350 .size() == 1)) { 1359 .size() == 1)) {
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
1498 return [super hash]; 1507 return [super hash];
1499 return browserAccessibility_->GetId(); 1508 return browserAccessibility_->GetId();
1500 } 1509 }
1501 1510
1502 - (BOOL)accessibilityShouldUseUniqueId { 1511 - (BOOL)accessibilityShouldUseUniqueId {
1503 return YES; 1512 return YES;
1504 } 1513 }
1505 1514
1506 @end 1515 @end
1507 1516
OLDNEW
« no previous file with comments | « no previous file | content/renderer/accessibility/blink_ax_tree_source.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698