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

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

Issue 2016243002: Mac a11y: Add RoleDescription and Value attributes to accessibility information. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address review comments. Created 4 years, 6 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
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 #include <stddef.h> 6 #include <stddef.h>
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #import "content/browser/accessibility/browser_accessibility_cocoa.h" 9 #import "content/browser/accessibility/browser_accessibility_cocoa.h"
10 10
(...skipping 1555 matching lines...) Expand 10 before | Expand all | Expand 10 after
1566 return CreateTextMarker(*first_text_object, 0); 1566 return CreateTextMarker(*first_text_object, 0);
1567 } 1567 }
1568 1568
1569 // Returns a subrole based upon the role. 1569 // Returns a subrole based upon the role.
1570 - (NSString*) subrole { 1570 - (NSString*) subrole {
1571 if (![self instanceActive]) 1571 if (![self instanceActive])
1572 return nil; 1572 return nil;
1573 ui::AXRole browserAccessibilityRole = [self internalRole]; 1573 ui::AXRole browserAccessibilityRole = [self internalRole];
1574 if (browserAccessibilityRole == ui::AX_ROLE_TEXT_FIELD && 1574 if (browserAccessibilityRole == ui::AX_ROLE_TEXT_FIELD &&
1575 GetState(browserAccessibility_, ui::AX_STATE_PROTECTED)) { 1575 GetState(browserAccessibility_, ui::AX_STATE_PROTECTED)) {
1576 return @"AXSecureTextField"; 1576 return NSAccessibilitySecureTextFieldSubrole;
1577 } 1577 }
1578 1578
1579 if (browserAccessibilityRole == ui::AX_ROLE_DESCRIPTION_LIST) 1579 if (browserAccessibilityRole == ui::AX_ROLE_DESCRIPTION_LIST)
1580 return @"AXDefinitionList"; 1580 return NSAccessibilityDefinitionListSubrole;
1581 1581
1582 if (browserAccessibilityRole == ui::AX_ROLE_LIST) 1582 if (browserAccessibilityRole == ui::AX_ROLE_LIST)
1583 return @"AXContentList"; 1583 return NSAccessibilityContentListSubrole;
1584 1584
1585 return [AXPlatformNodeCocoa nativeSubroleFromAXRole:browserAccessibilityRole]; 1585 return [AXPlatformNodeCocoa nativeSubroleFromAXRole:browserAccessibilityRole];
1586 } 1586 }
1587 1587
1588 // Returns all tabs in this subtree. 1588 // Returns all tabs in this subtree.
1589 - (NSArray*)tabs { 1589 - (NSArray*)tabs {
1590 if (![self instanceActive]) 1590 if (![self instanceActive])
1591 return nil; 1591 return nil;
1592 NSMutableArray* tabSubtree = [[[NSMutableArray alloc] init] autorelease]; 1592 NSMutableArray* tabSubtree = [[[NSMutableArray alloc] init] autorelease];
1593 1593
(...skipping 943 matching lines...) Expand 10 before | Expand all | Expand 10 after
2537 if (![self instanceActive]) 2537 if (![self instanceActive])
2538 return [super hash]; 2538 return [super hash];
2539 return browserAccessibility_->GetId(); 2539 return browserAccessibility_->GetId();
2540 } 2540 }
2541 2541
2542 - (BOOL)accessibilityShouldUseUniqueId { 2542 - (BOOL)accessibilityShouldUseUniqueId {
2543 return YES; 2543 return YES;
2544 } 2544 }
2545 2545
2546 @end 2546 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698