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

Unified Diff: chrome/browser/cocoa/browser_accessibility.mm

Issue 3200001: Hookup role descriptions for webkit specific strings. Only doing this for ac... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 4 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
« no previous file with comments | « no previous file | webkit/glue/webkit_strings.grd » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/cocoa/browser_accessibility.mm
===================================================================
--- chrome/browser/cocoa/browser_accessibility.mm (revision 56209)
+++ chrome/browser/cocoa/browser_accessibility.mm (working copy)
@@ -6,9 +6,11 @@
#import "chrome/browser/cocoa/browser_accessibility.h"
+#include "app/l10n_util_mac.h"
#include "base/string16.h"
#include "base/sys_string_conversions.h"
#include "chrome/browser/renderer_host/render_widget_host_view_mac.h"
+#include "grit/webkit_strings.h"
#include "third_party/WebKit/WebKit/chromium/public/WebRect.h"
using webkit_glue::WebAccessibility;
@@ -128,6 +130,21 @@
return role;
}
+// Returns a string indicating the role description of this object.
+- (NSString*)roleDescription {
+ // The following descriptions are specific to webkit.
+ if ([[self role] isEqualToString:@"AXWebArea"])
+ return l10n_util::GetNSString(IDS_AX_ROLE_WEB_AREA);
+
+ if ([[self role] isEqualToString:@"NSAccessibilityLinkRole"])
+ return l10n_util::GetNSString(IDS_AX_ROLE_LINK);
+
+ if ([[self role] isEqualToString:@"AXHeading"])
+ return l10n_util::GetNSString(IDS_AX_ROLE_HEADING);
+
+ return NSAccessibilityRoleDescription([self role], nil);
+}
+
// Returns the size of this object.
- (NSSize)size {
return NSMakeSize(webAccessibility_.location.width,
@@ -173,7 +190,7 @@
return base::SysUTF16ToNSString(webAccessibility_.value);
}
if ([attribute isEqualToString:NSAccessibilityRoleDescriptionAttribute]) {
- return NSAccessibilityRoleDescription([self role], nil);
+ return [self roleDescription];
}
if ([attribute isEqualToString:NSAccessibilityFocusedAttribute]) {
NSNumber* ret = [NSNumber numberWithBool:
« no previous file with comments | « no previous file | webkit/glue/webkit_strings.grd » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698