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 d42c00aa39c36764703af8df7340920b7cb08241..736b8e358c16216f04c713c9e9132c30da582e93 100644 |
--- a/chrome/browser/ui/ash/lock_screen_client.cc |
+++ b/chrome/browser/ui/ash/lock_screen_client.cc |
@@ -6,6 +6,8 @@ |
#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" |
@@ -42,14 +44,10 @@ LockScreenClient* LockScreenClient::Get() { |
void LockScreenClient::AuthenticateUser(const AccountId& account_id, |
const std::string& hashed_password, |
bool authenticated_by_pin) { |
- // 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); |
+ if (!delegate_) |
+ return; |
+ delegate_->HandleAuthenticateUser(account_id, hashed_password, |
+ authenticated_by_pin); |
} |
void LockScreenClient::AttemptUnlock(const AccountId& account_id) { |
@@ -70,6 +68,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, |
@@ -103,6 +127,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; |
} |