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

Unified Diff: chrome/browser/ui/views/profiles/new_avatar_button.cc

Issue 381953002: New avatar button: Consolidate text elision between Mac and Win/Linux (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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
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..92ed49de084d2b51e88462b3544a8e940fd53789 100644
--- a/chrome/browser/ui/views/profiles/new_avatar_button.cc
+++ b/chrome/browser/ui/views/profiles/new_avatar_button.cc
@@ -48,22 +48,8 @@ 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;
+ return profiles::GetAvatarButtonTextForProfile(profile, gfx::FontList());
}
} // namespace

Powered by Google App Engine
This is Rietveld 408576698