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

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: Added tests. Created 3 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 unified diff | Download patch
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 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
253 253
254 if (user->GetType() == user_manager::USER_TYPE_ACTIVE_DIRECTORY) { 254 if (user->GetType() == user_manager::USER_TYPE_ACTIVE_DIRECTORY) {
255 return true; 255 return true;
256 } 256 }
257 257
258 // At this point the reason for invalid token should be already set. If not, 258 // At this point the reason for invalid token should be already set. If not,
259 // this might be a leftover from an old version. 259 // this might be a leftover from an old version.
260 if (token_status == user_manager::User::OAUTH2_TOKEN_STATUS_INVALID) 260 if (token_status == user_manager::User::OAUTH2_TOKEN_STATUS_INVALID)
261 RecordReauthReason(user->GetAccountId(), ReauthReason::OTHER); 261 RecordReauthReason(user->GetAccountId(), ReauthReason::OTHER);
262 262
263 return user->force_online_signin() || 263 // We need to force an online signin if the user is marked as requiring it,
264 // or if the user's session never completed initialization (still need to
265 // check for policy/management state) or if there's an invalid OAUTH token
266 // that needs to be refreshed.
267 return user->force_online_signin() || !user->session_initialized() ||
264 (token_status == user_manager::User::OAUTH2_TOKEN_STATUS_INVALID) || 268 (token_status == user_manager::User::OAUTH2_TOKEN_STATUS_INVALID) ||
265 (token_status == user_manager::User::OAUTH_TOKEN_STATUS_UNKNOWN); 269 (token_status == user_manager::User::OAUTH_TOKEN_STATUS_UNKNOWN);
266 } 270 }
267 271
268 void UserSelectionScreen::SetHandler(LoginDisplayWebUIHandler* handler) { 272 void UserSelectionScreen::SetHandler(LoginDisplayWebUIHandler* handler) {
269 handler_ = handler; 273 handler_ = handler;
270 274
271 if (handler_) { 275 if (handler_) {
272 // Forcibly refresh all of the user images, as the |handler_| instance may 276 // Forcibly refresh all of the user images, as the |handler_| instance may
273 // have been reused. 277 // have been reused.
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
577 // The user profile should exist if and only if this is the lock screen. 581 // The user profile should exist if and only if this is the lock screen.
578 DCHECK_EQ(!!profile, GetScreenType() == LOCK_SCREEN); 582 DCHECK_EQ(!!profile, GetScreenType() == LOCK_SCREEN);
579 583
580 if (!profile) 584 if (!profile)
581 profile = profile_helper->GetSigninProfile(); 585 profile = profile_helper->GetSigninProfile();
582 586
583 return EasyUnlockService::Get(profile); 587 return EasyUnlockService::Get(profile);
584 } 588 }
585 589
586 } // namespace chromeos 590 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698