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 #import "content/browser/accessibility/browser_accessibility_cocoa.h" | 5 #import "content/browser/accessibility/browser_accessibility_cocoa.h" |
6 | 6 |
7 #include <execinfo.h> | 7 #include <execinfo.h> |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 #include <string.h> | 10 #include <string.h> |
(...skipping 1355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1366 if (browserAccessibility_->IsWebAreaForPresentationalIframe()) | 1366 if (browserAccessibility_->IsWebAreaForPresentationalIframe()) |
1367 return NSAccessibilityGroupRole; | 1367 return NSAccessibilityGroupRole; |
1368 | 1368 |
1369 return [AXPlatformNodeCocoa nativeRoleFromAXRole:role]; | 1369 return [AXPlatformNodeCocoa nativeRoleFromAXRole:role]; |
1370 } | 1370 } |
1371 | 1371 |
1372 // Returns a string indicating the role description of this object. | 1372 // Returns a string indicating the role description of this object. |
1373 - (NSString*)roleDescription { | 1373 - (NSString*)roleDescription { |
1374 if (![self instanceActive]) | 1374 if (![self instanceActive]) |
1375 return nil; | 1375 return nil; |
| 1376 |
| 1377 if (browserAccessibility_->HasStringAttribute( |
| 1378 ui::AX_ATTR_ROLE_DESCRIPTION)) { |
| 1379 return NSStringForStringAttribute( |
| 1380 browserAccessibility_, ui::AX_ATTR_ROLE_DESCRIPTION); |
| 1381 } |
| 1382 |
1376 NSString* role = [self role]; | 1383 NSString* role = [self role]; |
1377 | 1384 |
1378 ContentClient* content_client = content::GetContentClient(); | 1385 ContentClient* content_client = content::GetContentClient(); |
1379 | 1386 |
1380 // The following descriptions are specific to webkit. | 1387 // The following descriptions are specific to webkit. |
1381 if ([role isEqualToString:@"AXWebArea"]) { | 1388 if ([role isEqualToString:@"AXWebArea"]) { |
1382 return base::SysUTF16ToNSString(content_client->GetLocalizedString( | 1389 return base::SysUTF16ToNSString(content_client->GetLocalizedString( |
1383 IDS_AX_ROLE_WEB_AREA)); | 1390 IDS_AX_ROLE_WEB_AREA)); |
1384 } | 1391 } |
1385 | 1392 |
(...skipping 1425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2811 } | 2818 } |
2812 | 2819 |
2813 - (BOOL)accessibilityNotifiesWhenDestroyed { | 2820 - (BOOL)accessibilityNotifiesWhenDestroyed { |
2814 // Indicate that BrowserAccessibilityCocoa will post a notification when it's | 2821 // Indicate that BrowserAccessibilityCocoa will post a notification when it's |
2815 // destroyed (see -detach). This allows VoiceOver to do some internal things | 2822 // destroyed (see -detach). This allows VoiceOver to do some internal things |
2816 // more efficiently. | 2823 // more efficiently. |
2817 return YES; | 2824 return YES; |
2818 } | 2825 } |
2819 | 2826 |
2820 @end | 2827 @end |
OLD | NEW |