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

Unified Diff: chrome/browser/supervised_user/supervised_user_service.cc

Issue 431893004: Use the display name on ChromeOS instead of the profile name. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address nit. 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
« no previous file with comments | « chrome/browser/supervised_user/supervised_user_service.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/supervised_user/supervised_user_service.cc
diff --git a/chrome/browser/supervised_user/supervised_user_service.cc b/chrome/browser/supervised_user/supervised_user_service.cc
index 07deebfba15aee56a31d1c919ecfbb712686accc..7c3a31027dcc3b2320f49064a480e0b5c233d9ee 100644
--- a/chrome/browser/supervised_user/supervised_user_service.cc
+++ b/chrome/browser/supervised_user/supervised_user_service.cc
@@ -620,7 +620,7 @@ void SupervisedUserService::SetActive(bool active) {
settings_service,
SupervisedUserSharedSettingsServiceFactory::GetForBrowserContext(
profile_),
- pref_service->GetString(prefs::kProfileName),
+ GetSupervisedUserName(),
pref_service->GetString(prefs::kSupervisedUserId)));
}
@@ -764,3 +764,16 @@ void SupervisedUserService::OnBrowserSetLastActive(Browser* browser) {
is_profile_active_ = profile_became_active;
}
+
+std::string SupervisedUserService::GetSupervisedUserName() const {
+#if defined(OS_CHROMEOS)
+ // The active user can be NULL in unit tests.
+ if (chromeos::UserManager::Get()->GetActiveUser()) {
+ return UTF16ToUTF8(chromeos::UserManager::Get()->GetUserDisplayName(
+ chromeos::UserManager::Get()->GetActiveUser()->GetUserID()));
+ }
+ return std::string();
+#else
+ return profile_->GetPrefs()->GetString(prefs::kProfileName);
+#endif
+}
« no previous file with comments | « chrome/browser/supervised_user/supervised_user_service.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698