| 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/files/file_path.h" | 9 #include "base/files/file_path.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 498 return true; | 498 return true; |
| 499 // Check if policy data is fine and continue in safe mode if needed. | 499 // Check if policy data is fine and continue in safe mode if needed. |
| 500 bool is_safe_mode = false; | 500 bool is_safe_mode = false; |
| 501 CrosSettings::Get()->GetBoolean(kPolicyMissingMitigationMode, &is_safe_mode); | 501 CrosSettings::Get()->GetBoolean(kPolicyMissingMitigationMode, &is_safe_mode); |
| 502 if (!is_safe_mode) { | 502 if (!is_safe_mode) { |
| 503 // Now we can continue with the login and report mount success. | 503 // Now we can continue with the login and report mount success. |
| 504 user_can_login_ = true; | 504 user_can_login_ = true; |
| 505 owner_is_verified_ = true; | 505 owner_is_verified_ = true; |
| 506 return true; | 506 return true; |
| 507 } | 507 } |
| 508 |
| 508 // Now we can continue reading the private key. | 509 // Now we can continue reading the private key. |
| 509 DeviceSettingsService::Get()->SetUsername( | 510 owner_key_reloader_.ReloadOwnerKey(current_state_->user_context.username); |
| 510 current_state_->user_context.username); | 511 |
| 511 // This should trigger certificate loading, which is needed in order to | 512 // This should trigger certificate loading, which is needed in order to |
| 512 // correctly determine if the current user is the owner. | 513 // correctly determine if the current user is the owner. |
| 513 if (LoginState::IsInitialized()) { | 514 if (LoginState::IsInitialized()) { |
| 514 LoginState::Get()->SetLoggedInState(LoginState::LOGGED_IN_SAFE_MODE, | 515 LoginState::Get()->SetLoggedInState(LoginState::LOGGED_IN_SAFE_MODE, |
| 515 LoginState::LOGGED_IN_USER_NONE); | 516 LoginState::LOGGED_IN_USER_NONE); |
| 516 } | 517 } |
| 517 DeviceSettingsService::Get()->IsCurrentUserOwnerAsync( | 518 DeviceSettingsService::Get()->IsCurrentUserOwnerAsync( |
| 518 base::Bind(&ParallelAuthenticator::OnOwnershipChecked, this)); | 519 base::Bind(&ParallelAuthenticator::OnOwnershipChecked, this)); |
| 519 return false; | 520 return false; |
| 520 } | 521 } |
| (...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 835 Resolve(); | 836 Resolve(); |
| 836 } | 837 } |
| 837 | 838 |
| 838 void ParallelAuthenticator::SetOwnerState(bool owner_check_finished, | 839 void ParallelAuthenticator::SetOwnerState(bool owner_check_finished, |
| 839 bool check_result) { | 840 bool check_result) { |
| 840 owner_is_verified_ = owner_check_finished; | 841 owner_is_verified_ = owner_check_finished; |
| 841 user_can_login_ = check_result; | 842 user_can_login_ = check_result; |
| 842 } | 843 } |
| 843 | 844 |
| 844 } // namespace chromeos | 845 } // namespace chromeos |
| OLD | NEW |