Chromium Code Reviews| 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 d8ae0771c50e453cb9f83d191c7b4b1e5ae00494..1f6e301c4c70936fbcbaedc4c92fb5467a5666b5 100644 |
| --- a/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc |
| +++ b/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc |
| @@ -721,6 +721,14 @@ void SigninScreenHandler::ShowImpl() { |
| params.SetBoolean("disableAddUser", AllWhitelistedUsersPresent()); |
| UpdateUIState(UI_STATE_ACCOUNT_PICKER, ¶ms); |
| } |
| + |
| + // Enable pin for any users who can use it. |
| + if (user_manager::UserManager::IsInitialized()) { |
| + for (user_manager::User* user : |
| + user_manager::UserManager::Get()->GetLoggedInUsers()) { |
|
xiyuan
2017/04/03 21:21:43
nit: GetLoggedInUsers() -> GetUnlockUsers() ?
The
jdufault
2017/04/10 21:06:31
Done.
|
| + UpdatePinKeyboardState(user->GetAccountId()); |
| + } |
| + } |
| } |
| void SigninScreenHandler::UpdateUIState(UIState ui_state, |
| @@ -1007,12 +1015,15 @@ void SigninScreenHandler::RefocusCurrentPod() { |
| core_oobe_view_->RefocusCurrentPod(); |
| } |
| -void SigninScreenHandler::HidePinKeyboardIfNeeded(const AccountId& account_id) { |
| +void SigninScreenHandler::UpdatePinKeyboardState(const AccountId& account_id) { |
| chromeos::quick_unlock::QuickUnlockStorage* quick_unlock_storage = |
| chromeos::quick_unlock::QuickUnlockFactory::GetForAccountId(account_id); |
| - if (quick_unlock_storage && |
| - !quick_unlock_storage->IsPinAuthenticationAvailable()) |
| - CallJS("login.AccountPickerScreen.disablePinKeyboardForUser", account_id); |
| + if (!quick_unlock_storage) |
| + return; |
| + |
| + bool is_enabled = quick_unlock_storage->IsPinAuthenticationAvailable(); |
| + CallJS("login.AccountPickerScreen.setPinEnabledForUser", account_id, |
| + is_enabled); |
| } |
| void SigninScreenHandler::OnUserRemoved(const AccountId& account_id, |
| @@ -1139,7 +1150,7 @@ void SigninScreenHandler::Observe(int type, |
| void SigninScreenHandler::SuspendDone(const base::TimeDelta& sleep_duration) { |
| for (user_manager::User* user : |
| user_manager::UserManager::Get()->GetUnlockUsers()) { |
| - HidePinKeyboardIfNeeded(user->GetAccountId()); |
| + UpdatePinKeyboardState(user->GetAccountId()); |
| } |
| } |
| @@ -1182,7 +1193,7 @@ void SigninScreenHandler::HandleAuthenticateUser(const AccountId& account_id, |
| user_context.SetUserType(user_manager::USER_TYPE_ACTIVE_DIRECTORY); |
| delegate_->Login(user_context, SigninSpecifics()); |
| - HidePinKeyboardIfNeeded(account_id); |
| + UpdatePinKeyboardState(account_id); |
| } |
| void SigninScreenHandler::HandleLaunchIncognito() { |