Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(92)

Side by Side Diff: chrome/browser/sync/signin_manager.cc

Issue 7562006: Move preferences registering to backend. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove unused include. Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/prefs/browser_prefs.cc ('k') | chrome/browser/ui/autologin_infobar_delegate.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/prefs/browser_prefs.cc ('k') | chrome/browser/ui/autologin_infobar_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698