Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/chromeos/login/lock/screen_locker.h" | 5 #include "chrome/browser/chromeos/login/lock/screen_locker.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "ash/login/ui/lock_screen.h" | 10 #include "ash/login/ui/lock_screen.h" |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 35 #include "chrome/browser/chromeos/login/quick_unlock/quick_unlock_storage.h" | 35 #include "chrome/browser/chromeos/login/quick_unlock/quick_unlock_storage.h" |
| 36 #include "chrome/browser/chromeos/login/session/user_session_manager.h" | 36 #include "chrome/browser/chromeos/login/session/user_session_manager.h" |
| 37 #include "chrome/browser/chromeos/login/supervised/supervised_user_authenticatio n.h" | 37 #include "chrome/browser/chromeos/login/supervised/supervised_user_authenticatio n.h" |
| 38 #include "chrome/browser/chromeos/login/ui/user_adding_screen.h" | 38 #include "chrome/browser/chromeos/login/ui/user_adding_screen.h" |
| 39 #include "chrome/browser/chromeos/login/users/chrome_user_manager.h" | 39 #include "chrome/browser/chromeos/login/users/chrome_user_manager.h" |
| 40 #include "chrome/browser/chromeos/login/users/supervised_user_manager.h" | 40 #include "chrome/browser/chromeos/login/users/supervised_user_manager.h" |
| 41 #include "chrome/browser/lifetime/application_lifetime.h" | 41 #include "chrome/browser/lifetime/application_lifetime.h" |
| 42 #include "chrome/browser/signin/easy_unlock_service.h" | 42 #include "chrome/browser/signin/easy_unlock_service.h" |
| 43 #include "chrome/browser/signin/signin_manager_factory.h" | 43 #include "chrome/browser/signin/signin_manager_factory.h" |
| 44 #include "chrome/browser/ui/ash/ash_util.h" | 44 #include "chrome/browser/ui/ash/ash_util.h" |
| 45 #include "chrome/browser/ui/ash/lock_screen_client_chromeos.h" | |
| 45 #include "chrome/browser/ui/ash/session_controller_client.h" | 46 #include "chrome/browser/ui/ash/session_controller_client.h" |
| 46 #include "chrome/browser/ui/webui/chromeos/login/screenlock_icon_provider.h" | 47 #include "chrome/browser/ui/webui/chromeos/login/screenlock_icon_provider.h" |
| 47 #include "chrome/browser/ui/webui/chromeos/login/screenlock_icon_source.h" | 48 #include "chrome/browser/ui/webui/chromeos/login/screenlock_icon_source.h" |
| 48 #include "chrome/common/chrome_switches.h" | 49 #include "chrome/common/chrome_switches.h" |
| 49 #include "chrome/grit/browser_resources.h" | 50 #include "chrome/grit/browser_resources.h" |
| 50 #include "chrome/grit/generated_resources.h" | 51 #include "chrome/grit/generated_resources.h" |
| 51 #include "chromeos/audio/chromeos_sounds.h" | 52 #include "chromeos/audio/chromeos_sounds.h" |
| 52 #include "chromeos/chromeos_switches.h" | 53 #include "chromeos/chromeos_switches.h" |
| 53 #include "chromeos/dbus/biod/constants.pb.h" | 54 #include "chromeos/dbus/biod/constants.pb.h" |
| 54 #include "chromeos/dbus/dbus_thread_manager.h" | 55 #include "chromeos/dbus/dbus_thread_manager.h" |
| (...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 285 unlock_attempt_type_, UnlockType::AUTH_COUNT); | 286 unlock_attempt_type_, UnlockType::AUTH_COUNT); |
| 286 | 287 |
| 287 EnableInput(); | 288 EnableInput(); |
| 288 // Don't enable signout button here as we're showing | 289 // Don't enable signout button here as we're showing |
| 289 // MessageBubble. | 290 // MessageBubble. |
| 290 | 291 |
| 291 delegate_->ShowErrorMessage(incorrect_passwords_count_++ | 292 delegate_->ShowErrorMessage(incorrect_passwords_count_++ |
| 292 ? IDS_LOGIN_ERROR_AUTHENTICATING_2ND_TIME | 293 ? IDS_LOGIN_ERROR_AUTHENTICATING_2ND_TIME |
| 293 : IDS_LOGIN_ERROR_AUTHENTICATING, | 294 : IDS_LOGIN_ERROR_AUTHENTICATING, |
| 294 HelpAppLauncher::HELP_CANT_ACCESS_ACCOUNT); | 295 HelpAppLauncher::HELP_CANT_ACCESS_ACCOUNT); |
| 296 // TODO(xiaoyinh@): This call should replace delegate_->ShowErrorMessage | |
| 297 // above when the implementation is complete. | |
| 298 LockScreenClientChromeOS::Get()->ShowErrorMessage(); | |
|
jdufault
2017/05/11 01:14:51
Can you make another delegate_ implementation that
xiaoyinh(OOO Sep 11-29)
2017/05/11 20:29:52
How about reuse StubDelegate in the above?
jdufault
2017/05/11 20:34:06
sg, please rename it to MojoDelegate or similar.
| |
| 295 | 299 |
| 296 if (auth_status_consumer_) | 300 if (auth_status_consumer_) |
| 297 auth_status_consumer_->OnAuthFailure(error); | 301 auth_status_consumer_->OnAuthFailure(error); |
| 298 } | 302 } |
| 299 | 303 |
| 300 void ScreenLocker::OnAuthSuccess(const UserContext& user_context) { | 304 void ScreenLocker::OnAuthSuccess(const UserContext& user_context) { |
| 301 incorrect_passwords_count_ = 0; | 305 incorrect_passwords_count_ = 0; |
| 302 if (authentication_start_time_.is_null()) { | 306 if (authentication_start_time_.is_null()) { |
| 303 if (user_context.GetAccountId().is_valid()) | 307 if (user_context.GetAccountId().is_valid()) |
| 304 LOG(ERROR) << "Start time is not set at authentication success"; | 308 LOG(ERROR) << "Start time is not set at authentication success"; |
| (...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 719 } | 723 } |
| 720 } | 724 } |
| 721 | 725 |
| 722 if (auth_status_consumer_) { | 726 if (auth_status_consumer_) { |
| 723 AuthFailure failure(AuthFailure::UNLOCK_FAILED); | 727 AuthFailure failure(AuthFailure::UNLOCK_FAILED); |
| 724 auth_status_consumer_->OnAuthFailure(failure); | 728 auth_status_consumer_->OnAuthFailure(failure); |
| 725 } | 729 } |
| 726 } | 730 } |
| 727 | 731 |
| 728 } // namespace chromeos | 732 } // namespace chromeos |
| OLD | NEW |