| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/signin/signin_tracker.h" | 5 #include "chrome/browser/signin/signin_tracker.h" |
| 6 | 6 |
| 7 #include "chrome/browser/profiles/profile.h" | 7 #include "chrome/browser/profiles/profile.h" |
| 8 #include "chrome/browser/signin/token_service.h" | 8 #include "chrome/browser/signin/token_service.h" |
| 9 #include "chrome/browser/signin/token_service_factory.h" | 9 #include "chrome/browser/signin/token_service_factory.h" |
| 10 #include "chrome/browser/sync/profile_sync_service.h" | 10 #include "chrome/browser/sync/profile_sync_service.h" |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 } | 167 } |
| 168 return true; | 168 return true; |
| 169 } | 169 } |
| 170 | 170 |
| 171 // static | 171 // static |
| 172 bool SigninTracker::AreServicesSignedIn(Profile* profile) { | 172 bool SigninTracker::AreServicesSignedIn(Profile* profile) { |
| 173 if (!AreServiceTokensLoaded(profile)) | 173 if (!AreServiceTokensLoaded(profile)) |
| 174 return false; | 174 return false; |
| 175 ProfileSyncService* service = | 175 ProfileSyncService* service = |
| 176 ProfileSyncServiceFactory::GetForProfile(profile); | 176 ProfileSyncServiceFactory::GetForProfile(profile); |
| 177 return (service->AreCredentialsAvailable() && | 177 return (service->IsSyncEnabledAndLoggedIn() && |
| 178 service->IsSyncTokenAvailable() && |
| 178 service->GetAuthError().state() == GoogleServiceAuthError::NONE && | 179 service->GetAuthError().state() == GoogleServiceAuthError::NONE && |
| 179 !service->unrecoverable_error_detected()); | 180 !service->unrecoverable_error_detected()); |
| 180 } | 181 } |
| OLD | NEW |