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

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

Issue 490493003: Merge 287309 "Use the display name on ChromeOS instead of the pr..." (Closed) Base URL: svn://svn.chromium.org/chrome/branches/2062/src/
Patch Set: Created 6 years, 4 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
===================================================================
--- chrome/browser/supervised_user/supervised_user_service.cc (revision 290568)
+++ chrome/browser/supervised_user/supervised_user_service.cc (working copy)
@@ -593,7 +593,7 @@
settings_service,
SupervisedUserSharedSettingsServiceFactory::GetForBrowserContext(
profile_),
- pref_service->GetString(prefs::kProfileName),
+ GetSupervisedUserName(),
pref_service->GetString(prefs::kSupervisedUserId)));
}
@@ -748,3 +748,16 @@
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