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

Unified Diff: chrome/browser/managed_mode/managed_user_service.cc

Issue 16950018: Collect the custodian's full name when a supervised user is created. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Remove stray blank line Created 7 years, 6 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/managed_mode/managed_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/managed_mode/managed_user_service.cc
===================================================================
--- chrome/browser/managed_mode/managed_user_service.cc (revision 207949)
+++ chrome/browser/managed_mode/managed_user_service.cc (working copy)
@@ -545,6 +545,8 @@
void ManagedUserService::RegisterAndInitSync(
Profile* custodian_profile,
const ProfileManager::CreateCallback& callback) {
+
+ // Register the managed user with the custodian's account.
ManagedUserRegistrationService* registration_service =
ManagedUserRegistrationServiceFactory::GetForProfile(custodian_profile);
string16 name = UTF8ToUTF16(
@@ -554,8 +556,21 @@
info,
base::Bind(&ManagedUserService::OnManagedUserRegistered,
weak_ptr_factory_.GetWeakPtr(), callback, custodian_profile));
+
+ // Fetch the custodian's profile information, to store the name.
+ // TODO(pamg): If --gaia-profile-info (keyword: switches::kGaiaProfileInfo)
+ // is ever enabled, take the name from the ProfileInfoCache instead.
+ registration_service->DownloadProfile(custodian_profile,
+ base::Bind(&ManagedUserService::OnCustodianProfileDownloaded,
+ weak_ptr_factory_.GetWeakPtr()));
}
+void ManagedUserService::OnCustodianProfileDownloaded(
+ const string16& full_name) {
+ profile_->GetPrefs()->SetString(prefs::kManagedUserCustodianName,
+ UTF16ToUTF8(full_name));
+}
+
void ManagedUserService::OnManagedUserRegistered(
const ProfileManager::CreateCallback& callback,
Profile* custodian_profile,
« no previous file with comments | « chrome/browser/managed_mode/managed_user_service.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698