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