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 1041 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1052 return !ScreenLocker::default_screen_locker() && | 1052 return !ScreenLocker::default_screen_locker() && |
1053 is_account_picker_showing_first_time_; | 1053 is_account_picker_showing_first_time_; |
1054 } | 1054 } |
1055 | 1055 |
1056 void SigninScreenHandler::UpdateAddButtonStatus() { | 1056 void SigninScreenHandler::UpdateAddButtonStatus() { |
1057 CallJS("cr.ui.login.DisplayManager.updateAddUserButtonStatus", | 1057 CallJS("cr.ui.login.DisplayManager.updateAddUserButtonStatus", |
1058 AllWhitelistedUsersPresent()); | 1058 AllWhitelistedUsersPresent()); |
1059 } | 1059 } |
1060 | 1060 |
1061 void SigninScreenHandler::HandleAuthenticateUser(const AccountId& account_id, | 1061 void SigninScreenHandler::HandleAuthenticateUser(const AccountId& account_id, |
1062 const std::string& password) { | 1062 const std::string& password, |
1063 bool authenticated_by_pin) { | |
1063 if (!delegate_) | 1064 if (!delegate_) |
1064 return; | 1065 return; |
1065 DCHECK_EQ(account_id.GetUserEmail(), | 1066 DCHECK_EQ(account_id.GetUserEmail(), |
1066 gaia::SanitizeEmail(account_id.GetUserEmail())); | 1067 gaia::SanitizeEmail(account_id.GetUserEmail())); |
1068 chromeos::PinStorage* pin_storage = | |
1069 chromeos::PinStorageFactory::GetForAccountId(account_id); | |
1070 DCHECK(pin_storage); | |
1071 DCHECK(authenticated_by_pin == pin_storage->IsPinAuthenticationAvailable()); | |
jdufault
2016/08/16 17:55:02
Will authenticated_by_pin be true if the user type
sammiequon
2016/08/16 19:22:11
Done. Authenticated by pin will be true if the pin
| |
1067 | 1072 |
1068 UserContext user_context(account_id); | 1073 UserContext user_context(account_id); |
1069 user_context.SetKey(Key(password)); | 1074 user_context.SetKey(Key(password)); |
1075 user_context.SetIsUsingPin(authenticated_by_pin); | |
1070 delegate_->Login(user_context, SigninSpecifics()); | 1076 delegate_->Login(user_context, SigninSpecifics()); |
1071 | 1077 |
1072 HidePinKeyboardIfNeeded(account_id); | 1078 HidePinKeyboardIfNeeded(account_id); |
1073 } | 1079 } |
1074 | 1080 |
1075 void SigninScreenHandler::HandleLaunchIncognito() { | 1081 void SigninScreenHandler::HandleLaunchIncognito() { |
1076 UserContext context(user_manager::USER_TYPE_GUEST, EmptyAccountId()); | 1082 UserContext context(user_manager::USER_TYPE_GUEST, EmptyAccountId()); |
1077 if (delegate_) | 1083 if (delegate_) |
1078 delegate_->Login(context, SigninSpecifics()); | 1084 delegate_->Login(context, SigninSpecifics()); |
1079 } | 1085 } |
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1494 } | 1500 } |
1495 | 1501 |
1496 void SigninScreenHandler::OnFeedbackFinished() { | 1502 void SigninScreenHandler::OnFeedbackFinished() { |
1497 CallJS("login.UnrecoverableCryptohomeErrorScreen.resumeAfterFeedbackUI"); | 1503 CallJS("login.UnrecoverableCryptohomeErrorScreen.resumeAfterFeedbackUI"); |
1498 | 1504 |
1499 // Recreate user's cryptohome after the feedback is attempted. | 1505 // Recreate user's cryptohome after the feedback is attempted. |
1500 HandleResyncUserData(); | 1506 HandleResyncUserData(); |
1501 } | 1507 } |
1502 | 1508 |
1503 } // namespace chromeos | 1509 } // namespace chromeos |
OLD | NEW |