| 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 <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 682 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 693 } | 693 } |
| 694 | 694 |
| 695 // Returns a subrole based upon the role. | 695 // Returns a subrole based upon the role. |
| 696 - (NSString*) subrole { | 696 - (NSString*) subrole { |
| 697 ui::AXRole browserAccessibilityRole = [self internalRole]; | 697 ui::AXRole browserAccessibilityRole = [self internalRole]; |
| 698 if (browserAccessibilityRole == ui::AX_ROLE_TEXT_FIELD && | 698 if (browserAccessibilityRole == ui::AX_ROLE_TEXT_FIELD && |
| 699 GetState(browserAccessibility_, ui::AX_STATE_PROTECTED)) { | 699 GetState(browserAccessibility_, ui::AX_STATE_PROTECTED)) { |
| 700 return @"AXSecureTextField"; | 700 return @"AXSecureTextField"; |
| 701 } | 701 } |
| 702 | 702 |
| 703 NSString* htmlTag = NSStringForStringAttribute( | 703 if (browserAccessibilityRole == ui::AX_ROLE_DESCRIPTION_LIST) |
| 704 browserAccessibility_, ui::AX_ATTR_HTML_TAG); | 704 return @"AXDescriptionList"; |
| 705 | 705 |
| 706 if (browserAccessibilityRole == ui::AX_ROLE_LIST) { | 706 if (browserAccessibilityRole == ui::AX_ROLE_LIST) |
| 707 if ([htmlTag isEqualToString:@"dl"]) { | 707 return @"AXContentList"; |
| 708 return @"AXDescriptionList"; | |
| 709 } else { | |
| 710 return @"AXContentList"; | |
| 711 } | |
| 712 } | |
| 713 | 708 |
| 714 return [AXPlatformNodeCocoa nativeSubroleFromAXRole:browserAccessibilityRole]; | 709 return [AXPlatformNodeCocoa nativeSubroleFromAXRole:browserAccessibilityRole]; |
| 715 } | 710 } |
| 716 | 711 |
| 717 // Returns all tabs in this subtree. | 712 // Returns all tabs in this subtree. |
| 718 - (NSArray*)tabs { | 713 - (NSArray*)tabs { |
| 719 NSMutableArray* tabSubtree = [[[NSMutableArray alloc] init] autorelease]; | 714 NSMutableArray* tabSubtree = [[[NSMutableArray alloc] init] autorelease]; |
| 720 | 715 |
| 721 if ([self internalRole] == ui::AX_ROLE_TAB) | 716 if ([self internalRole] == ui::AX_ROLE_TAB) |
| 722 [tabSubtree addObject:self]; | 717 [tabSubtree addObject:self]; |
| (...skipping 728 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1451 return [super hash]; | 1446 return [super hash]; |
| 1452 return browserAccessibility_->GetId(); | 1447 return browserAccessibility_->GetId(); |
| 1453 } | 1448 } |
| 1454 | 1449 |
| 1455 - (BOOL)accessibilityShouldUseUniqueId { | 1450 - (BOOL)accessibilityShouldUseUniqueId { |
| 1456 return YES; | 1451 return YES; |
| 1457 } | 1452 } |
| 1458 | 1453 |
| 1459 @end | 1454 @end |
| 1460 | 1455 |
| OLD | NEW |