Chromium Code Reviews| Index: chrome/browser/profiles/profiles_state.cc |
| diff --git a/chrome/browser/profiles/profiles_state.cc b/chrome/browser/profiles/profiles_state.cc |
| index de95755b0e49b796d67dac8b0e3bba556636f33f..e8bb677b14d1e9066b543fbd4eb0038628547a78 100644 |
| --- a/chrome/browser/profiles/profiles_state.cc |
| +++ b/chrome/browser/profiles/profiles_state.cc |
| @@ -22,6 +22,7 @@ |
| #include "components/signin/core/common/profile_management_switches.h" |
| #include "grit/generated_resources.h" |
| #include "ui/base/l10n/l10n_util.h" |
| +#include "ui/gfx/text_elider.h" |
| #if defined(OS_CHROMEOS) |
| #include "chrome/browser/chromeos/login/users/user_manager.h" |
| @@ -81,6 +82,18 @@ base::string16 GetAvatarNameForProfile(const base::FilePath& profile_path) { |
| return display_name; |
| } |
| +base::string16 GetAvatarButtonTextForProfile(Profile* profile) { |
| + const int kMaxCharactersToDisplay = 15; |
| + base::string16 name = GetAvatarNameForProfile(profile->GetPath()); |
| + name = gfx::TruncateString(name, |
| + kMaxCharactersToDisplay, |
| + gfx::CHARACTER_BREAK); |
| + if (profile->IsSupervised()) |
| + name = l10n_util::GetStringFUTF16(IDS_SUPERVISED_USER_NEW_AVATAR_LABEL, |
|
noms (inactive)
2014/07/22 13:40:59
nit: I think this may need { } because the stateme
Marc Treib
2014/07/22 14:12:44
Done.
|
| + name); |
| + return name; |
| +} |
| + |
| void UpdateProfileName(Profile* profile, |
| const base::string16& new_profile_name) { |
| PrefService* pref_service = profile->GetPrefs(); |