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..b754fd35e583dcf1ce7640085c2dbfcefd5f9339 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,16 @@ 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, false); |
+ if (profile->IsSupervised()) |
+ name = l10n_util::GetStringFUTF16(IDS_SUPERVISED_USER_NEW_AVATAR_LABEL, |
+ name); |
+ return name; |
+} |
+ |
void UpdateProfileName(Profile* profile, |
const base::string16& new_profile_name) { |
PrefService* pref_service = profile->GetPrefs(); |