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

Unified Diff: chrome/browser/chromeos/login/existing_user_controller.cc

Issue 1138883003: Disable token handle fetching on some devices (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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
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() {
Nikita (slow) 2015/05/13 08:34:52 I suggest having static function in TokenHandleUti
+ 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

Powered by Google App Engine
This is Rietveld 408576698