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

Unified Diff: chrome/browser/ui/cocoa/profiles/avatar_button_controller.mm

Issue 890693003: [Mac] The Switch Person button can be moar accessible (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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 | « chrome/app/generated_resources.grd ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/profiles/avatar_button_controller.mm
diff --git a/chrome/browser/ui/cocoa/profiles/avatar_button_controller.mm b/chrome/browser/ui/cocoa/profiles/avatar_button_controller.mm
index 8f71b3fb912842a2ec253b23b6c592abc5fca4f9..0ed4d4bf2a838e72e2a385058bcbd36fe876a18a 100644
--- a/chrome/browser/ui/cocoa/profiles/avatar_button_controller.mm
+++ b/chrome/browser/ui/cocoa/profiles/avatar_button_controller.mm
@@ -120,15 +120,13 @@ NSImage* GetImageFromResourceID(int resourceId) {
- (void)setHasError:(BOOL)hasError withTitle:(NSString*)title {
hasError_ = hasError;
- if (hasError) {
- [self accessibilitySetOverrideValue:l10n_util::GetNSStringF(
- IDS_PROFILES_ACCOUNT_BUTTON_AUTH_ERROR_ACCESSIBLE_NAME,
- base::SysNSStringToUTF16(title))
- forAttribute:NSAccessibilityTitleAttribute];
- } else {
- [self accessibilitySetOverrideValue:title
- forAttribute:NSAccessibilityTitleAttribute];
- }
+ int messageId = hasError ?
+ IDS_PROFILES_ACCOUNT_BUTTON_AUTH_ERROR_ACCESSIBLE_NAME :
+ IDS_PROFILES_NEW_AVATAR_BUTTON_ACCESSIBLE_NAME;
+
+ [self accessibilitySetOverrideValue:l10n_util::GetNSStringF(
+ messageId, base::SysNSStringToUTF16(title))
+ forAttribute:NSAccessibilityTitleAttribute];
}
@end
@@ -159,7 +157,6 @@ NSImage* GetImageFromResourceID(int resourceId) {
SigninErrorController* errorController =
profiles::GetSigninErrorController(browser->profile());
hasError_ = errorController && errorController->HasError();
- [cell setHasError:hasError_ withTitle:nil];
[button_ setWantsLayer:YES];
[self setView:button_];
@@ -233,6 +230,7 @@ NSImage* GetImageFromResourceID(int resourceId) {
NSString* buttonTitle = base::SysUTF16ToNSString(useGenericButton ?
base::string16() :
profiles::GetAvatarButtonTextForProfile(browser_->profile()));
+ [[button_ cell] setHasError:hasError_ withTitle:buttonTitle];
HoverImageButton* button =
base::mac::ObjCCastStrict<HoverImageButton>(button_);
@@ -287,7 +285,6 @@ NSImage* GetImageFromResourceID(int resourceId) {
- (void)updateErrorStatus:(BOOL)hasError {
hasError_ = hasError;
- [[button_ cell] setHasError:hasError withTitle:[button_ title]];
[self updateAvatarButtonAndLayoutParent:YES];
}
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698