Chromium Code Reviews| Index: chrome/browser/chromeos/login/login_utils.cc |
| diff --git a/chrome/browser/chromeos/login/login_utils.cc b/chrome/browser/chromeos/login/login_utils.cc |
| index 4e6f8dda406b66bf22ff35655b0b73a1c5459c4a..c0f01fc0e599a9b21226f2577eac03ff454cc76f 100644 |
| --- a/chrome/browser/chromeos/login/login_utils.cc |
| +++ b/chrome/browser/chromeos/login/login_utils.cc |
| @@ -253,13 +253,20 @@ class LoginUtilsImpl |
| // Check user's profile for kApplicationLocale setting. |
| void RespectLocalePreference(Profile* pref); |
| - // Initializes basic preferences for newly created profile. |
| + // Callback for Profile::CREATE_STATUS_CREATED profile state. |
| + // Initializes basic preferences for newly created profile. Any other |
| + // profile early initialization that needs to happen before |
| + // ProfileManager::DoFinalInit() gets called is also done here. |
| void InitProfilePreferences(Profile* user_profile); |
| // Callback for asynchronous profile creation. |
| void OnProfileCreated(Profile* profile, |
| Profile::CreateStatus status); |
| + // Callback for Profile::CREATE_STATUS_INITIALIZED profile state. |
| + // Profile is created, extensions and promo resources are initialized. |
| + void UserProfileInitialized(Profile* user_profile); |
| + |
| // Callback to resume profile creation after transferring auth data from |
| // the authentication profile. |
| void CompleteProfileCreate(Profile* user_profile); |
| @@ -455,7 +462,9 @@ void LoginUtilsImpl::InitProfilePreferences(Profile* user_profile) { |
| if (UserManager::Get()->IsCurrentUserNew()) |
| SetFirstLoginPrefs(user_profile->GetPrefs()); |
| - if (!UserManager::Get()->IsLoggedInAsLocallyManagedUser()) { |
| + if (UserManager::Get()->IsLoggedInAsLocallyManagedUser()) { |
| + user_profile->GetPrefs()->SetBoolean(prefs::kProfileIsManaged, true); |
| + } else { |
| // Make sure that the google service username is properly set (we do this |
| // on every sign in, not just the first login, to deal with existing |
| // profiles that might not have it set yet). |
| @@ -492,17 +501,20 @@ void LoginUtilsImpl::OnProfileCreated( |
| switch (status) { |
| case Profile::CREATE_STATUS_INITIALIZED: |
| + UserProfileInitialized(user_profile); |
| break; |
| case Profile::CREATE_STATUS_CREATED: { |
|
Dmitry Polukhin
2013/02/11 09:50:12
nit, please remove {} they are not required.
Nikita (slow)
2013/02/11 10:16:39
Done.
|
| InitProfilePreferences(user_profile); |
| - return; |
| + break; |
| } |
| case Profile::CREATE_STATUS_FAIL: |
| default: |
| NOTREACHED(); |
| - return; |
| + break; |
| } |
| +} |
| +void LoginUtilsImpl::UserProfileInitialized(Profile* user_profile) { |
| BootTimesLoader* btl = BootTimesLoader::Get(); |
| btl->AddLoginTimeMarker("UserProfileGotten", false); |