Revert "Fix broken channel icon in chrome://help on CrOS" and try again
[chromium-blink-merge.git] / ios / chrome / browser / browser_state / browser_state_keyed_service_factories.mm
blob50782a522757b1271f0abb8158366e446fa76cf4
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
3 // found in the LICENSE file.
5 #include "ios/chrome/browser/browser_state/browser_state_keyed_service_factories.h"
7 #include "ios/chrome/browser/autocomplete/autocomplete_classifier_factory.h"
8 #include "ios/chrome/browser/autocomplete/in_memory_url_index_factory.h"
9 #include "ios/chrome/browser/autocomplete/shortcuts_backend_factory.h"
10 #include "ios/chrome/browser/autofill/personal_data_manager_factory.h"
11 #include "ios/chrome/browser/bookmarks/bookmark_client_factory.h"
12 #include "ios/chrome/browser/bookmarks/bookmark_model_factory.h"
13 #include "ios/chrome/browser/bookmarks/startup_task_runner_service_factory.h"
14 #include "ios/chrome/browser/content_settings/cookie_settings_factory.h"
15 #include "ios/chrome/browser/dom_distiller/dom_distiller_service_factory.h"
16 #include "ios/chrome/browser/enhanced_bookmarks/bookmark_server_cluster_service_factory.h"
17 #include "ios/chrome/browser/enhanced_bookmarks/enhanced_bookmark_model_factory.h"
18 #include "ios/chrome/browser/favicon/favicon_service_factory.h"
19 #include "ios/chrome/browser/google/google_url_tracker_factory.h"
20 #include "ios/chrome/browser/history/history_service_factory.h"
21 #include "ios/chrome/browser/history/top_sites_factory.h"
22 #include "ios/chrome/browser/history/web_history_service_factory.h"
23 #include "ios/chrome/browser/search_engines/template_url_service_factory.h"
24 #include "ios/chrome/browser/signin/about_signin_internals_factory.h"
25 #include "ios/chrome/browser/signin/account_fetcher_service_factory.h"
26 #include "ios/chrome/browser/signin/account_reconcilor_factory.h"
27 #include "ios/chrome/browser/signin/account_tracker_service_factory.h"
28 #include "ios/chrome/browser/signin/gaia_cookie_manager_service_factory.h"
29 #include "ios/chrome/browser/signin/oauth2_token_service_factory.h"
30 #include "ios/chrome/browser/signin/signin_client_factory.h"
31 #include "ios/chrome/browser/signin/signin_error_controller_factory.h"
32 #include "ios/chrome/browser/signin/signin_manager_factory.h"
33 #include "ios/chrome/browser/suggestions/suggestions_service_factory.h"
34 #include "ios/chrome/browser/sync/sync_setup_service_factory.h"
35 #include "ios/chrome/browser/translate/translate_accept_languages_factory.h"
36 #include "ios/chrome/browser/undo/bookmark_undo_service_factory.h"
37 #include "ios/chrome/browser/web_data_service_factory.h"
38 #include "ios/public/provider/chrome/browser/keyed_service_provider.h"
40 // This method gets the instance of each ServiceFactory. We do this so that
41 // each ServiceFactory initializes itself and registers its dependencies with
42 // the global PreferenceDependencyManager. We need to have a complete
43 // dependency graph when we create a browser state so we can dispatch the
44 // browser state creation message to the services that want to create their
45 // services at browser state creation time.
47 // TODO(erg): This needs to be something else. I don't think putting every
48 // FooServiceFactory here will scale or is desirable long term.
49 void EnsureBrowserStateKeyedServiceFactoriesBuilt() {
50   BookmarkClientFactory::GetInstance();
51   dom_distiller::DomDistillerServiceFactory::GetInstance();
52   enhanced_bookmarks::BookmarkServerClusterServiceFactory::GetInstance();
53   enhanced_bookmarks::EnhancedBookmarkModelFactory::GetInstance();
54   ios::AboutSigninInternalsFactory::GetInstance();
55   ios::AccountFetcherServiceFactory::GetInstance();
56   ios::AccountReconcilorFactory::GetInstance();
57   ios::AccountTrackerServiceFactory::GetInstance();
58   ios::AutocompleteClassifierFactory::GetInstance();
59   ios::BookmarkModelFactory::GetInstance();
60   ios::BookmarkUndoServiceFactory::GetInstance();
61   ios::CookieSettingsFactory::GetInstance();
62   ios::FaviconServiceFactory::GetInstance();
63   ios::GaiaCookieManagerServiceFactory::GetInstance();
64   ios::GoogleURLTrackerFactory::GetInstance();
65   ios::HistoryServiceFactory::GetInstance();
66   ios::InMemoryURLIndexFactory::GetInstance();
67   ios::ShortcutsBackendFactory::GetInstance();
68   ios::SigninErrorControllerFactory::GetInstance();
69   ios::SigninManagerFactory::GetInstance();
70   ios::StartupTaskRunnerServiceFactory::GetInstance();
71   ios::TemplateURLServiceFactory::GetInstance();
72   ios::TopSitesFactory::GetInstance();
73   ios::WebDataServiceFactory::GetInstance();
74   ios::WebHistoryServiceFactory::GetInstance();
75   OAuth2TokenServiceFactory::GetInstance();
76   PersonalDataManagerFactory::GetInstance();
77   SigninClientFactory::GetInstance();
78   suggestions::SuggestionsServiceFactory::GetInstance();
79   SyncSetupServiceFactory::GetInstance();
80   TranslateAcceptLanguagesFactory::GetInstance();
82   if (ios::GetKeyedServiceProvider())
83     ios::GetKeyedServiceProvider()->AssertKeyedFactoriesBuilt();