| 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 23 matching lines...) Expand all Loading... |
| 34 #include "chrome/browser/browser_process_platform_part_chromeos.h" | 34 #include "chrome/browser/browser_process_platform_part_chromeos.h" |
| 35 #include "chrome/browser/browser_shutdown.h" | 35 #include "chrome/browser/browser_shutdown.h" |
| 36 #include "chrome/browser/chrome_notification_types.h" | 36 #include "chrome/browser/chrome_notification_types.h" |
| 37 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" | 37 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" |
| 38 #include "chrome/browser/chromeos/input_method/input_method_util.h" | 38 #include "chrome/browser/chromeos/input_method/input_method_util.h" |
| 39 #include "chrome/browser/chromeos/language_preferences.h" | 39 #include "chrome/browser/chromeos/language_preferences.h" |
| 40 #include "chrome/browser/chromeos/login/error_screens_histogram_helper.h" | 40 #include "chrome/browser/chromeos/login/error_screens_histogram_helper.h" |
| 41 #include "chrome/browser/chromeos/login/hwid_checker.h" | 41 #include "chrome/browser/chromeos/login/hwid_checker.h" |
| 42 #include "chrome/browser/chromeos/login/lock/screen_locker.h" | 42 #include "chrome/browser/chromeos/login/lock/screen_locker.h" |
| 43 #include "chrome/browser/chromeos/login/lock/webui_screen_locker.h" | 43 #include "chrome/browser/chromeos/login/lock/webui_screen_locker.h" |
| 44 #include "chrome/browser/chromeos/login/quick_unlock/pin_storage.h" | 44 #include "chrome/browser/chromeos/login/quick_unlock/quick_unlock_factory.h" |
| 45 #include "chrome/browser/chromeos/login/quick_unlock/pin_storage_factory.h" | 45 #include "chrome/browser/chromeos/login/quick_unlock/quick_unlock_storage.h" |
| 46 #include "chrome/browser/chromeos/login/reauth_stats.h" | 46 #include "chrome/browser/chromeos/login/reauth_stats.h" |
| 47 #include "chrome/browser/chromeos/login/screens/core_oobe_view.h" | 47 #include "chrome/browser/chromeos/login/screens/core_oobe_view.h" |
| 48 #include "chrome/browser/chromeos/login/screens/network_error.h" | 48 #include "chrome/browser/chromeos/login/screens/network_error.h" |
| 49 #include "chrome/browser/chromeos/login/startup_utils.h" | 49 #include "chrome/browser/chromeos/login/startup_utils.h" |
| 50 #include "chrome/browser/chromeos/login/ui/login_display_host.h" | 50 #include "chrome/browser/chromeos/login/ui/login_display_host.h" |
| 51 #include "chrome/browser/chromeos/login/ui/login_display_host_impl.h" | 51 #include "chrome/browser/chromeos/login/ui/login_display_host_impl.h" |
| 52 #include "chrome/browser/chromeos/login/ui/login_feedback.h" | 52 #include "chrome/browser/chromeos/login/ui/login_feedback.h" |
| 53 #include "chrome/browser/chromeos/login/ui/webui_login_display.h" | 53 #include "chrome/browser/chromeos/login/ui/webui_login_display.h" |
| 54 #include "chrome/browser/chromeos/login/users/multi_profile_user_controller.h" | 54 #include "chrome/browser/chromeos/login/users/multi_profile_user_controller.h" |
| 55 #include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h" | 55 #include "chrome/browser/chromeos/login/users/wallpaper/wallpaper_manager.h" |
| (...skipping 893 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 949 | 949 |
| 950 void SigninScreenHandler::ReloadGaia(bool force_reload) { | 950 void SigninScreenHandler::ReloadGaia(bool force_reload) { |
| 951 gaia_screen_handler_->ReloadGaia(force_reload); | 951 gaia_screen_handler_->ReloadGaia(force_reload); |
| 952 } | 952 } |
| 953 | 953 |
| 954 void SigninScreenHandler::Initialize() { | 954 void SigninScreenHandler::Initialize() { |
| 955 // Preload PIN keyboard if any of the users can authenticate via PIN. | 955 // Preload PIN keyboard if any of the users can authenticate via PIN. |
| 956 if (user_manager::UserManager::IsInitialized()) { | 956 if (user_manager::UserManager::IsInitialized()) { |
| 957 for (user_manager::User* user : | 957 for (user_manager::User* user : |
| 958 user_manager::UserManager::Get()->GetLoggedInUsers()) { | 958 user_manager::UserManager::Get()->GetLoggedInUsers()) { |
| 959 | 959 chromeos::quick_unlock::QuickUnlockStorage* quick_unlock_storage = |
| 960 chromeos::quick_unlock::PinStorage* pin_storage = | 960 chromeos::quick_unlock::QuickUnlockFactory::GetForUser(user); |
| 961 chromeos::quick_unlock::PinStorageFactory::GetForUser(user); | 961 if (quick_unlock_storage && |
| 962 if (pin_storage && pin_storage->IsPinAuthenticationAvailable()) { | 962 quick_unlock_storage->IsPinAuthenticationAvailable()) { |
| 963 CallJS("cr.ui.Oobe.preloadPinKeyboard"); | 963 CallJS("cr.ui.Oobe.preloadPinKeyboard"); |
| 964 break; | 964 break; |
| 965 } | 965 } |
| 966 } | 966 } |
| 967 } | 967 } |
| 968 | 968 |
| 969 // |delegate_| is null when we are preloading the lock screen. | 969 // |delegate_| is null when we are preloading the lock screen. |
| 970 if (delegate_ && show_on_init_) { | 970 if (delegate_ && show_on_init_) { |
| 971 show_on_init_ = false; | 971 show_on_init_ = false; |
| 972 ShowImpl(); | 972 ShowImpl(); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 997 | 997 |
| 998 void SigninScreenHandler::ClearUserPodPassword() { | 998 void SigninScreenHandler::ClearUserPodPassword() { |
| 999 core_oobe_view_->ClearUserPodPassword(); | 999 core_oobe_view_->ClearUserPodPassword(); |
| 1000 } | 1000 } |
| 1001 | 1001 |
| 1002 void SigninScreenHandler::RefocusCurrentPod() { | 1002 void SigninScreenHandler::RefocusCurrentPod() { |
| 1003 core_oobe_view_->RefocusCurrentPod(); | 1003 core_oobe_view_->RefocusCurrentPod(); |
| 1004 } | 1004 } |
| 1005 | 1005 |
| 1006 void SigninScreenHandler::HidePinKeyboardIfNeeded(const AccountId& account_id) { | 1006 void SigninScreenHandler::HidePinKeyboardIfNeeded(const AccountId& account_id) { |
| 1007 chromeos::quick_unlock::PinStorage* pin_storage = | 1007 chromeos::quick_unlock::QuickUnlockStorage* quick_unlock_storage = |
| 1008 chromeos::quick_unlock::PinStorageFactory::GetForAccountId(account_id); | 1008 chromeos::quick_unlock::QuickUnlockFactory::GetForAccountId(account_id); |
| 1009 if (pin_storage && !pin_storage->IsPinAuthenticationAvailable()) | 1009 if (quick_unlock_storage && |
| 1010 !quick_unlock_storage->IsPinAuthenticationAvailable()) |
| 1010 CallJS("login.AccountPickerScreen.disablePinKeyboardForUser", account_id); | 1011 CallJS("login.AccountPickerScreen.disablePinKeyboardForUser", account_id); |
| 1011 } | 1012 } |
| 1012 | 1013 |
| 1013 void SigninScreenHandler::OnUserRemoved(const AccountId& account_id, | 1014 void SigninScreenHandler::OnUserRemoved(const AccountId& account_id, |
| 1014 bool last_user_removed) { | 1015 bool last_user_removed) { |
| 1015 CallJS("login.AccountPickerScreen.removeUser", account_id); | 1016 CallJS("login.AccountPickerScreen.removeUser", account_id); |
| 1016 if (last_user_removed) | 1017 if (last_user_removed) |
| 1017 OnShowAddUser(); | 1018 OnShowAddUser(); |
| 1018 } | 1019 } |
| 1019 | 1020 |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1152 AllWhitelistedUsersPresent()); | 1153 AllWhitelistedUsersPresent()); |
| 1153 } | 1154 } |
| 1154 | 1155 |
| 1155 void SigninScreenHandler::HandleAuthenticateUser(const AccountId& account_id, | 1156 void SigninScreenHandler::HandleAuthenticateUser(const AccountId& account_id, |
| 1156 const std::string& password, | 1157 const std::string& password, |
| 1157 bool authenticated_by_pin) { | 1158 bool authenticated_by_pin) { |
| 1158 if (!delegate_) | 1159 if (!delegate_) |
| 1159 return; | 1160 return; |
| 1160 DCHECK_EQ(account_id.GetUserEmail(), | 1161 DCHECK_EQ(account_id.GetUserEmail(), |
| 1161 gaia::SanitizeEmail(account_id.GetUserEmail())); | 1162 gaia::SanitizeEmail(account_id.GetUserEmail())); |
| 1162 chromeos::quick_unlock::PinStorage* pin_storage = | 1163 chromeos::quick_unlock::QuickUnlockStorage* quick_unlock_storage = |
| 1163 chromeos::quick_unlock::PinStorageFactory::GetForAccountId(account_id); | 1164 chromeos::quick_unlock::QuickUnlockFactory::GetForAccountId(account_id); |
| 1164 // If pin storage is unavailable, authenticated by PIN must be false. | 1165 // If pin storage is unavailable, authenticated by PIN must be false. |
| 1165 DCHECK(!pin_storage || pin_storage->IsPinAuthenticationAvailable() || | 1166 DCHECK(!quick_unlock_storage || |
| 1167 quick_unlock_storage->IsPinAuthenticationAvailable() || |
| 1166 !authenticated_by_pin); | 1168 !authenticated_by_pin); |
| 1167 | 1169 |
| 1168 UserContext user_context(account_id); | 1170 UserContext user_context(account_id); |
| 1169 user_context.SetKey(Key(password)); | 1171 user_context.SetKey(Key(password)); |
| 1170 user_context.SetIsUsingPin(authenticated_by_pin); | 1172 user_context.SetIsUsingPin(authenticated_by_pin); |
| 1171 if (account_id.GetAccountType() == AccountType::ACTIVE_DIRECTORY) | 1173 if (account_id.GetAccountType() == AccountType::ACTIVE_DIRECTORY) |
| 1172 user_context.SetUserType(user_manager::USER_TYPE_ACTIVE_DIRECTORY); | 1174 user_context.SetUserType(user_manager::USER_TYPE_ACTIVE_DIRECTORY); |
| 1173 delegate_->Login(user_context, SigninSpecifics()); | 1175 delegate_->Login(user_context, SigninSpecifics()); |
| 1174 | 1176 |
| 1175 HidePinKeyboardIfNeeded(account_id); | 1177 HidePinKeyboardIfNeeded(account_id); |
| (...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1645 rate.initial_delay_in_ms = auto_repeat_delay; | 1647 rate.initial_delay_in_ms = auto_repeat_delay; |
| 1646 rate.repeat_interval_in_ms = auto_repeat_interval; | 1648 rate.repeat_interval_in_ms = auto_repeat_interval; |
| 1647 input_method::InputMethodManager::Get() | 1649 input_method::InputMethodManager::Get() |
| 1648 ->GetImeKeyboard() | 1650 ->GetImeKeyboard() |
| 1649 ->SetAutoRepeatEnabled(true); | 1651 ->SetAutoRepeatEnabled(true); |
| 1650 input_method::InputMethodManager::Get()->GetImeKeyboard()->SetAutoRepeatRate( | 1652 input_method::InputMethodManager::Get()->GetImeKeyboard()->SetAutoRepeatRate( |
| 1651 rate); | 1653 rate); |
| 1652 } | 1654 } |
| 1653 | 1655 |
| 1654 } // namespace chromeos | 1656 } // namespace chromeos |
| OLD | NEW |