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/autofill/personal_data_manager_factory.h" |
| 10 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
9 #include "chrome/browser/defaults.h" | 11 #include "chrome/browser/defaults.h" |
10 #include "chrome/browser/autofill/personal_data_manager_factory.h" | |
11 #include "chrome/browser/extensions/extension_system_factory.h" | 12 #include "chrome/browser/extensions/extension_system_factory.h" |
| 13 #include "chrome/browser/history/history_service_factory.h" |
| 14 #include "chrome/browser/password_manager/password_store_factory.h" |
12 #include "chrome/browser/prefs/pref_service.h" | 15 #include "chrome/browser/prefs/pref_service.h" |
13 #include "chrome/browser/profiles/profile.h" | 16 #include "chrome/browser/profiles/profile.h" |
14 #include "chrome/browser/profiles/profile_dependency_manager.h" | 17 #include "chrome/browser/profiles/profile_dependency_manager.h" |
15 #include "chrome/browser/password_manager/password_store_factory.h" | |
16 #include "chrome/browser/search_engines/template_url_service_factory.h" | 18 #include "chrome/browser/search_engines/template_url_service_factory.h" |
17 #include "chrome/browser/sessions/tab_restore_service_factory.h" | 19 #include "chrome/browser/sessions/tab_restore_service_factory.h" |
18 #include "chrome/browser/signin/signin_manager.h" | 20 #include "chrome/browser/signin/signin_manager.h" |
19 #include "chrome/browser/signin/signin_manager_factory.h" | 21 #include "chrome/browser/signin/signin_manager_factory.h" |
20 #include "chrome/browser/sync/profile_sync_components_factory_impl.h" | 22 #include "chrome/browser/sync/profile_sync_components_factory_impl.h" |
21 #include "chrome/browser/sync/profile_sync_service.h" | 23 #include "chrome/browser/sync/profile_sync_service.h" |
22 #include "chrome/browser/themes/theme_service_factory.h" | 24 #include "chrome/browser/themes/theme_service_factory.h" |
23 #include "chrome/browser/ui/global_error_service_factory.h" | 25 #include "chrome/browser/ui/global_error_service_factory.h" |
24 #include "chrome/browser/webdata/web_data_service_factory.h" | 26 #include "chrome/browser/webdata/web_data_service_factory.h" |
25 #include "chrome/common/pref_names.h" | 27 #include "chrome/common/pref_names.h" |
(...skipping 23 matching lines...) Expand all Loading... |
49 DependsOn(TemplateURLServiceFactory::GetInstance()); | 51 DependsOn(TemplateURLServiceFactory::GetInstance()); |
50 DependsOn(PersonalDataManagerFactory::GetInstance()); | 52 DependsOn(PersonalDataManagerFactory::GetInstance()); |
51 #if defined(ENABLE_THEMES) | 53 #if defined(ENABLE_THEMES) |
52 DependsOn(ThemeServiceFactory::GetInstance()); | 54 DependsOn(ThemeServiceFactory::GetInstance()); |
53 #endif | 55 #endif |
54 DependsOn(GlobalErrorServiceFactory::GetInstance()); | 56 DependsOn(GlobalErrorServiceFactory::GetInstance()); |
55 DependsOn(SigninManagerFactory::GetInstance()); | 57 DependsOn(SigninManagerFactory::GetInstance()); |
56 DependsOn(PasswordStoreFactory::GetInstance()); | 58 DependsOn(PasswordStoreFactory::GetInstance()); |
57 DependsOn(ExtensionSystemFactory::GetInstance()); | 59 DependsOn(ExtensionSystemFactory::GetInstance()); |
58 DependsOn(WebDataServiceFactory::GetInstance()); | 60 DependsOn(WebDataServiceFactory::GetInstance()); |
| 61 DependsOn(HistoryServiceFactory::GetInstance()); |
| 62 DependsOn(BookmarkModelFactory::GetInstance()); |
59 | 63 |
60 // The following have not been converted to ProfileKeyedServices yet, and for | 64 // The following have not been converted to ProfileKeyedServices yet, and for |
61 // now they are explicitly destroyed after the ProfileDependencyManager is | 65 // now they are explicitly destroyed after the ProfileDependencyManager is |
62 // told to DestroyProfileServices, so they will be around when the | 66 // told to DestroyProfileServices, so they will be around when the |
63 // ProfileSyncService is destroyed. | 67 // ProfileSyncService is destroyed. |
64 | 68 |
65 // DependsOn(HistoryServiceFactory::GetInstance()); | |
66 // DependsOn(BookmarkBarModelFactory::GetInstance()); | |
67 // DependsOn(FaviconServiceFactory::GetInstance()); | 69 // DependsOn(FaviconServiceFactory::GetInstance()); |
68 } | 70 } |
69 | 71 |
70 ProfileSyncServiceFactory::~ProfileSyncServiceFactory() { | 72 ProfileSyncServiceFactory::~ProfileSyncServiceFactory() { |
71 } | 73 } |
72 | 74 |
73 ProfileKeyedService* ProfileSyncServiceFactory::BuildServiceInstanceFor( | 75 ProfileKeyedService* ProfileSyncServiceFactory::BuildServiceInstanceFor( |
74 Profile* profile) const { | 76 Profile* profile) const { |
75 ProfileSyncService::StartBehavior behavior = | 77 ProfileSyncService::StartBehavior behavior = |
76 browser_defaults::kSyncAutoStarts ? ProfileSyncService::AUTO_START | 78 browser_defaults::kSyncAutoStarts ? ProfileSyncService::AUTO_START |
(...skipping 16 matching lines...) Expand all Loading... |
93 | 95 |
94 pss->factory()->RegisterDataTypes(pss); | 96 pss->factory()->RegisterDataTypes(pss); |
95 pss->Initialize(); | 97 pss->Initialize(); |
96 return pss; | 98 return pss; |
97 } | 99 } |
98 | 100 |
99 // static | 101 // static |
100 bool ProfileSyncServiceFactory::HasProfileSyncService(Profile* profile) { | 102 bool ProfileSyncServiceFactory::HasProfileSyncService(Profile* profile) { |
101 return GetInstance()->GetServiceForProfile(profile, false) != NULL; | 103 return GetInstance()->GetServiceForProfile(profile, false) != NULL; |
102 } | 104 } |
OLD | NEW |