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 16f070355c5c0832d36fe6c5f7946eff9577caec..8f93c2b019f3544592ee9d7704990df7377e2470 100644 |
--- a/chrome/browser/ui/cocoa/profiles/avatar_button_controller.mm |
+++ b/chrome/browser/ui/cocoa/profiles/avatar_button_controller.mm |
@@ -30,7 +30,6 @@ const CGFloat kButtonPadding = 12; |
const CGFloat kButtonDefaultPadding = 5; |
const CGFloat kButtonHeight = 27; |
const CGFloat kButtonTitleImageSpacing = 10; |
-const CGFloat kMaxButtonContentWidth = 100; |
const ui::NinePartImageIds kNormalBorderImageIds = |
IMAGE_GRID(IDR_AVATAR_MAC_BUTTON_NORMAL); |
@@ -221,14 +220,6 @@ NSImage* GetImageFromResourceID(int resourceId) { |
} |
} |
-- (base::string16)getElidedAvatarName { |
- base::string16 name = profiles::GetAvatarNameForProfile( |
- browser_->profile()->GetPath()); |
- int maxTextWidth = kMaxButtonContentWidth - [[button_ image] size].width; |
- return gfx::ElideText(name, gfx::FontList(gfx::Font([button_ font])), |
- maxTextWidth, gfx::ELIDE_TAIL); |
-} |
- |
- (void)updateAvatarButtonAndLayoutParent:(BOOL)layoutParent { |
// The button text has a black foreground and a white drop shadow for regular |
// windows, and a light text with a dark drop shadow for guest windows |
@@ -249,16 +240,8 @@ NSImage* GetImageFromResourceID(int resourceId) { |
[shadow setShadowColor:[NSColor colorWithCalibratedWhite:1.0 alpha:0.4]]; |
} |
- base::string16 profileName = [self getElidedAvatarName]; |
- NSString* buttonTitle = nil; |
- if (browser_->profile()->IsSupervised()) { |
- // Add the "supervised" label after eliding the profile name, so the label |
- // will not get elided, but will instead enlarge the button. |
- buttonTitle = l10n_util::GetNSStringF(IDS_SUPERVISED_USER_NEW_AVATAR_LABEL, |
- profileName); |
- } else { |
- buttonTitle = base::SysUTF16ToNSString(profileName); |
- } |
+ NSString* buttonTitle = base::SysUTF16ToNSString( |
+ profiles::GetAvatarButtonTextForProfile(browser_->profile())); |
base::scoped_nsobject<NSMutableParagraphStyle> paragraphStyle( |
[[NSMutableParagraphStyle alloc] init]); |