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

Unified Diff: chrome/browser/profiles/profile_manager.cc

Issue 23868042: Mark supervised profiles as such immediately when they're created. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review Created 7 years, 2 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
Index: chrome/browser/profiles/profile_manager.cc
diff --git a/chrome/browser/profiles/profile_manager.cc b/chrome/browser/profiles/profile_manager.cc
index 5256afc691898388a0c47fdc239908601dca96f8..aa1b7b95d52a3f7acef5c2a27445ee64a8bf990c 100644
--- a/chrome/browser/profiles/profile_manager.cc
+++ b/chrome/browser/profiles/profile_manager.cc
@@ -552,6 +552,7 @@ bool ProfileManager::AddProfile(Profile* profile) {
}
RegisterProfile(profile, true);
+ InitProfileUserPrefs(profile);
DoFinalInit(profile, ShouldGoOffTheRecord(profile));
return true;
}
@@ -731,7 +732,6 @@ void ProfileManager::BrowserListObserver::OnBrowserSetLastActive(
#endif // !defined(OS_ANDROID) && !defined(OS_IOS)
void ProfileManager::DoFinalInit(Profile* profile, bool go_off_the_record) {
- InitProfileUserPrefs(profile);
DoFinalInitForServices(profile, go_off_the_record);
AddProfileToCache(profile);
DoFinalInitLogging(profile);
@@ -1013,8 +1013,14 @@ void ProfileManager::InitProfileUserPrefs(Profile* profile) {
if (!profile->GetPrefs()->HasPrefPath(prefs::kProfileName))
profile->GetPrefs()->SetString(prefs::kProfileName, profile_name);
- if (!profile->GetPrefs()->HasPrefPath(prefs::kManagedUserId))
+ if (!profile->GetPrefs()->HasPrefPath(prefs::kManagedUserId)) {
+ if (managed_user_id.empty() &&
+ CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kNewProfileIsSupervised)) {
+ managed_user_id = "Test ID";
+ }
profile->GetPrefs()->SetString(prefs::kManagedUserId, managed_user_id);
+ }
}
void ProfileManager::SetGuestProfilePrefs(Profile* profile) {

Powered by Google App Engine
This is Rietveld 408576698