OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/profiles/profile_dependency_manager.h" | 5 #include "chrome/browser/profiles/profile_dependency_manager.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <deque> | 8 #include <deque> |
9 #include <iterator> | 9 #include <iterator> |
10 | 10 |
11 #include "chrome/browser/autofill/personal_data_manager_factory.h" | 11 #include "chrome/browser/autofill/personal_data_manager_factory.h" |
12 #include "chrome/browser/background/background_contents_service_factory.h" | 12 #include "chrome/browser/background/background_contents_service_factory.h" |
| 13 #include "chrome/browser/content_settings/cookie_settings.h" |
13 #include "chrome/browser/extensions/speech_input/extension_speech_input_manager.
h" | 14 #include "chrome/browser/extensions/speech_input/extension_speech_input_manager.
h" |
14 #include "chrome/browser/plugin_prefs_factory.h" | 15 #include "chrome/browser/plugin_prefs_factory.h" |
15 #include "chrome/browser/prerender/prerender_manager_factory.h" | 16 #include "chrome/browser/prerender/prerender_manager_factory.h" |
16 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service_factory.
h" | 17 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service_factory.
h" |
17 #include "chrome/browser/profiles/profile.h" | 18 #include "chrome/browser/profiles/profile.h" |
18 #include "chrome/browser/profiles/profile_keyed_service.h" | 19 #include "chrome/browser/profiles/profile_keyed_service.h" |
19 #include "chrome/browser/profiles/profile_keyed_service_factory.h" | 20 #include "chrome/browser/profiles/profile_keyed_service_factory.h" |
20 #include "chrome/browser/search_engines/template_url_service_factory.h" | 21 #include "chrome/browser/search_engines/template_url_service_factory.h" |
21 #include "chrome/browser/sessions/session_service_factory.h" | 22 #include "chrome/browser/sessions/session_service_factory.h" |
22 #include "chrome/browser/sessions/tab_restore_service_factory.h" | 23 #include "chrome/browser/sessions/tab_restore_service_factory.h" |
(...skipping 10 matching lines...) Expand all Loading... |
33 // dependency graph when we create a profile so we can dispatch the profile | 34 // dependency graph when we create a profile so we can dispatch the profile |
34 // creation message to the services that want to create their services at | 35 // creation message to the services that want to create their services at |
35 // profile creation time. | 36 // profile creation time. |
36 // | 37 // |
37 // TODO(erg): This needs to be something else. I don't think putting every | 38 // TODO(erg): This needs to be something else. I don't think putting every |
38 // FooServiceFactory here will scale or is desireable long term. | 39 // FooServiceFactory here will scale or is desireable long term. |
39 void AssertFactoriesBuilt() { | 40 void AssertFactoriesBuilt() { |
40 if (!g_initialized) { | 41 if (!g_initialized) { |
41 BackgroundContentsServiceFactory::GetInstance(); | 42 BackgroundContentsServiceFactory::GetInstance(); |
42 CloudPrintProxyServiceFactory::GetInstance(); | 43 CloudPrintProxyServiceFactory::GetInstance(); |
| 44 CookieSettings::Factory::GetInstance(); |
| 45 ExtensionSpeechInputManager::InitializeFactory(); |
43 PersonalDataManagerFactory::GetInstance(); | 46 PersonalDataManagerFactory::GetInstance(); |
44 PluginPrefsFactory::GetInstance(); | 47 PluginPrefsFactory::GetInstance(); |
45 prerender::PrerenderManagerFactory::GetInstance(); | 48 prerender::PrerenderManagerFactory::GetInstance(); |
46 SessionServiceFactory::GetInstance(); | 49 SessionServiceFactory::GetInstance(); |
47 TabRestoreServiceFactory::GetInstance(); | 50 TabRestoreServiceFactory::GetInstance(); |
48 TemplateURLServiceFactory::GetInstance(); | 51 TemplateURLServiceFactory::GetInstance(); |
49 ExtensionSpeechInputManager::InitializeFactory(); | |
50 | 52 |
51 g_initialized = true; | 53 g_initialized = true; |
52 } | 54 } |
53 } | 55 } |
54 | 56 |
55 } // namespace | 57 } // namespace |
56 | 58 |
57 void ProfileDependencyManager::AddComponent( | 59 void ProfileDependencyManager::AddComponent( |
58 ProfileKeyedServiceFactory* component) { | 60 ProfileKeyedServiceFactory* component) { |
59 all_components_.push_back(component); | 61 all_components_.push_back(component); |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 } | 206 } |
205 } | 207 } |
206 | 208 |
207 if (edges.size()) { | 209 if (edges.size()) { |
208 NOTREACHED() << "Dependency graph has a cycle. We are doomed."; | 210 NOTREACHED() << "Dependency graph has a cycle. We are doomed."; |
209 } | 211 } |
210 | 212 |
211 std::reverse(output.begin(), output.end()); | 213 std::reverse(output.begin(), output.end()); |
212 destruction_order_ = output; | 214 destruction_order_ = output; |
213 } | 215 } |
OLD | NEW |