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/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 Loading... |
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 Loading... |
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 |
OLD | NEW |