| 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/sync/profile_sync_service_factory.h" | 5 #include "chrome/browser/sync/profile_sync_service_factory.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/memory/singleton.h" | 8 #include "base/memory/singleton.h" |
| 9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
| 10 #include "chrome/browser/autofill/personal_data_manager_factory.h" | 10 #include "chrome/browser/autofill/personal_data_manager_factory.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 #include "components/variations/variations_associated_data.h" | 36 #include "components/variations/variations_associated_data.h" |
| 37 #include "url/gurl.h" | 37 #include "url/gurl.h" |
| 38 | 38 |
| 39 #if defined(ENABLE_EXTENSIONS) | 39 #if defined(ENABLE_EXTENSIONS) |
| 40 #include "extensions/browser/extension_system_provider.h" | 40 #include "extensions/browser/extension_system_provider.h" |
| 41 #include "extensions/browser/extensions_browser_client.h" | 41 #include "extensions/browser/extensions_browser_client.h" |
| 42 #endif | 42 #endif |
| 43 | 43 |
| 44 // static | 44 // static |
| 45 ProfileSyncServiceFactory* ProfileSyncServiceFactory::GetInstance() { | 45 ProfileSyncServiceFactory* ProfileSyncServiceFactory::GetInstance() { |
| 46 return Singleton<ProfileSyncServiceFactory>::get(); | 46 return base::Singleton<ProfileSyncServiceFactory>::get(); |
| 47 } | 47 } |
| 48 | 48 |
| 49 // static | 49 // static |
| 50 ProfileSyncService* ProfileSyncServiceFactory::GetForProfile( | 50 ProfileSyncService* ProfileSyncServiceFactory::GetForProfile( |
| 51 Profile* profile) { | 51 Profile* profile) { |
| 52 if (!ProfileSyncService::IsSyncAllowedByFlag()) | 52 if (!ProfileSyncService::IsSyncAllowedByFlag()) |
| 53 return NULL; | 53 return NULL; |
| 54 | 54 |
| 55 // Disable sync experimentally to measure impact on startup time. Supervised | 55 // Disable sync experimentally to measure impact on startup time. Supervised |
| 56 // users are unaffected, since supervised users rely completely on sync. | 56 // users are unaffected, since supervised users rely completely on sync. |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 | 156 |
| 157 pss->factory()->RegisterDataTypes(pss); | 157 pss->factory()->RegisterDataTypes(pss); |
| 158 pss->Initialize(); | 158 pss->Initialize(); |
| 159 return pss; | 159 return pss; |
| 160 } | 160 } |
| 161 | 161 |
| 162 // static | 162 // static |
| 163 bool ProfileSyncServiceFactory::HasProfileSyncService(Profile* profile) { | 163 bool ProfileSyncServiceFactory::HasProfileSyncService(Profile* profile) { |
| 164 return GetInstance()->GetServiceForBrowserContext(profile, false) != NULL; | 164 return GetInstance()->GetServiceForBrowserContext(profile, false) != NULL; |
| 165 } | 165 } |
| OLD | NEW |