| 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/sync/signin_manager.h" | 5 #include "chrome/browser/sync/signin_manager.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
| 9 #include "chrome/browser/net/gaia/token_service.h" | 9 #include "chrome/browser/net/gaia/token_service.h" |
| 10 #include "chrome/browser/prefs/pref_service.h" | 10 #include "chrome/browser/prefs/pref_service.h" |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 129 password, | 129 password, |
| 130 "", | 130 "", |
| 131 login_token, | 131 login_token, |
| 132 login_captcha, | 132 login_captcha, |
| 133 GaiaAuthFetcher::HostedAccountsNotAllowed); | 133 GaiaAuthFetcher::HostedAccountsNotAllowed); |
| 134 | 134 |
| 135 // Register for token availability. The signin manager will pre-login the | 135 // Register for token availability. The signin manager will pre-login the |
| 136 // user when the GAIA service token is ready for use. Only do this if we | 136 // user when the GAIA service token is ready for use. Only do this if we |
| 137 // are not running in ChomiumOS, since it handles pre-login itself. | 137 // are not running in ChomiumOS, since it handles pre-login itself. |
| 138 #if !defined(OS_CHROMEOS) | 138 #if !defined(OS_CHROMEOS) |
| 139 if (profile_->GetPrefs()->GetBoolean(prefs::kAutologinEnabled)) { | 139 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableAutologin) && |
| 140 profile_->GetPrefs()->GetBoolean(prefs::kAutologinEnabled)) { |
| 140 registrar_.Add(this, | 141 registrar_.Add(this, |
| 141 chrome::NOTIFICATION_TOKEN_AVAILABLE, | 142 chrome::NOTIFICATION_TOKEN_AVAILABLE, |
| 142 Source<TokenService>(profile_->GetTokenService())); | 143 Source<TokenService>(profile_->GetTokenService())); |
| 143 } | 144 } |
| 144 #endif | 145 #endif |
| 145 } | 146 } |
| 146 | 147 |
| 147 void SigninManager::ProvideSecondFactorAccessCode( | 148 void SigninManager::ProvideSecondFactorAccessCode( |
| 148 const std::string& access_code) { | 149 const std::string& access_code) { |
| 149 DCHECK(!browser_sync::IsUsingOAuth()); | 150 DCHECK(!browser_sync::IsUsingOAuth()); |
| (...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 profile_->GetRequestContext())); | 343 profile_->GetRequestContext())); |
| 343 } | 344 } |
| 344 | 345 |
| 345 client_login_->StartMergeSession(tok_details->token()); | 346 client_login_->StartMergeSession(tok_details->token()); |
| 346 | 347 |
| 347 // We only want to do this once per sign-in. | 348 // We only want to do this once per sign-in. |
| 348 CleanupNotificationRegistration(); | 349 CleanupNotificationRegistration(); |
| 349 } | 350 } |
| 350 #endif | 351 #endif |
| 351 } | 352 } |
| OLD | NEW |