| 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 b5aea33301a2e2f0cdb57e01c4af0f00ed6970e5..1735db9f3b5151523010a8f2d0daf75c80d5a7d4 100644
|
| --- a/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc
|
| +++ b/chrome/browser/ui/webui/chromeos/login/signin_screen_handler.cc
|
| @@ -33,6 +33,8 @@
|
| #include "chrome/browser/chromeos/login/error_screens_histogram_helper.h"
|
| #include "chrome/browser/chromeos/login/hwid_checker.h"
|
| #include "chrome/browser/chromeos/login/lock/screen_locker.h"
|
| +#include "chrome/browser/chromeos/login/quick_unlock/pin_storage.h"
|
| +#include "chrome/browser/chromeos/login/quick_unlock/pin_storage_factory.h"
|
| #include "chrome/browser/chromeos/login/reauth_stats.h"
|
| #include "chrome/browser/chromeos/login/screens/core_oobe_actor.h"
|
| #include "chrome/browser/chromeos/login/screens/network_error.h"
|
| @@ -268,6 +270,9 @@ SigninScreenHandler::SigninScreenHandler(
|
| chrome::NOTIFICATION_AUTH_CANCELLED,
|
| content::NotificationService::AllSources());
|
|
|
| + chromeos::DBusThreadManager::Get()->GetPowerManagerClient()->AddObserver(
|
| + this);
|
| +
|
| chromeos::input_method::ImeKeyboard* keyboard =
|
| chromeos::input_method::InputMethodManager::Get()->GetImeKeyboard();
|
| if (keyboard)
|
| @@ -285,6 +290,8 @@ SigninScreenHandler::~SigninScreenHandler() {
|
| OobeUI* oobe_ui = GetOobeUI();
|
| if (oobe_ui && oobe_ui_observer_added_)
|
| oobe_ui->RemoveObserver(this);
|
| + chromeos::DBusThreadManager::Get()->GetPowerManagerClient()->RemoveObserver(
|
| + this);
|
| chromeos::input_method::ImeKeyboard* keyboard =
|
| chromeos::input_method::InputMethodManager::Get()->GetImeKeyboard();
|
| if (keyboard)
|
| @@ -469,8 +476,6 @@ void SigninScreenHandler::DeclareLocalizedValues(
|
|
|
| void SigninScreenHandler::RegisterMessages() {
|
| AddCallback("authenticateUser", &SigninScreenHandler::HandleAuthenticateUser);
|
| - AddCallback("authenticateUserWithPin",
|
| - &SigninScreenHandler::HandleAuthenticateUserWithPin);
|
| AddCallback("launchIncognito", &SigninScreenHandler::HandleLaunchIncognito);
|
| AddCallback("showSupervisedUserCreationScreen",
|
| &SigninScreenHandler::HandleShowSupervisedUserCreationScreen);
|
| @@ -872,6 +877,13 @@ void SigninScreenHandler::RefocusCurrentPod() {
|
| core_oobe_actor_->RefocusCurrentPod();
|
| }
|
|
|
| +void SigninScreenHandler::HidePinKeyboardIfNeeded(const AccountId& account_id) {
|
| + chromeos::PinStorage* pin_storage =
|
| + chromeos::PinStorageFactory::GetForAccountId(account_id);
|
| + if (pin_storage && !pin_storage->IsPinAuthenticationAvailable())
|
| + CallJS("login.AccountPickerScreen.disablePinKeyboardForUser", account_id);
|
| +}
|
| +
|
| void SigninScreenHandler::OnUserRemoved(const AccountId& account_id,
|
| bool last_user_removed) {
|
| CallJS("login.AccountPickerScreen.removeUser", account_id);
|
| @@ -978,6 +990,13 @@ 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());
|
| + }
|
| +}
|
| +
|
| void SigninScreenHandler::OnMaximizeModeStarted() {
|
| CallJS("login.AccountPickerScreen.setTouchViewState", true);
|
| }
|
| @@ -1009,17 +1028,8 @@ void SigninScreenHandler::HandleAuthenticateUser(const AccountId& account_id,
|
| UserContext user_context(account_id);
|
| user_context.SetKey(Key(password));
|
| delegate_->Login(user_context, SigninSpecifics());
|
| -}
|
| -
|
| -void SigninScreenHandler::HandleAuthenticateUserWithPin(
|
| - const AccountId& account_id, const std::string& password) {
|
| - if (!delegate_)
|
| - return;
|
| - DCHECK_EQ(account_id.GetUserEmail(),
|
| - gaia::SanitizeEmail(account_id.GetUserEmail()));
|
|
|
| - // TODO(jdufault): Implement this.
|
| - NOTIMPLEMENTED();
|
| + HidePinKeyboardIfNeeded(account_id);
|
| }
|
|
|
| void SigninScreenHandler::HandleLaunchIncognito() {
|
|
|