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

Unified Diff: chrome/browser/chromeos/policy/user_policy_manager_factory_chromeos.cc

Issue 2711113003: Track whether a given user session has completed initialization, and use (Closed)
Patch Set: Only expose known_user::RemovePrefsForTesting() for tests Created 3 years, 9 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/policy/user_policy_manager_factory_chromeos.cc
diff --git a/chrome/browser/chromeos/policy/user_policy_manager_factory_chromeos.cc b/chrome/browser/chromeos/policy/user_policy_manager_factory_chromeos.cc
index 6a27aaf1f54acab6c9fee9a68daf619662b114a6..850b9b0234ea459f42bce7ba8968c7622a19cee8 100644
--- a/chrome/browser/chromeos/policy/user_policy_manager_factory_chromeos.cc
+++ b/chrome/browser/chromeos/policy/user_policy_manager_factory_chromeos.cc
@@ -199,17 +199,14 @@ UserPolicyManagerFactoryChromeOS::CreateManagerForProfile(
const user_manager::UserManager* const user_manager =
user_manager::UserManager::Get();
- // We want to block for policy in a few situations: if the user is new, or if
- // we are forcing an online signin. An online signin will be forced if there
- // has been a credential error, or if the initial session creation was not
- // completed (the oauth_token_status is not set to valid by OAuth2LoginManager
- // until profile creation/session restore is complete).
+ // We want to block for policy if the session has never been initialized
+ // (generally true if the user is new, or if there was a crash before the
+ // profile finished initializing). There is code in UserSelectionScreen to
+ // force an online signin for uninitialized sessions to help ensure we are
+ // able to load policy.
const bool block_forever_for_policy =
!user_manager->IsLoggedInAsStub() &&
- (user_manager->IsCurrentUserNew() ||
- user_manager->GetActiveUser()->force_online_signin() ||
- user_manager->GetActiveUser()->oauth_token_status() !=
- user_manager::User::OAUTH2_TOKEN_STATUS_VALID);
+ !user_manager->GetActiveUser()->profile_ever_initialized();
const bool wait_for_policy_fetch =
block_forever_for_policy || !is_browser_restart;
« no previous file with comments | « chrome/browser/chromeos/login/users/user_manager_unittest.cc ('k') | chrome/browser/profiles/profile_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698