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

Unified Diff: chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc

Issue 143873012: Add local state flag to force online login for a user (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix compilation. Created 6 years, 11 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 | « chrome/browser/chromeos/login/user_manager_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc
diff --git a/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc b/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc
index bee7eb9489d02dccac911bc4597fe9a3cd7d56ff..a2ee971997055708135ec50371d0e6948c985167 100644
--- a/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc
+++ b/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc
@@ -1175,18 +1175,23 @@ void SigninScreenHandler::FillUserDictionary(User* user,
bool is_owner,
base::DictionaryValue* user_dict) {
const std::string& email = user->email();
- bool is_public_account =
+ const bool is_public_account =
user->GetType() == User::USER_TYPE_PUBLIC_ACCOUNT;
- bool is_locally_managed_user =
+ const bool is_locally_managed_user =
user->GetType() == User::USER_TYPE_LOCALLY_MANAGED;
const User::OAuthTokenStatus token_status = user->oauth_token_status();
- // Allow offline sign-in if the oauth token is valid. For supervised users,
- // allow offline sign-in if the token status is unknown as well. The token
- // will be invalidated inside the session in case it has been revoked.
- const bool allow_offline_signin =
- token_status == User::OAUTH2_TOKEN_STATUS_VALID ||
- (is_locally_managed_user &&
+ // Force online sign-in if at least one of the following is true:
+ // * The flag to force online sign-in is set for the user.
+ // * The user's oauth token is invalid.
+ // * The user's oauth token status is unknown. This condition does not apply
+ // to supervised users: A supervised user whose oauth token status is
+ // unknown may still log in offline. The token will be invalidated inside
+ // the session in case it has been revoked.
+ const bool force_online_signin =
+ user->force_online_signin() ||
+ (token_status == User::OAUTH2_TOKEN_STATUS_INVALID) ||
+ (!is_locally_managed_user &&
token_status == User::OAUTH_TOKEN_STATUS_UNKNOWN);
user_dict->SetString(kKeyUsername, email);
@@ -1194,7 +1199,7 @@ void SigninScreenHandler::FillUserDictionary(User* user,
user_dict->SetString(kKeyDisplayName, user->GetDisplayName());
user_dict->SetBoolean(kKeyPublicAccount, is_public_account);
user_dict->SetBoolean(kKeyLocallyManagedUser, is_locally_managed_user);
- user_dict->SetInteger(kKeyForceOnlineSignin, !allow_offline_signin);
+ user_dict->SetInteger(kKeyForceOnlineSignin, force_online_signin);
user_dict->SetBoolean(kKeySignedIn, user->is_logged_in());
user_dict->SetBoolean(kKeyIsOwner, is_owner);
« no previous file with comments | « chrome/browser/chromeos/login/user_manager_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698