Index: chrome/browser/chromeos/login/existing_user_controller.cc |
diff --git a/chrome/browser/chromeos/login/existing_user_controller.cc b/chrome/browser/chromeos/login/existing_user_controller.cc |
index 54a6820cbac13b39200f5b28d2bd910d0a33ada9..9a0cc9ac40ce312ce0f91cf4d4e1fd451ac5d440 100644 |
--- a/chrome/browser/chromeos/login/existing_user_controller.cc |
+++ b/chrome/browser/chromeos/login/existing_user_controller.cc |
@@ -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 |