| 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 871 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 882 void LoginUtilsImpl::StartSync( | 882 void LoginUtilsImpl::StartSync( |
| 883 Profile* user_profile, | 883 Profile* user_profile, |
| 884 const GaiaAuthConsumer::ClientLoginResult& credentials) { | 884 const GaiaAuthConsumer::ClientLoginResult& credentials) { |
| 885 TokenService* token_service = user_profile->GetTokenService(); | 885 TokenService* token_service = user_profile->GetTokenService(); |
| 886 static bool initialized = false; | 886 static bool initialized = false; |
| 887 if (!initialized) { | 887 if (!initialized) { |
| 888 initialized = true; | 888 initialized = true; |
| 889 | 889 |
| 890 // Set the CrOS user by getting this constructor run with the | 890 // Set the CrOS user by getting this constructor run with the |
| 891 // user's email on first retrieval. | 891 // user's email on first retrieval. |
| 892 // TODO(tim): Tidy this up once cros_user is gone (part of bug 93922). |
| 893 user_profile->GetPrefs()->SetString(prefs::kGoogleServicesUsername, |
| 894 username_); |
| 892 user_profile->GetProfileSyncService(username_)->SetPassphrase( | 895 user_profile->GetProfileSyncService(username_)->SetPassphrase( |
| 893 password_, false); | 896 password_, false); |
| 894 username_ = ""; | 897 username_ = ""; |
| 895 password_ = ""; | 898 password_ = ""; |
| 896 | 899 |
| 897 token_service->Initialize(GaiaConstants::kChromeOSSource, user_profile); | 900 token_service->Initialize(GaiaConstants::kChromeOSSource, user_profile); |
| 898 token_service->LoadTokensFromDB(); | 901 token_service->LoadTokensFromDB(); |
| 899 } | 902 } |
| 900 token_service->UpdateCredentials(credentials); | 903 token_service->UpdateCredentials(credentials); |
| 901 if (token_service->AreCredentialsValid()) | 904 if (token_service->AreCredentialsValid()) |
| (...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1333 // Mark login host for deletion after browser starts. This | 1336 // Mark login host for deletion after browser starts. This |
| 1334 // guarantees that the message loop will be referenced by the | 1337 // guarantees that the message loop will be referenced by the |
| 1335 // browser before it is dereferenced by the login host. | 1338 // browser before it is dereferenced by the login host. |
| 1336 if (login_host) { | 1339 if (login_host) { |
| 1337 login_host->OnSessionStart(); | 1340 login_host->OnSessionStart(); |
| 1338 login_host = NULL; | 1341 login_host = NULL; |
| 1339 } | 1342 } |
| 1340 } | 1343 } |
| 1341 | 1344 |
| 1342 } // namespace chromeos | 1345 } // namespace chromeos |
| OLD | NEW |