OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "ios/chrome/browser/browser_state/browser_state_keyed_service_factories
.h" | 5 #include "ios/chrome/browser/browser_state/browser_state_keyed_service_factories
.h" |
6 | 6 |
7 #include "ios/chrome/browser/autofill/personal_data_manager_factory.h" | 7 #include "ios/chrome/browser/autofill/personal_data_manager_factory.h" |
8 #include "ios/chrome/browser/bookmarks/startup_task_runner_service_factory.h" | 8 #include "ios/chrome/browser/bookmarks/startup_task_runner_service_factory.h" |
9 #include "ios/chrome/browser/content_settings/cookie_settings_factory.h" | 9 #include "ios/chrome/browser/content_settings/cookie_settings_factory.h" |
10 #include "ios/chrome/browser/dom_distiller/dom_distiller_service_factory.h" | 10 #include "ios/chrome/browser/dom_distiller/dom_distiller_service_factory.h" |
11 #include "ios/chrome/browser/enhanced_bookmarks/bookmark_image_service_factory.h
" | 11 #include "ios/chrome/browser/enhanced_bookmarks/bookmark_image_service_factory.h
" |
12 #include "ios/chrome/browser/enhanced_bookmarks/bookmark_server_cluster_service_
factory.h" | 12 #include "ios/chrome/browser/enhanced_bookmarks/bookmark_server_cluster_service_
factory.h" |
13 #include "ios/chrome/browser/enhanced_bookmarks/enhanced_bookmark_model_factory.
h" | 13 #include "ios/chrome/browser/enhanced_bookmarks/enhanced_bookmark_model_factory.
h" |
14 #include "ios/chrome/browser/favicon/favicon_service_factory.h" | 14 #include "ios/chrome/browser/favicon/favicon_service_factory.h" |
| 15 #include "ios/chrome/browser/google/google_url_tracker_factory.h" |
15 #include "ios/chrome/browser/history/history_service_factory.h" | 16 #include "ios/chrome/browser/history/history_service_factory.h" |
16 #include "ios/chrome/browser/history/top_sites_factory.h" | 17 #include "ios/chrome/browser/history/top_sites_factory.h" |
17 #include "ios/chrome/browser/history/web_history_service_factory.h" | 18 #include "ios/chrome/browser/history/web_history_service_factory.h" |
18 #include "ios/chrome/browser/search_engines/template_url_service_factory.h" | 19 #include "ios/chrome/browser/search_engines/template_url_service_factory.h" |
| 20 #include "ios/chrome/browser/signin/account_tracker_service_factory.h" |
| 21 #include "ios/chrome/browser/signin/gaia_cookie_manager_service_factory.h" |
| 22 #include "ios/chrome/browser/signin/oauth2_token_service_factory.h" |
| 23 #include "ios/chrome/browser/signin/signin_client_factory.h" |
19 #include "ios/chrome/browser/signin/signin_error_controller_factory.h" | 24 #include "ios/chrome/browser/signin/signin_error_controller_factory.h" |
| 25 #include "ios/chrome/browser/signin/signin_manager_factory.h" |
20 #include "ios/chrome/browser/suggestions/suggestions_service_factory.h" | 26 #include "ios/chrome/browser/suggestions/suggestions_service_factory.h" |
21 #include "ios/chrome/browser/sync/sync_setup_service_factory.h" | 27 #include "ios/chrome/browser/sync/sync_setup_service_factory.h" |
22 #include "ios/chrome/browser/translate/translate_accept_languages_factory.h" | 28 #include "ios/chrome/browser/translate/translate_accept_languages_factory.h" |
23 #include "ios/chrome/browser/undo/bookmark_undo_service_factory.h" | 29 #include "ios/chrome/browser/undo/bookmark_undo_service_factory.h" |
24 #include "ios/chrome/browser/web_data_service_factory.h" | 30 #include "ios/chrome/browser/web_data_service_factory.h" |
25 #include "ios/public/provider/chrome/browser/keyed_service_provider.h" | 31 #include "ios/public/provider/chrome/browser/keyed_service_provider.h" |
26 | 32 |
27 // This method gets the instance of each ServiceFactory. We do this so that | 33 // This method gets the instance of each ServiceFactory. We do this so that |
28 // each ServiceFactory initializes itself and registers its dependencies with | 34 // each ServiceFactory initializes itself and registers its dependencies with |
29 // the global PreferenceDependencyManager. We need to have a complete | 35 // the global PreferenceDependencyManager. We need to have a complete |
30 // dependency graph when we create a browser state so we can dispatch the | 36 // dependency graph when we create a browser state so we can dispatch the |
31 // browser state creation message to the services that want to create their | 37 // browser state creation message to the services that want to create their |
32 // services at browser state creation time. | 38 // services at browser state creation time. |
33 // | 39 // |
34 // TODO(erg): This needs to be something else. I don't think putting every | 40 // TODO(erg): This needs to be something else. I don't think putting every |
35 // FooServiceFactory here will scale or is desirable long term. | 41 // FooServiceFactory here will scale or is desirable long term. |
36 void EnsureBrowserStateKeyedServiceFactoriesBuilt() { | 42 void EnsureBrowserStateKeyedServiceFactoriesBuilt() { |
37 BookmarkImageServiceFactory::GetInstance(); | 43 BookmarkImageServiceFactory::GetInstance(); |
38 dom_distiller::DomDistillerServiceFactory::GetInstance(); | 44 dom_distiller::DomDistillerServiceFactory::GetInstance(); |
39 enhanced_bookmarks::BookmarkServerClusterServiceFactory::GetInstance(); | 45 enhanced_bookmarks::BookmarkServerClusterServiceFactory::GetInstance(); |
40 enhanced_bookmarks::EnhancedBookmarkModelFactory::GetInstance(); | 46 enhanced_bookmarks::EnhancedBookmarkModelFactory::GetInstance(); |
| 47 ios::AccountTrackerServiceFactory::GetInstance(); |
41 ios::BookmarkUndoServiceFactory::GetInstance(); | 48 ios::BookmarkUndoServiceFactory::GetInstance(); |
42 ios::CookieSettingsFactory::GetInstance(); | 49 ios::CookieSettingsFactory::GetInstance(); |
43 ios::FaviconServiceFactory::GetInstance(); | 50 ios::FaviconServiceFactory::GetInstance(); |
| 51 ios::GaiaCookieManagerServiceFactory::GetInstance(); |
| 52 ios::GoogleURLTrackerFactory::GetInstance(); |
44 ios::HistoryServiceFactory::GetInstance(); | 53 ios::HistoryServiceFactory::GetInstance(); |
45 ios::SigninErrorControllerFactory::GetInstance(); | 54 ios::SigninErrorControllerFactory::GetInstance(); |
| 55 ios::SigninManagerFactory::GetInstance(); |
46 ios::StartupTaskRunnerServiceFactory::GetInstance(); | 56 ios::StartupTaskRunnerServiceFactory::GetInstance(); |
47 ios::TemplateURLServiceFactory::GetInstance(); | 57 ios::TemplateURLServiceFactory::GetInstance(); |
48 ios::TopSitesFactory::GetInstance(); | 58 ios::TopSitesFactory::GetInstance(); |
49 ios::WebDataServiceFactory::GetInstance(); | 59 ios::WebDataServiceFactory::GetInstance(); |
50 ios::WebHistoryServiceFactory::GetInstance(); | 60 ios::WebHistoryServiceFactory::GetInstance(); |
| 61 OAuth2TokenServiceFactory::GetInstance(); |
51 PersonalDataManagerFactory::GetInstance(); | 62 PersonalDataManagerFactory::GetInstance(); |
| 63 SigninClientFactory::GetInstance(); |
52 suggestions::SuggestionsServiceFactory::GetInstance(); | 64 suggestions::SuggestionsServiceFactory::GetInstance(); |
53 SyncSetupServiceFactory::GetInstance(); | 65 SyncSetupServiceFactory::GetInstance(); |
54 TranslateAcceptLanguagesFactory::GetInstance(); | 66 TranslateAcceptLanguagesFactory::GetInstance(); |
55 | 67 |
56 if (ios::GetKeyedServiceProvider()) | 68 if (ios::GetKeyedServiceProvider()) |
57 ios::GetKeyedServiceProvider()->AssertKeyedFactoriesBuilt(); | 69 ios::GetKeyedServiceProvider()->AssertKeyedFactoriesBuilt(); |
58 } | 70 } |
OLD | NEW |