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