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/chromeos/login/login_utils.cc

Issue 12225046: [cros] Set profile pref for locally managed users (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nit Created 7 years, 10 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 | « no previous file | chrome/browser/profiles/profile_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..8f53d429995f52d3ed0bfd79a645c2dad1d7caec 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
+ // early profile initialization that needs to happen before
+ // ProfileManager::DoFinalInit() gets called is 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,19 @@ void LoginUtilsImpl::OnProfileCreated(
switch (status) {
case Profile::CREATE_STATUS_INITIALIZED:
+ UserProfileInitialized(user_profile);
break;
- case Profile::CREATE_STATUS_CREATED: {
+ case Profile::CREATE_STATUS_CREATED:
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);
« no previous file with comments | « no previous file | chrome/browser/profiles/profile_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698