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 "chrome/browser/defaults.h" | 9 #include "chrome/browser/defaults.h" |
10 #include "chrome/browser/autofill/personal_data_manager_factory.h" | 10 #include "chrome/browser/autofill/personal_data_manager_factory.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 | 39 |
40 ProfileSyncServiceFactory::ProfileSyncServiceFactory() | 40 ProfileSyncServiceFactory::ProfileSyncServiceFactory() |
41 : ProfileKeyedServiceFactory("ProfileSyncService", | 41 : ProfileKeyedServiceFactory("ProfileSyncService", |
42 ProfileDependencyManager::GetInstance()) { | 42 ProfileDependencyManager::GetInstance()) { |
43 | 43 |
44 // The ProfileSyncService depends on various SyncableServices being around | 44 // The ProfileSyncService depends on various SyncableServices being around |
45 // when it is shut down. Specify those dependencies here to build the proper | 45 // when it is shut down. Specify those dependencies here to build the proper |
46 // destruction order. | 46 // destruction order. |
47 DependsOn(TemplateURLServiceFactory::GetInstance()); | 47 DependsOn(TemplateURLServiceFactory::GetInstance()); |
48 DependsOn(PersonalDataManagerFactory::GetInstance()); | 48 DependsOn(PersonalDataManagerFactory::GetInstance()); |
| 49 #if defined(ENABLE_THEMES) |
49 DependsOn(ThemeServiceFactory::GetInstance()); | 50 DependsOn(ThemeServiceFactory::GetInstance()); |
| 51 #endif |
50 DependsOn(GlobalErrorServiceFactory::GetInstance()); | 52 DependsOn(GlobalErrorServiceFactory::GetInstance()); |
51 DependsOn(SigninManagerFactory::GetInstance()); | 53 DependsOn(SigninManagerFactory::GetInstance()); |
52 DependsOn(PasswordStoreFactory::GetInstance()); | 54 DependsOn(PasswordStoreFactory::GetInstance()); |
53 | 55 |
54 // The following have not been converted to ProfileKeyedServices yet, and for | 56 // The following have not been converted to ProfileKeyedServices yet, and for |
55 // now they are explicitly destroyed after the ProfileDependencyManager is | 57 // now they are explicitly destroyed after the ProfileDependencyManager is |
56 // told to DestroyProfileServices, so they will be around when the | 58 // told to DestroyProfileServices, so they will be around when the |
57 // ProfileSyncService is destroyed. | 59 // ProfileSyncService is destroyed. |
58 | 60 |
59 // DependsOn(WebDataServiceFactory::GetInstance()); | 61 // DependsOn(WebDataServiceFactory::GetInstance()); |
(...skipping 29 matching lines...) Expand all Loading... |
89 | 91 |
90 pss->factory()->RegisterDataTypes(pss); | 92 pss->factory()->RegisterDataTypes(pss); |
91 pss->Initialize(); | 93 pss->Initialize(); |
92 return pss; | 94 return pss; |
93 } | 95 } |
94 | 96 |
95 // static | 97 // static |
96 bool ProfileSyncServiceFactory::HasProfileSyncService(Profile* profile) { | 98 bool ProfileSyncServiceFactory::HasProfileSyncService(Profile* profile) { |
97 return GetInstance()->GetServiceForProfile(profile, false) != NULL; | 99 return GetInstance()->GetServiceForProfile(profile, false) != NULL; |
98 } | 100 } |
OLD | NEW |