| Index: chrome/browser/ui/views/profiles/new_avatar_button.cc
|
| diff --git a/chrome/browser/ui/views/profiles/new_avatar_button.cc b/chrome/browser/ui/views/profiles/new_avatar_button.cc
|
| index a39991a46825c42f38cf4b31337d4b047a8865e5..aeb99f83e6964125c9dabcaa14762de17016f0a8 100644
|
| --- a/chrome/browser/ui/views/profiles/new_avatar_button.cc
|
| +++ b/chrome/browser/ui/views/profiles/new_avatar_button.cc
|
| @@ -48,24 +48,6 @@ scoped_ptr<views::Border> CreateBorder(const int normal_image_set[],
|
| return border.PassAs<views::Border>();
|
| }
|
|
|
| -base::string16 GetElidedText(const base::string16& original_text) {
|
| - // Maximum characters the button can be before the text will get elided.
|
| - const int kMaxCharactersToDisplay = 15;
|
| - const gfx::FontList font_list;
|
| - return gfx::ElideText(original_text, font_list,
|
| - font_list.GetExpectedTextWidth(kMaxCharactersToDisplay),
|
| - gfx::ELIDE_TAIL);
|
| -}
|
| -
|
| -base::string16 GetButtonText(Profile* profile) {
|
| - base::string16 name = GetElidedText(profiles::GetAvatarNameForProfile(
|
| - profile->GetPath()));
|
| - if (profile->IsSupervised())
|
| - name = l10n_util::GetStringFUTF16(IDS_SUPERVISED_USER_NEW_AVATAR_LABEL,
|
| - name);
|
| - return name;
|
| -}
|
| -
|
| } // namespace
|
|
|
| NewAvatarButton::NewAvatarButton(
|
| @@ -73,7 +55,10 @@ NewAvatarButton::NewAvatarButton(
|
| const base::string16& profile_name,
|
| AvatarButtonStyle button_style,
|
| Browser* browser)
|
| - : MenuButton(listener, GetButtonText(browser->profile()), NULL, true),
|
| + : MenuButton(listener,
|
| + profiles::GetAvatarButtonTextForProfile(browser->profile()),
|
| + NULL,
|
| + true),
|
| browser_(browser) {
|
| set_animate_on_state_change(false);
|
| SetTextColor(views::Button::STATE_NORMAL, SK_ColorWHITE);
|
| @@ -173,7 +158,7 @@ void NewAvatarButton::OnErrorChanged() {
|
|
|
| void NewAvatarButton::UpdateAvatarButtonAndRelayoutParent() {
|
| // We want the button to resize if the new text is shorter.
|
| - SetText(GetButtonText(browser_->profile()));
|
| + SetText(profiles::GetAvatarButtonTextForProfile(browser_->profile()));
|
| set_min_size(gfx::Size());
|
| InvalidateLayout();
|
|
|
|
|