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 12 matching lines...) Expand all Loading... |
23 SigninManager::SigninManager() | 23 SigninManager::SigninManager() |
24 : profile_(NULL), had_two_factor_error_(false) {} | 24 : profile_(NULL), had_two_factor_error_(false) {} |
25 | 25 |
26 SigninManager::~SigninManager() {} | 26 SigninManager::~SigninManager() {} |
27 | 27 |
28 // static | 28 // static |
29 void SigninManager::RegisterUserPrefs(PrefService* user_prefs) { | 29 void SigninManager::RegisterUserPrefs(PrefService* user_prefs) { |
30 user_prefs->RegisterStringPref(prefs::kGoogleServicesUsername, | 30 user_prefs->RegisterStringPref(prefs::kGoogleServicesUsername, |
31 "", | 31 "", |
32 PrefService::UNSYNCABLE_PREF); | 32 PrefService::UNSYNCABLE_PREF); |
| 33 user_prefs->RegisterBooleanPref(prefs::kAutologinEnabled, |
| 34 true, |
| 35 PrefService::UNSYNCABLE_PREF); |
33 } | 36 } |
34 | 37 |
35 void SigninManager::Initialize(Profile* profile) { | 38 void SigninManager::Initialize(Profile* profile) { |
36 profile_ = profile; | 39 profile_ = profile; |
37 username_ = profile_->GetPrefs()->GetString(prefs::kGoogleServicesUsername); | 40 username_ = profile_->GetPrefs()->GetString(prefs::kGoogleServicesUsername); |
38 profile_->GetTokenService()->Initialize( | 41 profile_->GetTokenService()->Initialize( |
39 GaiaConstants::kChromeSource, profile_); | 42 GaiaConstants::kChromeSource, profile_); |
40 if (!username_.empty()) { | 43 if (!username_.empty()) { |
41 profile_->GetTokenService()->LoadTokensFromDB(); | 44 profile_->GetTokenService()->LoadTokensFromDB(); |
42 } | 45 } |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 profile_->GetRequestContext())); | 275 profile_->GetRequestContext())); |
273 } | 276 } |
274 | 277 |
275 client_login_->StartTokenAuth(tok_details->token()); | 278 client_login_->StartTokenAuth(tok_details->token()); |
276 | 279 |
277 // We only want to do this once per sign-in. | 280 // We only want to do this once per sign-in. |
278 CleanupNotificationRegistration(); | 281 CleanupNotificationRegistration(); |
279 } | 282 } |
280 #endif | 283 #endif |
281 } | 284 } |
OLD | NEW |