Chromium Code Reviews| Index: chrome/browser/chromeos/login/parallel_authenticator.cc |
| diff --git a/chrome/browser/chromeos/login/parallel_authenticator.cc b/chrome/browser/chromeos/login/parallel_authenticator.cc |
| index ed49bc3d26bd12946004f78c2906b5096d1b8d6b..264a57608ad747222b07de1d62634d296eb7ae9b 100644 |
| --- a/chrome/browser/chromeos/login/parallel_authenticator.cc |
| +++ b/chrome/browser/chromeos/login/parallel_authenticator.cc |
| @@ -19,7 +19,6 @@ |
| #include "chrome/browser/chromeos/cryptohome/async_method_caller.h" |
| #include "chrome/browser/chromeos/login/authentication_notification_details.h" |
| #include "chrome/browser/chromeos/login/login_status_consumer.h" |
| -#include "chrome/browser/chromeos/login/ownership_service.h" |
| #include "chrome/browser/chromeos/login/user_manager.h" |
| #include "chrome/common/chrome_notification_types.h" |
| #include "chrome/common/chrome_switches.h" |
| @@ -201,9 +200,6 @@ ParallelAuthenticator::ParallelAuthenticator(LoginStatusConsumer* consumer) |
| using_oauth_( |
| !CommandLine::ForCurrentProcess()->HasSwitch( |
| switches::kSkipOAuthLogin)) { |
| - // If not already owned, this is a no-op. If it is, this loads the owner's |
| - // public key off of disk. |
| - OwnershipService::GetSharedInstance()->StartLoadOwnerKeyAttempt(); |
| } |
| void ParallelAuthenticator::AuthenticateToLogin( |
| @@ -224,7 +220,6 @@ void ParallelAuthenticator::AuthenticateToLogin( |
| !UserManager::Get()->IsKnownUser(canonicalized))); |
| { |
|
pastarmovj
2012/07/30 13:55:02
Remove the {} too.
Mattias Nissler (ping if slow)
2012/08/02 12:01:52
Done.
|
| // Reset the verified flag. |
| - base::AutoLock for_this_block(owner_verified_lock_); |
| owner_is_verified_ = false; |
| } |
| @@ -257,11 +252,9 @@ void ParallelAuthenticator::CompleteLogin(Profile* profile, |
| password, |
| HashPassword(password), |
| !UserManager::Get()->IsKnownUser(canonicalized))); |
| - { |
| - // Reset the verified flag. |
| - base::AutoLock for_this_block(owner_verified_lock_); |
| - owner_is_verified_ = false; |
| - } |
| + |
| + // Reset the verified flag. |
| + owner_is_verified_ = false; |
| const bool create_if_missing = false; |
| BrowserThread::PostTask( |
| @@ -415,7 +408,6 @@ void ParallelAuthenticator::ResyncEncryptedData() { |
| } |
| bool ParallelAuthenticator::VerifyOwner() { |
| - base::AutoLock for_this_block(owner_verified_lock_); |
| if (owner_is_verified_) |
| return true; |
| // Check if policy data is fine and continue in safe mode if needed. |
| @@ -430,21 +422,19 @@ bool ParallelAuthenticator::VerifyOwner() { |
| // First we have to make sure the current user's cert store is available. |
| CrosLibrary::Get()->GetCertLibrary()->LoadKeyStore(); |
| // Now we can continue reading the private key. |
| - BrowserThread::PostTask( |
| - BrowserThread::FILE, FROM_HERE, |
| - base::Bind(&ParallelAuthenticator::FinishVerifyOwnerOnFileThread, this)); |
| + DeviceSettingsService::Get()->SetUsername(current_state_->username); |
| + DeviceSettingsService::Get()->GetOwnershipStatusAsync( |
| + base::Bind(&ParallelAuthenticator::OnOwnershipChecked, this)); |
| return false; |
| } |
| -void ParallelAuthenticator::FinishVerifyOwnerOnFileThread() { |
| - base::AutoLock for_this_block(owner_verified_lock_); |
| +void ParallelAuthenticator::OnOwnershipChecked( |
| + DeviceSettingsService::OwnershipStatus status, |
| + bool is_owner) { |
| // Now we can check if this user is the owner. |
| - user_can_login_ = |
| - OwnershipService::GetSharedInstance()->IsCurrentUserOwner(); |
| + user_can_login_ = is_owner; |
| owner_is_verified_ = true; |
| - BrowserThread::PostTask( |
| - BrowserThread::UI, FROM_HERE, |
| - base::Bind(&ParallelAuthenticator::Resolve, this)); |
| + Resolve(); |
| } |
| void ParallelAuthenticator::RetryAuth(Profile* profile, |
| @@ -803,7 +793,6 @@ void ParallelAuthenticator::ResolveLoginCompletionStatus() { |
| void ParallelAuthenticator::SetOwnerState(bool owner_check_finished, |
| bool check_result) { |
| - base::AutoLock for_this_block(owner_verified_lock_); |
| owner_is_verified_ = owner_check_finished; |
| user_can_login_ = check_result; |
| } |