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

Side by Side Diff: chrome/browser/chromeos/login/login_utils.cc

Issue 8665011: sync: remove GetAuthenticatedUsername from ProfileSyncService/SyncBackendHost. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review2 Created 9 years 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 | « no previous file | chrome/browser/sync/glue/sync_backend_host.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/chromeos/login/login_utils.h" 5 #include "chrome/browser/chromeos/login/login_utils.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 861 matching lines...) Expand 10 before | Expand all | Expand 10 after
872 void LoginUtilsImpl::StartSync( 872 void LoginUtilsImpl::StartSync(
873 Profile* user_profile, 873 Profile* user_profile,
874 const GaiaAuthConsumer::ClientLoginResult& credentials) { 874 const GaiaAuthConsumer::ClientLoginResult& credentials) {
875 TokenService* token_service = user_profile->GetTokenService(); 875 TokenService* token_service = user_profile->GetTokenService();
876 static bool initialized = false; 876 static bool initialized = false;
877 if (!initialized) { 877 if (!initialized) {
878 initialized = true; 878 initialized = true;
879 879
880 // Set the CrOS user by getting this constructor run with the 880 // Set the CrOS user by getting this constructor run with the
881 // user's email on first retrieval. 881 // user's email on first retrieval.
882 // TODO(tim): Tidy this up once cros_user is gone (part of bug 93922).
883 user_profile->GetPrefs()->SetString(prefs::kGoogleServicesUsername,
884 username_);
882 user_profile->GetProfileSyncService(username_)->SetPassphrase( 885 user_profile->GetProfileSyncService(username_)->SetPassphrase(
883 password_, false); 886 password_, false);
884 username_ = ""; 887 username_ = "";
885 password_ = ""; 888 password_ = "";
886 889
887 token_service->Initialize(GaiaConstants::kChromeOSSource, user_profile); 890 token_service->Initialize(GaiaConstants::kChromeOSSource, user_profile);
888 token_service->LoadTokensFromDB(); 891 token_service->LoadTokensFromDB();
889 } 892 }
890 token_service->UpdateCredentials(credentials); 893 token_service->UpdateCredentials(credentials);
891 if (token_service->AreCredentialsValid()) 894 if (token_service->AreCredentialsValid())
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after
1327 // Mark login host for deletion after browser starts. This 1330 // Mark login host for deletion after browser starts. This
1328 // guarantees that the message loop will be referenced by the 1331 // guarantees that the message loop will be referenced by the
1329 // browser before it is dereferenced by the login host. 1332 // browser before it is dereferenced by the login host.
1330 if (login_host) { 1333 if (login_host) {
1331 login_host->OnSessionStart(); 1334 login_host->OnSessionStart();
1332 login_host = NULL; 1335 login_host = NULL;
1333 } 1336 }
1334 } 1337 }
1335 1338
1336 } // namespace chromeos 1339 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/sync/glue/sync_backend_host.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698