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" |
11 #include "chrome/browser/sync/profile_sync_service_factory.h" | 11 #include "chrome/browser/sync/profile_sync_service_factory.h" |
12 #include "chrome/common/chrome_notification_types.h" | 12 #include "chrome/common/chrome_notification_types.h" |
13 #include "chrome/common/net/gaia/gaia_constants.h" | |
14 #include "content/public/browser/notification_details.h" | 13 #include "content/public/browser/notification_details.h" |
15 #include "content/public/browser/notification_source.h" | 14 #include "content/public/browser/notification_source.h" |
| 15 #include "google_apis/gaia/gaia_constants.h" |
16 | 16 |
17 static const char* kSignedInServices[] = { | 17 static const char* kSignedInServices[] = { |
18 GaiaConstants::kSyncService, | 18 GaiaConstants::kSyncService, |
19 GaiaConstants::kGaiaOAuth2LoginRefreshToken | 19 GaiaConstants::kGaiaOAuth2LoginRefreshToken |
20 }; | 20 }; |
21 static const int kNumSignedInServices = | 21 static const int kNumSignedInServices = |
22 arraysize(kSignedInServices); | 22 arraysize(kSignedInServices); |
23 | 23 |
24 // Helper to check if the given token service is relevant for sync. | 24 // Helper to check if the given token service is relevant for sync. |
25 SigninTracker::SigninTracker(Profile* profile, Observer* observer) | 25 SigninTracker::SigninTracker(Profile* profile, Observer* observer) |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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->IsSyncEnabledAndLoggedIn() && | 177 return (service->IsSyncEnabledAndLoggedIn() && |
178 service->IsSyncTokenAvailable() && | 178 service->IsSyncTokenAvailable() && |
179 service->GetAuthError().state() == GoogleServiceAuthError::NONE && | 179 service->GetAuthError().state() == GoogleServiceAuthError::NONE && |
180 !service->HasUnrecoverableError()); | 180 !service->HasUnrecoverableError()); |
181 } | 181 } |
OLD | NEW |