Commit 48d2ad51 authored by antrim's avatar antrim Committed by Commit bot

Disable token handle fetching on some devices

BUG=484690
R=nkostylev@chromium.org

Review URL: https://codereview.chromium.org/1138883003

Cr-Commit-Position: refs/heads/master@{#329828}
parent 39722bb6
......@@ -1236,7 +1236,7 @@ void ExistingUserController::OnOAuth2TokensFetched(
OnAuthFailure(AuthFailure(AuthFailure::FAILED_TO_INITIALIZE_TOKEN));
return;
}
if (StartupUtils::IsWebviewSigninEnabled()) {
if (StartupUtils::IsWebviewSigninEnabled() && TokenHandlesEnabled()) {
if (!token_handle_util_.get()) {
token_handle_util_.reset(
new TokenHandleUtil(user_manager::UserManager::Get()));
......@@ -1260,4 +1260,14 @@ void ExistingUserController::OnTokenHandleObtained(
}
}
bool ExistingUserController::TokenHandlesEnabled() {
bool ephemeral_users_enabled = false;
bool show_names_on_signin = true;
cros_settings_->GetBoolean(kAccountsPrefEphemeralUsersEnabled,
&ephemeral_users_enabled);
cros_settings_->GetBoolean(kAccountsPrefShowUserNamesOnSignIn,
&show_names_on_signin);
return show_names_on_signin && !ephemeral_users_enabled;
}
} // namespace chromeos
......@@ -247,6 +247,9 @@ class ExistingUserController : public LoginDisplay::Delegate,
void OnTokenHandleObtained(const user_manager::UserID& id,
TokenHandleUtil::TokenHandleStatus status);
// Returns |true| if token handles should be used on this device.
bool TokenHandlesEnabled();
// Public session auto-login timer.
scoped_ptr<base::OneShotTimer<ExistingUserController> > auto_login_timer_;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment