| 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 439 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 450 } | 450 } |
| 451 // Now we can continue reading the private key. | 451 // Now we can continue reading the private key. |
| 452 DeviceSettingsService::Get()->SetUsername( | 452 DeviceSettingsService::Get()->SetUsername( |
| 453 current_state_->user_context.username); | 453 current_state_->user_context.username); |
| 454 DeviceSettingsService::Get()->GetOwnershipStatusAsync( | 454 DeviceSettingsService::Get()->GetOwnershipStatusAsync( |
| 455 base::Bind(&ParallelAuthenticator::OnOwnershipChecked, this)); | 455 base::Bind(&ParallelAuthenticator::OnOwnershipChecked, this)); |
| 456 return false; | 456 return false; |
| 457 } | 457 } |
| 458 | 458 |
| 459 void ParallelAuthenticator::OnOwnershipChecked( | 459 void ParallelAuthenticator::OnOwnershipChecked( |
| 460 DeviceSettingsService::OwnershipStatus status, | 460 DeviceSettingsService::OwnershipStatus status) { |
| 461 bool is_owner) { | |
| 462 // Now we can check if this user is the owner. | 461 // Now we can check if this user is the owner. |
| 463 user_can_login_ = is_owner; | 462 // TODO(tbarzic): This is broken. At this point, DeviceSettingsService will |
| 463 // never have private key loaded (http://crbug.com/285450). |
| 464 user_can_login_ = DeviceSettingsService::Get()->HasPrivateOwnerKey(); |
| 464 owner_is_verified_ = true; | 465 owner_is_verified_ = true; |
| 465 Resolve(); | 466 Resolve(); |
| 466 } | 467 } |
| 467 | 468 |
| 468 void ParallelAuthenticator::Resolve() { | 469 void ParallelAuthenticator::Resolve() { |
| 469 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 470 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 470 bool request_pending = false; | 471 bool request_pending = false; |
| 471 int mount_flags = cryptohome::MOUNT_FLAGS_NONE; | 472 int mount_flags = cryptohome::MOUNT_FLAGS_NONE; |
| 472 ParallelAuthenticator::AuthState state = ResolveState(); | 473 ParallelAuthenticator::AuthState state = ResolveState(); |
| 473 VLOG(1) << "Resolved state to: " << state; | 474 VLOG(1) << "Resolved state to: " << state; |
| (...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 741 Resolve(); | 742 Resolve(); |
| 742 } | 743 } |
| 743 | 744 |
| 744 void ParallelAuthenticator::SetOwnerState(bool owner_check_finished, | 745 void ParallelAuthenticator::SetOwnerState(bool owner_check_finished, |
| 745 bool check_result) { | 746 bool check_result) { |
| 746 owner_is_verified_ = owner_check_finished; | 747 owner_is_verified_ = owner_check_finished; |
| 747 user_can_login_ = check_result; | 748 user_can_login_ = check_result; |
| 748 } | 749 } |
| 749 | 750 |
| 750 } // namespace chromeos | 751 } // namespace chromeos |
| OLD | NEW |