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

Side by Side Diff: chrome/browser/chromeos/login/screens/user_selection_screen.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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/chromeos/login/users/fake_chrome_user_manager.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/chromeos/login/screens/user_selection_screen.h" 5 #include "chrome/browser/chromeos/login/screens/user_selection_screen.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <utility> 9 #include <utility>
10 10
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 270
271 if (user->GetType() == user_manager::USER_TYPE_ACTIVE_DIRECTORY) { 271 if (user->GetType() == user_manager::USER_TYPE_ACTIVE_DIRECTORY) {
272 return true; 272 return true;
273 } 273 }
274 274
275 // At this point the reason for invalid token should be already set. If not, 275 // At this point the reason for invalid token should be already set. If not,
276 // this might be a leftover from an old version. 276 // this might be a leftover from an old version.
277 if (token_status == user_manager::User::OAUTH2_TOKEN_STATUS_INVALID) 277 if (token_status == user_manager::User::OAUTH2_TOKEN_STATUS_INVALID)
278 RecordReauthReason(user->GetAccountId(), ReauthReason::OTHER); 278 RecordReauthReason(user->GetAccountId(), ReauthReason::OTHER);
279 279
280 return user->force_online_signin() || 280 // We need to force an online signin if the user is marked as requiring it,
281 // or if the user's session never completed initialization (still need to
282 // check for policy/management state) or if there's an invalid OAUTH token
283 // that needs to be refreshed.
284 return user->force_online_signin() || !user->profile_ever_initialized() ||
281 (token_status == user_manager::User::OAUTH2_TOKEN_STATUS_INVALID) || 285 (token_status == user_manager::User::OAUTH2_TOKEN_STATUS_INVALID) ||
282 (token_status == user_manager::User::OAUTH_TOKEN_STATUS_UNKNOWN); 286 (token_status == user_manager::User::OAUTH_TOKEN_STATUS_UNKNOWN);
283 } 287 }
284 288
285 void UserSelectionScreen::SetHandler(LoginDisplayWebUIHandler* handler) { 289 void UserSelectionScreen::SetHandler(LoginDisplayWebUIHandler* handler) {
286 handler_ = handler; 290 handler_ = handler;
287 291
288 if (handler_) { 292 if (handler_) {
289 // Forcibly refresh all of the user images, as the |handler_| instance may 293 // Forcibly refresh all of the user images, as the |handler_| instance may
290 // have been reused. 294 // have been reused.
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
594 // The user profile should exist if and only if this is the lock screen. 598 // The user profile should exist if and only if this is the lock screen.
595 DCHECK_EQ(!!profile, GetScreenType() == LOCK_SCREEN); 599 DCHECK_EQ(!!profile, GetScreenType() == LOCK_SCREEN);
596 600
597 if (!profile) 601 if (!profile)
598 profile = profile_helper->GetSigninProfile(); 602 profile = profile_helper->GetSigninProfile();
599 603
600 return EasyUnlockService::Get(profile); 604 return EasyUnlockService::Get(profile);
601 } 605 }
602 606
603 } // namespace chromeos 607 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/login/users/fake_chrome_user_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698