| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/ui/webui/chromeos/login/signin_screen_handler.h" | 5 #include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 876 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 887 // Forces a reload for Gaia screen on hiding error message. | 887 // Forces a reload for Gaia screen on hiding error message. |
| 888 if (IsGaiaVisible() || IsGaiaHiddenByError()) | 888 if (IsGaiaVisible() || IsGaiaHiddenByError()) |
| 889 ReloadGaia(reason == NetworkError::ERROR_REASON_NETWORK_STATE_CHANGED); | 889 ReloadGaia(reason == NetworkError::ERROR_REASON_NETWORK_STATE_CHANGED); |
| 890 } | 890 } |
| 891 | 891 |
| 892 void SigninScreenHandler::ReloadGaia(bool force_reload) { | 892 void SigninScreenHandler::ReloadGaia(bool force_reload) { |
| 893 gaia_screen_handler_->ReloadGaia(force_reload); | 893 gaia_screen_handler_->ReloadGaia(force_reload); |
| 894 } | 894 } |
| 895 | 895 |
| 896 void SigninScreenHandler::Initialize() { | 896 void SigninScreenHandler::Initialize() { |
| 897 // Preload PIN keyboard if any of the users can authenticate via PIN. |
| 898 if (user_manager::UserManager::IsInitialized()) { |
| 899 for (user_manager::User* user : |
| 900 user_manager::UserManager::Get()->GetLoggedInUsers()) { |
| 901 |
| 902 chromeos::PinStorage* pin_storage = |
| 903 chromeos::PinStorageFactory::GetForUser(user); |
| 904 if (pin_storage && pin_storage->IsPinAuthenticationAvailable()) { |
| 905 CallJS("cr.ui.Oobe.preloadPinKeyboard"); |
| 906 break; |
| 907 } |
| 908 } |
| 909 } |
| 910 |
| 911 // |delegate_| is null when we are preloading the lock screen. |
| 897 if (delegate_ && show_on_init_) { | 912 if (delegate_ && show_on_init_) { |
| 898 show_on_init_ = false; | 913 show_on_init_ = false; |
| 899 ShowImpl(); | 914 ShowImpl(); |
| 900 } | 915 } |
| 901 } | 916 } |
| 902 | 917 |
| 903 gfx::NativeWindow SigninScreenHandler::GetNativeWindow() { | 918 gfx::NativeWindow SigninScreenHandler::GetNativeWindow() { |
| 904 if (native_window_delegate_) | 919 if (native_window_delegate_) |
| 905 return native_window_delegate_->GetNativeWindow(); | 920 return native_window_delegate_->GetNativeWindow(); |
| 906 return nullptr; | 921 return nullptr; |
| (...skipping 621 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1528 } | 1543 } |
| 1529 | 1544 |
| 1530 void SigninScreenHandler::OnFeedbackFinished() { | 1545 void SigninScreenHandler::OnFeedbackFinished() { |
| 1531 CallJS("login.UnrecoverableCryptohomeErrorScreen.resumeAfterFeedbackUI"); | 1546 CallJS("login.UnrecoverableCryptohomeErrorScreen.resumeAfterFeedbackUI"); |
| 1532 | 1547 |
| 1533 // Recreate user's cryptohome after the feedback is attempted. | 1548 // Recreate user's cryptohome after the feedback is attempted. |
| 1534 HandleResyncUserData(); | 1549 HandleResyncUserData(); |
| 1535 } | 1550 } |
| 1536 | 1551 |
| 1537 } // namespace chromeos | 1552 } // namespace chromeos |
| OLD | NEW |