Chromium Code Reviews| 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/background/background_contents_service_factory.h" | 11 #include "chrome/browser/background/background_contents_service_factory.h" |
| 12 #include "chrome/browser/plugin_prefs.h" | |
| 12 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service_factory. h" | 13 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service_factory. h" |
| 13 #include "chrome/browser/profiles/profile_keyed_service.h" | 14 #include "chrome/browser/profiles/profile_keyed_service.h" |
| 14 #include "chrome/browser/profiles/profile_keyed_service_factory.h" | 15 #include "chrome/browser/profiles/profile_keyed_service_factory.h" |
| 15 #include "chrome/browser/search_engines/template_url_service_factory.h" | 16 #include "chrome/browser/search_engines/template_url_service_factory.h" |
| 16 #include "chrome/browser/sessions/session_service_factory.h" | 17 #include "chrome/browser/sessions/session_service_factory.h" |
| 17 #include "chrome/browser/sessions/tab_restore_service_factory.h" | 18 #include "chrome/browser/sessions/tab_restore_service_factory.h" |
| 18 #include "content/common/notification_service.h" | 19 #include "content/common/notification_service.h" |
| 19 | 20 |
| 20 class Profile; | 21 class Profile; |
| 21 | 22 |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 32 // | 33 // |
| 33 // TODO(erg): This needs to be something else. I don't think putting every | 34 // TODO(erg): This needs to be something else. I don't think putting every |
| 34 // FooServiceFactory here will scale or is desireable long term. | 35 // FooServiceFactory here will scale or is desireable long term. |
| 35 void AssertFactoriesBuilt() { | 36 void AssertFactoriesBuilt() { |
| 36 if (!g_initialized) { | 37 if (!g_initialized) { |
| 37 BackgroundContentsServiceFactory::GetInstance(); | 38 BackgroundContentsServiceFactory::GetInstance(); |
| 38 CloudPrintProxyServiceFactory::GetInstance(); | 39 CloudPrintProxyServiceFactory::GetInstance(); |
| 39 SessionServiceFactory::GetInstance(); | 40 SessionServiceFactory::GetInstance(); |
| 40 TabRestoreServiceFactory::GetInstance(); | 41 TabRestoreServiceFactory::GetInstance(); |
| 41 TemplateURLServiceFactory::GetInstance(); | 42 TemplateURLServiceFactory::GetInstance(); |
| 43 PluginPrefs::Initialize(); | |
|
Elliot Glaysher
2011/08/10 19:06:37
nit: alphabetize
| |
| 42 | 44 |
| 43 g_initialized = true; | 45 g_initialized = true; |
| 44 } | 46 } |
| 45 } | 47 } |
| 46 | 48 |
| 47 } // namespace | 49 } // namespace |
| 48 | 50 |
| 49 void ProfileDependencyManager::AddComponent( | 51 void ProfileDependencyManager::AddComponent( |
| 50 ProfileKeyedServiceFactory* component) { | 52 ProfileKeyedServiceFactory* component) { |
| 51 all_components_.push_back(component); | 53 all_components_.push_back(component); |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 189 } | 191 } |
| 190 } | 192 } |
| 191 | 193 |
| 192 if (edges.size()) { | 194 if (edges.size()) { |
| 193 NOTREACHED() << "Dependency graph has a cycle. We are doomed."; | 195 NOTREACHED() << "Dependency graph has a cycle. We are doomed."; |
| 194 } | 196 } |
| 195 | 197 |
| 196 std::reverse(output.begin(), output.end()); | 198 std::reverse(output.begin(), output.end()); |
| 197 destruction_order_ = output; | 199 destruction_order_ = output; |
| 198 } | 200 } |
| OLD | NEW |