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" |
11 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 11 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
12 #include "chrome/browser/defaults.h" | 12 #include "chrome/browser/defaults.h" |
13 #include "chrome/browser/extensions/extension_system_factory.h" | 13 #include "chrome/browser/extensions/extension_system_factory.h" |
14 #include "chrome/browser/history/history_service_factory.h" | 14 #include "chrome/browser/history/history_service_factory.h" |
15 #include "chrome/browser/invalidation/invalidation_service_factory.h" | |
16 #include "chrome/browser/password_manager/password_store_factory.h" | 15 #include "chrome/browser/password_manager/password_store_factory.h" |
17 #include "chrome/browser/profiles/profile.h" | 16 #include "chrome/browser/profiles/profile.h" |
18 #include "chrome/browser/profiles/profile_manager.h" | 17 #include "chrome/browser/profiles/profile_manager.h" |
19 #include "chrome/browser/search_engines/template_url_service_factory.h" | 18 #include "chrome/browser/search_engines/template_url_service_factory.h" |
20 #include "chrome/browser/sessions/tab_restore_service_factory.h" | 19 #include "chrome/browser/sessions/tab_restore_service_factory.h" |
21 #include "chrome/browser/signin/about_signin_internals_factory.h" | 20 #include "chrome/browser/signin/about_signin_internals_factory.h" |
22 #include "chrome/browser/signin/signin_manager.h" | 21 #include "chrome/browser/signin/signin_manager.h" |
23 #include "chrome/browser/signin/signin_manager_factory.h" | 22 #include "chrome/browser/signin/signin_manager_factory.h" |
24 #include "chrome/browser/sync/profile_sync_components_factory_impl.h" | 23 #include "chrome/browser/sync/profile_sync_components_factory_impl.h" |
25 #include "chrome/browser/sync/profile_sync_service.h" | 24 #include "chrome/browser/sync/profile_sync_service.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 DependsOn(ThemeServiceFactory::GetInstance()); | 57 DependsOn(ThemeServiceFactory::GetInstance()); |
59 #endif | 58 #endif |
60 DependsOn(GlobalErrorServiceFactory::GetInstance()); | 59 DependsOn(GlobalErrorServiceFactory::GetInstance()); |
61 DependsOn(SigninManagerFactory::GetInstance()); | 60 DependsOn(SigninManagerFactory::GetInstance()); |
62 DependsOn(PasswordStoreFactory::GetInstance()); | 61 DependsOn(PasswordStoreFactory::GetInstance()); |
63 DependsOn(extensions::ExtensionSystemFactory::GetInstance()); | 62 DependsOn(extensions::ExtensionSystemFactory::GetInstance()); |
64 DependsOn(WebDataServiceFactory::GetInstance()); | 63 DependsOn(WebDataServiceFactory::GetInstance()); |
65 DependsOn(HistoryServiceFactory::GetInstance()); | 64 DependsOn(HistoryServiceFactory::GetInstance()); |
66 DependsOn(BookmarkModelFactory::GetInstance()); | 65 DependsOn(BookmarkModelFactory::GetInstance()); |
67 DependsOn(AboutSigninInternalsFactory::GetInstance()); | 66 DependsOn(AboutSigninInternalsFactory::GetInstance()); |
68 DependsOn(invalidation::InvalidationServiceFactory::GetInstance()); | |
69 | 67 |
70 // The following have not been converted to BrowserContextKeyedServices yet, | 68 // The following have not been converted to BrowserContextKeyedServices yet, |
71 // and for now they are explicitly destroyed after the | 69 // and for now they are explicitly destroyed after the |
72 // BrowserContextDependencyManager is told to DestroyBrowserContextServices, | 70 // BrowserContextDependencyManager is told to DestroyBrowserContextServices, |
73 // so they will be around when the ProfileSyncService is destroyed. | 71 // so they will be around when the ProfileSyncService is destroyed. |
74 | 72 |
75 // DependsOn(FaviconServiceFactory::GetInstance()); | 73 // DependsOn(FaviconServiceFactory::GetInstance()); |
76 } | 74 } |
77 | 75 |
78 ProfileSyncServiceFactory::~ProfileSyncServiceFactory() { | 76 ProfileSyncServiceFactory::~ProfileSyncServiceFactory() { |
(...skipping 28 matching lines...) Expand all Loading... |
107 | 105 |
108 pss->factory()->RegisterDataTypes(pss); | 106 pss->factory()->RegisterDataTypes(pss); |
109 pss->Initialize(); | 107 pss->Initialize(); |
110 return pss; | 108 return pss; |
111 } | 109 } |
112 | 110 |
113 // static | 111 // static |
114 bool ProfileSyncServiceFactory::HasProfileSyncService(Profile* profile) { | 112 bool ProfileSyncServiceFactory::HasProfileSyncService(Profile* profile) { |
115 return GetInstance()->GetServiceForBrowserContext(profile, false) != NULL; | 113 return GetInstance()->GetServiceForBrowserContext(profile, false) != NULL; |
116 } | 114 } |
OLD | NEW |