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/auth/parallel_authenticator.h" | 5 #include "chrome/browser/chromeos/login/auth/parallel_authenticator.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 495 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
506 const std::string& user_id = current_state_->user_context.GetUserID(); | 506 const std::string& user_id = current_state_->user_context.GetUserID(); |
507 OwnerSettingsServiceFactory::GetInstance()->SetUsername(user_id); | 507 OwnerSettingsServiceFactory::GetInstance()->SetUsername(user_id); |
508 | 508 |
509 // This should trigger certificate loading, which is needed in order to | 509 // This should trigger certificate loading, which is needed in order to |
510 // correctly determine if the current user is the owner. | 510 // correctly determine if the current user is the owner. |
511 if (LoginState::IsInitialized()) { | 511 if (LoginState::IsInitialized()) { |
512 LoginState::Get()->SetLoggedInState(LoginState::LOGGED_IN_SAFE_MODE, | 512 LoginState::Get()->SetLoggedInState(LoginState::LOGGED_IN_SAFE_MODE, |
513 LoginState::LOGGED_IN_USER_NONE); | 513 LoginState::LOGGED_IN_USER_NONE); |
514 } | 514 } |
515 | 515 |
516 OwnerSettingsService::IsPrivateKeyExistAsync( | 516 OwnerSettingsService::IsOwnerForSafeModeAsync( |
| 517 user_id, |
| 518 current_state_->user_context.GetUserIDHash(), |
517 base::Bind(&ParallelAuthenticator::OnOwnershipChecked, this)); | 519 base::Bind(&ParallelAuthenticator::OnOwnershipChecked, this)); |
518 return false; | 520 return false; |
519 } | 521 } |
520 | 522 |
521 void ParallelAuthenticator::OnOwnershipChecked(bool is_owner) { | 523 void ParallelAuthenticator::OnOwnershipChecked(bool is_owner) { |
522 // Now we can check if this user is the owner. | 524 // Now we can check if this user is the owner. |
523 user_can_login_ = is_owner; | 525 user_can_login_ = is_owner; |
524 owner_is_verified_ = true; | 526 owner_is_verified_ = true; |
525 Resolve(); | 527 Resolve(); |
526 } | 528 } |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
813 Resolve(); | 815 Resolve(); |
814 } | 816 } |
815 | 817 |
816 void ParallelAuthenticator::SetOwnerState(bool owner_check_finished, | 818 void ParallelAuthenticator::SetOwnerState(bool owner_check_finished, |
817 bool check_result) { | 819 bool check_result) { |
818 owner_is_verified_ = owner_check_finished; | 820 owner_is_verified_ = owner_check_finished; |
819 user_can_login_ = check_result; | 821 user_can_login_ = check_result; |
820 } | 822 } |
821 | 823 |
822 } // namespace chromeos | 824 } // namespace chromeos |
OLD | NEW |