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

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: initialize pref on Profile::CREATE_STATUS_CREATED cb 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
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 c4094bbf86e3e7e37732fb7258543fc63165a074..bc97da02a4c1fb46042133fc46126f59846f63ab 100644
--- a/chrome/browser/chromeos/login/login_utils.cc
+++ b/chrome/browser/chromeos/login/login_utils.cc
@@ -427,7 +427,8 @@ void LoginUtilsImpl::PrepareProfile(
// The default profile will have been changed because the ProfileManager
// will process the notification that the UserManager sends out.
ProfileManager::CreateDefaultProfileAsync(
- base::Bind(&LoginUtilsImpl::OnProfileCreated, AsWeakPtr()));
+ base::Bind(&LoginUtilsImpl::OnProfileCreated, AsWeakPtr()),
+ UserManager::Get()->IsLoggedInAsLocallyManagedUser());
if (wait_for_policy_fetch) {
// Profile creation will block until user policy is fetched, which
@@ -455,7 +456,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).
@@ -503,6 +506,7 @@ void LoginUtilsImpl::OnProfileCreated(
return;
}
+ // Processing Profile::CREATE_STATUS_INITIALIZED notification.
Dmitry Polukhin 2013/02/08 17:26:53 Could you please remove this comment and make it c
Nikita (slow) 2013/02/11 09:42:12 Done.
BootTimesLoader* btl = BootTimesLoader::Get();
btl->AddLoginTimeMarker("UserProfileGotten", false);
« no previous file with comments | « no previous file | chrome/browser/profiles/profile_manager.h » ('j') | chrome/browser/profiles/profile_manager.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698