| Index: chrome/browser/ui/ash/lock_screen_client.cc
|
| diff --git a/chrome/browser/ui/ash/lock_screen_client.cc b/chrome/browser/ui/ash/lock_screen_client.cc
|
| index 802366a54de0a058d1117cac72a254155cd61a44..e447b586e3499aae2fb8d9fd9a634dae33418d38 100644
|
| --- a/chrome/browser/ui/ash/lock_screen_client.cc
|
| +++ b/chrome/browser/ui/ash/lock_screen_client.cc
|
| @@ -4,8 +4,12 @@
|
|
|
| #include "chrome/browser/ui/ash/lock_screen_client.h"
|
|
|
| +#include <utility>
|
| +
|
| #include "ash/public/interfaces/constants.mojom.h"
|
| #include "chrome/browser/chromeos/login/lock/screen_locker.h"
|
| +#include "chrome/browser/chromeos/login/reauth_stats.h"
|
| +#include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h"
|
| #include "content/public/common/service_manager_connection.h"
|
| #include "services/service_manager/public/cpp/connector.h"
|
|
|
| @@ -43,15 +47,10 @@ void LockScreenClient::AuthenticateUser(const AccountId& account_id,
|
| const std::string& hashed_password,
|
| bool authenticated_by_pin,
|
| AuthenticateUserCallback callback) {
|
| - // TODO(xiaoyinh): Complete the implementation below.
|
| - // It should be similar as SigninScreenHandler::HandleAuthenticateUser.
|
| - chromeos::UserContext user_context(account_id);
|
| - chromeos::Key key(chromeos::Key::KEY_TYPE_SALTED_SHA256_TOP_HALF,
|
| - std::string(), hashed_password);
|
| - user_context.SetKey(key);
|
| - user_context.SetIsUsingPin(authenticated_by_pin);
|
| - chromeos::ScreenLocker::default_screen_locker()->Authenticate(
|
| - user_context, std::move(callback));
|
| + if (!delegate_)
|
| + return;
|
| + delegate_->HandleAuthenticateUser(account_id, hashed_password,
|
| + authenticated_by_pin, std::move(callback));
|
| }
|
|
|
| void LockScreenClient::ShowLockScreen(
|
| @@ -77,6 +76,32 @@ void LockScreenClient::RecordClickOnLockIcon(const AccountId& account_id) {
|
| delegate_->HandleRecordClickOnLockIcon(account_id);
|
| }
|
|
|
| +void LockScreenClient::FocusPod(const AccountId& account_id) {
|
| + if (!delegate_)
|
| + return;
|
| + delegate_->HandleFocusPod(account_id);
|
| +}
|
| +
|
| +void LockScreenClient::NoPodFocused() {
|
| + if (!delegate_)
|
| + return;
|
| + delegate_->HandleNoPodFocused();
|
| +}
|
| +
|
| +void LockScreenClient::LoadWallpaper(const AccountId& account_id) {
|
| + chromeos::WallpaperManager::Get()->SetUserWallpaperDelayed(account_id);
|
| +}
|
| +
|
| +void LockScreenClient::SignOutUser() {
|
| + chromeos::ScreenLocker::default_screen_locker()->Signout();
|
| +}
|
| +
|
| +void LockScreenClient::MaxIncorrectPasswordAttempts(
|
| + const AccountId& account_id) {
|
| + RecordReauthReason(account_id,
|
| + chromeos::ReauthReason::INCORRECT_PASSWORD_ENTERED);
|
| +}
|
| +
|
| void LockScreenClient::ShowErrorMessage(int32_t login_attempts,
|
| const std::string& error_text,
|
| const std::string& help_link_text,
|
| @@ -110,6 +135,11 @@ void LockScreenClient::LoadUsers(std::unique_ptr<base::ListValue> users_list,
|
| lock_screen_->LoadUsers(std::move(users_list), show_guest);
|
| }
|
|
|
| +void LockScreenClient::SetPinEnabledForUser(const AccountId& account_id,
|
| + bool is_enabled) {
|
| + lock_screen_->SetPinEnabledForUser(account_id, is_enabled);
|
| +}
|
| +
|
| void LockScreenClient::SetDelegate(Delegate* delegate) {
|
| delegate_ = delegate;
|
| }
|
|
|