| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "chrome/browser/ui/cocoa/profiles/avatar_button_controller.h" | 5 #import "chrome/browser/ui/cocoa/profiles/avatar_button_controller.h" |
| 6 | 6 |
| 7 #include "base/mac/foundation_util.h" | 7 #include "base/mac/foundation_util.h" |
| 8 #include "base/strings/sys_string_conversions.h" | 8 #include "base/strings/sys_string_conversions.h" |
| 9 #include "chrome/browser/profiles/profiles_state.h" | 9 #include "chrome/browser/profiles/profiles_state.h" |
| 10 #include "chrome/browser/themes/theme_service.h" | 10 #include "chrome/browser/themes/theme_service.h" |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 } else { | 246 } else { |
| 247 foregroundColor = [NSColor blackColor]; | 247 foregroundColor = [NSColor blackColor]; |
| 248 [shadow setShadowColor:[NSColor colorWithCalibratedWhite:1.0 alpha:0.4]]; | 248 [shadow setShadowColor:[NSColor colorWithCalibratedWhite:1.0 alpha:0.4]]; |
| 249 } | 249 } |
| 250 | 250 |
| 251 base::string16 profileName = [self getElidedAvatarName]; | 251 base::string16 profileName = [self getElidedAvatarName]; |
| 252 NSString* buttonTitle = nil; | 252 NSString* buttonTitle = nil; |
| 253 if (browser_->profile()->IsSupervised()) { | 253 if (browser_->profile()->IsSupervised()) { |
| 254 // Add the "supervised" label after eliding the profile name, so the label | 254 // Add the "supervised" label after eliding the profile name, so the label |
| 255 // will not get elided, but will instead enlarge the button. | 255 // will not get elided, but will instead enlarge the button. |
| 256 buttonTitle = l10n_util::GetNSStringF(IDS_MANAGED_USER_NEW_AVATAR_LABEL, | 256 buttonTitle = l10n_util::GetNSStringF(IDS_SUPERVISED_USER_NEW_AVATAR_LABEL, |
| 257 profileName); | 257 profileName); |
| 258 } else { | 258 } else { |
| 259 buttonTitle = base::SysUTF16ToNSString(profileName); | 259 buttonTitle = base::SysUTF16ToNSString(profileName); |
| 260 } | 260 } |
| 261 | 261 |
| 262 base::scoped_nsobject<NSMutableParagraphStyle> paragraphStyle( | 262 base::scoped_nsobject<NSMutableParagraphStyle> paragraphStyle( |
| 263 [[NSMutableParagraphStyle alloc] init]); | 263 [[NSMutableParagraphStyle alloc] init]); |
| 264 [paragraphStyle setAlignment:NSLeftTextAlignment]; | 264 [paragraphStyle setAlignment:NSLeftTextAlignment]; |
| 265 | 265 |
| 266 base::scoped_nsobject<NSAttributedString> attributedTitle( | 266 base::scoped_nsobject<NSAttributedString> attributedTitle( |
| (...skipping 13 matching lines...) Expand all Loading... |
| 280 layoutSubviews]; | 280 layoutSubviews]; |
| 281 } | 281 } |
| 282 } | 282 } |
| 283 | 283 |
| 284 - (void)updateErrorStatus:(BOOL)hasError { | 284 - (void)updateErrorStatus:(BOOL)hasError { |
| 285 [[button_ cell] setHasError:hasError]; | 285 [[button_ cell] setHasError:hasError]; |
| 286 [self updateAvatarButtonAndLayoutParent:YES]; | 286 [self updateAvatarButtonAndLayoutParent:YES]; |
| 287 } | 287 } |
| 288 | 288 |
| 289 @end | 289 @end |
| OLD | NEW |