OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/parallel_authenticator.h" | 5 #include "chrome/browser/chromeos/login/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/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
(...skipping 455 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
466 return true; | 466 return true; |
467 // Check if policy data is fine and continue in safe mode if needed. | 467 // Check if policy data is fine and continue in safe mode if needed. |
468 bool is_safe_mode = false; | 468 bool is_safe_mode = false; |
469 CrosSettings::Get()->GetBoolean(kPolicyMissingMitigationMode, &is_safe_mode); | 469 CrosSettings::Get()->GetBoolean(kPolicyMissingMitigationMode, &is_safe_mode); |
470 if (!is_safe_mode) { | 470 if (!is_safe_mode) { |
471 // Now we can continue with the login and report mount success. | 471 // Now we can continue with the login and report mount success. |
472 user_can_login_ = true; | 472 user_can_login_ = true; |
473 owner_is_verified_ = true; | 473 owner_is_verified_ = true; |
474 return true; | 474 return true; |
475 } | 475 } |
476 // First we have to make sure the current user's cert store is available. | |
477 CrosLibrary::Get()->GetCertLibrary()->LoadKeyStore(); | |
478 // Now we can continue reading the private key. | 476 // Now we can continue reading the private key. |
479 DeviceSettingsService::Get()->SetUsername( | 477 DeviceSettingsService::Get()->SetUsername( |
480 current_state_->user_context.username); | 478 current_state_->user_context.username); |
481 DeviceSettingsService::Get()->GetOwnershipStatusAsync( | 479 DeviceSettingsService::Get()->GetOwnershipStatusAsync( |
482 base::Bind(&ParallelAuthenticator::OnOwnershipChecked, this)); | 480 base::Bind(&ParallelAuthenticator::OnOwnershipChecked, this)); |
483 return false; | 481 return false; |
484 } | 482 } |
485 | 483 |
486 void ParallelAuthenticator::OnOwnershipChecked( | 484 void ParallelAuthenticator::OnOwnershipChecked( |
487 DeviceSettingsService::OwnershipStatus status, | 485 DeviceSettingsService::OwnershipStatus status, |
(...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
884 Resolve(); | 882 Resolve(); |
885 } | 883 } |
886 | 884 |
887 void ParallelAuthenticator::SetOwnerState(bool owner_check_finished, | 885 void ParallelAuthenticator::SetOwnerState(bool owner_check_finished, |
888 bool check_result) { | 886 bool check_result) { |
889 owner_is_verified_ = owner_check_finished; | 887 owner_is_verified_ = owner_check_finished; |
890 user_can_login_ = check_result; | 888 user_can_login_ = check_result; |
891 } | 889 } |
892 | 890 |
893 } // namespace chromeos | 891 } // namespace chromeos |
OLD | NEW |