| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 const int ParallelAuthenticator::kClientLoginTimeoutMs = 10000; | 51 const int ParallelAuthenticator::kClientLoginTimeoutMs = 10000; |
| 52 // static | 52 // static |
| 53 const int ParallelAuthenticator::kLocalaccountRetryIntervalMs = 20; | 53 const int ParallelAuthenticator::kLocalaccountRetryIntervalMs = 20; |
| 54 | 54 |
| 55 const int kPassHashLen = 32; | 55 const int kPassHashLen = 32; |
| 56 | 56 |
| 57 ParallelAuthenticator::ParallelAuthenticator(LoginStatusConsumer* consumer) | 57 ParallelAuthenticator::ParallelAuthenticator(LoginStatusConsumer* consumer) |
| 58 : Authenticator(consumer), | 58 : Authenticator(consumer), |
| 59 already_reported_success_(false), | 59 already_reported_success_(false), |
| 60 checked_for_localaccount_(false), | 60 checked_for_localaccount_(false), |
| 61 using_oauth_(CommandLine::ForCurrentProcess()->HasSwitch( | 61 using_oauth_( |
| 62 switches::kWebUIGaiaLogin)) { | 62 CommandLine::ForCurrentProcess()->HasSwitch( |
| 63 switches::kWebUIGaiaLogin) && |
| 64 !CommandLine::ForCurrentProcess()->HasSwitch( |
| 65 switches::kSkipOAuthLogin)) { |
| 63 CHECK(chromeos::CrosLibrary::Get()->EnsureLoaded()); | 66 CHECK(chromeos::CrosLibrary::Get()->EnsureLoaded()); |
| 64 // If not already owned, this is a no-op. If it is, this loads the owner's | 67 // If not already owned, this is a no-op. If it is, this loads the owner's |
| 65 // public key off of disk. | 68 // public key off of disk. |
| 66 OwnershipService::GetSharedInstance()->StartLoadOwnerKeyAttempt(); | 69 OwnershipService::GetSharedInstance()->StartLoadOwnerKeyAttempt(); |
| 67 } | 70 } |
| 68 | 71 |
| 69 ParallelAuthenticator::~ParallelAuthenticator() {} | 72 ParallelAuthenticator::~ParallelAuthenticator() {} |
| 70 | 73 |
| 71 bool ParallelAuthenticator::AuthenticateToLogin( | 74 bool ParallelAuthenticator::AuthenticateToLogin( |
| 72 Profile* profile, | 75 Profile* profile, |
| (...skipping 648 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 721 } | 724 } |
| 722 | 725 |
| 723 void ParallelAuthenticator::ResolveLoginCompletionStatus() { | 726 void ParallelAuthenticator::ResolveLoginCompletionStatus() { |
| 724 // Shortcut online state resolution process. | 727 // Shortcut online state resolution process. |
| 725 current_state_->RecordOnlineLoginStatus(GaiaAuthConsumer::ClientLoginResult(), | 728 current_state_->RecordOnlineLoginStatus(GaiaAuthConsumer::ClientLoginResult(), |
| 726 LoginFailure::None()); | 729 LoginFailure::None()); |
| 727 Resolve(); | 730 Resolve(); |
| 728 } | 731 } |
| 729 | 732 |
| 730 } // namespace chromeos | 733 } // namespace chromeos |
| OLD | NEW |