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

Unified Diff: chrome/browser/chromeos/login/login_utils.cc

Issue 14139003: Chrome OS multi-profiles backend and UI. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: move IsMultiProfilesEnabled() out of cros Created 7 years, 8 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 | « ash/test/test_shell_delegate.cc ('k') | chrome/browser/chromeos/login/mock_user_manager.h » ('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 2feb04c21c0f9c7234a8bcff381e621c018d0756..e811e1034ebaecfe2c966778451bfc149fc748fb 100644
--- a/chrome/browser/chromeos/login/login_utils.cc
+++ b/chrome/browser/chromeos/login/login_utils.cc
@@ -353,29 +353,37 @@ void LoginUtilsImpl::PrepareProfile(
delegate_ = delegate;
InitSessionRestoreStrategy();
- policy::BrowserPolicyConnector* connector =
- g_browser_process->browser_policy_connector();
-
- // If this is an enterprise device and the user belongs to the enterprise
- // domain, then wait for a policy fetch before logging the user in. This
- // will delay Profile creation until the policy is fetched, so that features
- // controlled by policy (e.g. Sync, Startup tabs) only start after the
- // PrefService has the right values.
- // Profile creation is also resumed if the fetch attempt fails.
- bool wait_for_policy_fetch =
- using_oauth_ &&
- authenticator_.get() &&
- (connector->GetUserAffiliation(user_context_.username) ==
- policy::USER_AFFILIATION_MANAGED);
-
- // Initialize user policy before the profile is created so the profile
- // initialization code sees the cached policy settings.
- connector->InitializeUserPolicy(user_context_.username,
- user_manager->IsLoggedInAsPublicAccount(),
- wait_for_policy_fetch);
+ bool wait_for_policy_fetch = false;
+
+ // TODO(nkostylev): Figure out implementation for multiple-profiles.
+ // http://crbug.com/230349
+ bool is_primary_user = UserManager::Get()->GetLoggedInUsers().size() == 1;
+ if (is_primary_user) {
+ policy::BrowserPolicyConnector* connector =
+ g_browser_process->browser_policy_connector();
+
+ // If this is an enterprise device and the user belongs to the enterprise
+ // domain, then wait for a policy fetch before logging the user in. This
+ // will delay Profile creation until the policy is fetched, so that features
+ // controlled by policy (e.g. Sync, Startup tabs) only start after the
+ // PrefService has the right values.
+ // Profile creation is also resumed if the fetch attempt fails.
+ wait_for_policy_fetch =
+ using_oauth_ &&
+ authenticator_.get() &&
+ (connector->GetUserAffiliation(user_context_.username) ==
+ policy::USER_AFFILIATION_MANAGED);
+
+ // Initialize user policy before the profile is created so the profile
+ // initialization code sees the cached policy settings.
+ connector->InitializeUserPolicy(user_context_.username,
+ user_manager->IsLoggedInAsPublicAccount(),
+ wait_for_policy_fetch);
+ }
// The default profile will have been changed because the ProfileManager
- // will process the notification that the UserManager sends out.
+ // will process the notification that the UserManager sends out so
+ // username_hash has been already propogated to ProfileManager.
ProfileManager::CreateDefaultProfileAsync(
base::Bind(&LoginUtilsImpl::OnProfileCreated, AsWeakPtr()));
« no previous file with comments | « ash/test/test_shell_delegate.cc ('k') | chrome/browser/chromeos/login/mock_user_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698