Index: chrome/browser/profiles/profile_manager.cc |
diff --git a/chrome/browser/profiles/profile_manager.cc b/chrome/browser/profiles/profile_manager.cc |
index 6140d201f264a2dcd22f13cda83b38abbe0ead3d..bc1a9066a9c81ad29ca3fe85532ad0d9e6d6d264 100644 |
--- a/chrome/browser/profiles/profile_manager.cc |
+++ b/chrome/browser/profiles/profile_manager.cc |
@@ -551,6 +551,7 @@ bool ProfileManager::AddProfile(Profile* profile) { |
} |
RegisterProfile(profile, true); |
+ InitProfileUserPrefs(profile); |
rpetterson
2013/10/01 20:19:57
It doesn't really change the call flow, so I'm cur
Bernhard Bauer
2013/10/01 20:42:15
InitProfileUserPrefs() is where we mark a profile
rpetterson
2013/10/07 23:22:49
I understand better what's going on now. However,
Bernhard Bauer
2013/10/08 14:56:01
This CL actually does change the behavior for ever
rpetterson
2013/10/08 18:02:55
Yes. If we're changing it for everyone, there shou
|
DoFinalInit(profile, ShouldGoOffTheRecord(profile)); |
return true; |
} |
@@ -714,7 +715,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); |
@@ -805,6 +805,10 @@ Profile* ProfileManager::CreateProfileAsyncHelper(const base::FilePath& path, |
Profile::CREATE_MODE_ASYNCHRONOUS); |
} |
+void ProfileManager::OnPrefsLoaded(Profile* profile) { |
+ InitProfileUserPrefs(profile); |
+} |
+ |
void ProfileManager::OnProfileCreated(Profile* profile, |
bool success, |
bool is_new_profile) { |
@@ -996,8 +1000,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) { |