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

Unified Diff: chrome/browser/ui/cocoa/search_engine_dialog_controller.mm

Issue 7982018: Add more descriptive labels for views in Mac's first run dialog. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Initial patch. Created 9 years, 3 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/search_engine_dialog_controller.mm
diff --git a/chrome/browser/ui/cocoa/search_engine_dialog_controller.mm b/chrome/browser/ui/cocoa/search_engine_dialog_controller.mm
index a51ae40c6fd1842cc69c2978eba1997eb09c404d..1c654a8fb82a2d860a457604ba24ca7d11d0d23b 100644
--- a/chrome/browser/ui/cocoa/search_engine_dialog_controller.mm
+++ b/chrome/browser/ui/cocoa/search_engine_dialog_controller.mm
@@ -196,6 +196,7 @@ void SearchEngineDialogControllerBridge::OnTemplateURLServiceChanged() {
NSView* engineIdentifier = nil; // either the logo or the text label
int logoId = engine->logo_id();
+ NSString* shortName = SysUTF16ToNSString(engine->short_name());
if (useImages && logoId > 0) {
NSImage* logoImage =
ResourceBundle::GetSharedInstance().GetNativeImageNamed(logoId);
@@ -207,7 +208,9 @@ void SearchEngineDialogControllerBridge::OnTemplateURLServiceChanged() {
[logoView setEditable:NO];
// Tooltip text provides accessibility.
- [logoView setToolTip:base::SysUTF16ToNSString(engine->short_name())];
+ [logoView setToolTip:shortName];
+ [logoView accessibilitySetOverrideValue:shortName
+ forAttribute:NSAccessibilityDescriptionAttribute];
engineIdentifier = logoView;
} else {
// No logo -- we must show a text label.
@@ -226,9 +229,8 @@ void SearchEngineDialogControllerBridge::OnTemplateURLServiceChanged() {
paragraphStyle.get(), NSParagraphStyleAttributeName,
nil];
- NSString* value = base::SysUTF16ToNSString(engine->short_name());
scoped_nsobject<NSAttributedString> attrValue(
- [[NSAttributedString alloc] initWithString:value
+ [[NSAttributedString alloc] initWithString:shortName
attributes:attrs]);
[labelField setAttributedStringValue:attrValue.get()];
@@ -248,6 +250,11 @@ void SearchEngineDialogControllerBridge::OnTemplateURLServiceChanged() {
[chooseButton setTarget:self];
[chooseButton setAction:@selector(searchEngineSelected:)];
+ // Provide a more descriptive accessibility description.
+ id accElement = NSAccessibilityUnignoredDescendant(engineIdentifier);
+ [[chooseButton cell] accessibilitySetOverrideValue:accElement
+ forAttribute:NSAccessibilityTitleUIElementAttribute];
+
// Put 'em together.
NSRect engineIdentifierFrame = [engineIdentifier frame];
NSRect chooseButtonFrame = [chooseButton frame];
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698