browser_prefs.cc revision ac1e49eb6695f711d72215fcdf9388548942a00d
1// Copyright (c) 2010 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.
4
5#include "chrome/browser/prefs/browser_prefs.h"
6
7#include "chrome/browser/about_flags.h"
8#include "chrome/browser/autofill/autofill_manager.h"
9#include "chrome/browser/background_contents_service.h"
10#include "chrome/browser/background_mode_manager.h"
11#include "chrome/browser/background_page_tracker.h"
12#include "chrome/browser/bookmarks/bookmark_utils.h"
13#include "chrome/browser/browser_shutdown.h"
14#include "chrome/browser/debugger/devtools_manager.h"
15#include "chrome/browser/dom_ui/flags_ui.h"
16#include "chrome/browser/dom_ui/new_tab_ui.h"
17#include "chrome/browser/dom_ui/plugins_ui.h"
18#include "chrome/browser/download/download_prefs.h"
19#include "chrome/browser/extensions/extension_dom_ui.h"
20#include "chrome/browser/extensions/extension_prefs.h"
21#include "chrome/browser/extensions/extensions_ui.h"
22#include "chrome/browser/external_protocol_handler.h"
23#include "chrome/browser/geolocation/geolocation_content_settings_map.h"
24#include "chrome/browser/geolocation/geolocation_prefs.h"
25#include "chrome/browser/google/google_url_tracker.h"
26#include "chrome/browser/host_content_settings_map.h"
27#include "chrome/browser/host_zoom_map.h"
28#include "chrome/browser/intranet_redirect_detector.h"
29#include "chrome/browser/instant/instant_controller.h"
30#include "chrome/browser/metrics/metrics_log.h"
31#include "chrome/browser/metrics/metrics_service.h"
32#include "chrome/browser/net/predictor_api.h"
33#include "chrome/browser/net/pref_proxy_config_service.h"
34#include "chrome/browser/net/net_pref_observer.h"
35#include "chrome/browser/notifications/desktop_notification_service.h"
36#include "chrome/browser/page_info_model.h"
37#include "chrome/browser/password_manager/password_manager.h"
38#include "chrome/browser/prefs/session_startup_pref.h"
39#include "chrome/browser/profile_impl.h"
40#include "chrome/browser/renderer_host/browser_render_process_host.h"
41#include "chrome/browser/renderer_host/web_cache_manager.h"
42#include "chrome/browser/safe_browsing/safe_browsing_service.h"
43#include "chrome/browser/search_engines/keyword_editor_controller.h"
44#include "chrome/browser/search_engines/template_url_model.h"
45#include "chrome/browser/search_engines/template_url_prepopulate_data.h"
46#include "chrome/browser/ssl/ssl_manager.h"
47#include "chrome/browser/sync/signin_manager.h"
48#include "chrome/browser/tab_contents/tab_contents.h"
49#include "chrome/browser/tabs/pinned_tab_codec.h"
50#include "chrome/browser/task_manager/task_manager.h"
51#include "chrome/browser/translate/translate_prefs.h"
52#include "chrome/browser/ui/browser.h"
53#include "chrome/browser/upgrade_detector.h"
54
55#if defined(TOOLKIT_VIEWS)  // TODO(port): whittle this down as we port
56#include "chrome/browser/views/browser_actions_container.h"
57#include "chrome/browser/views/frame/browser_view.h"
58#endif
59
60#if defined(TOOLKIT_GTK)
61#include "chrome/browser/gtk/browser_window_gtk.h"
62#endif
63
64#if defined(OS_CHROMEOS)
65#include "chrome/browser/chromeos/login/apply_services_customization.h"
66#include "chrome/browser/chromeos/login/signed_settings_temp_storage.h"
67#include "chrome/browser/chromeos/login/user_manager.h"
68#include "chrome/browser/chromeos/login/wizard_controller.h"
69#include "chrome/browser/chromeos/preferences.h"
70#include "chrome/browser/chromeos/status/input_method_menu_button.h"
71#include "chrome/browser/chromeos/user_cros_settings_provider.h"
72#endif
73
74namespace browser {
75
76void RegisterAllPrefs(PrefService* user_prefs, PrefService* local_state) {
77  RegisterLocalState(local_state);
78  RegisterUserPrefs(user_prefs);
79}
80
81void RegisterLocalState(PrefService* local_state) {
82  // Prefs in Local State
83  Browser::RegisterPrefs(local_state);
84  WebCacheManager::RegisterPrefs(local_state);
85  ExternalProtocolHandler::RegisterPrefs(local_state);
86  GoogleURLTracker::RegisterPrefs(local_state);
87  IntranetRedirectDetector::RegisterPrefs(local_state);
88  KeywordEditorController::RegisterPrefs(local_state);
89  MetricsLog::RegisterPrefs(local_state);
90  MetricsService::RegisterPrefs(local_state);
91  SafeBrowsingService::RegisterPrefs(local_state);
92  browser_shutdown::RegisterPrefs(local_state);
93  chrome_browser_net::RegisterPrefs(local_state);
94#if defined(TOOLKIT_VIEWS)
95  BrowserView::RegisterBrowserViewPrefs(local_state);
96#endif
97  UpgradeDetector::RegisterPrefs(local_state);
98  TaskManager::RegisterPrefs(local_state);
99  geolocation::RegisterPrefs(local_state);
100  AutoFillManager::RegisterBrowserPrefs(local_state);
101  BackgroundPageTracker::RegisterPrefs(local_state);
102#if defined(OS_CHROMEOS)
103  chromeos::UserManager::RegisterPrefs(local_state);
104  chromeos::UserCrosSettingsProvider::RegisterPrefs(local_state);
105  WizardController::RegisterPrefs(local_state);
106  chromeos::InputMethodMenuButton::RegisterPrefs(local_state);
107  chromeos::ApplyServicesCustomization::RegisterPrefs(local_state);
108  chromeos::SignedSettingsTempStorage::RegisterPrefs(local_state);
109#endif
110}
111
112void RegisterUserPrefs(PrefService* user_prefs) {
113  // User prefs
114  AutoFillManager::RegisterUserPrefs(user_prefs);
115  BackgroundModeManager::RegisterUserPrefs(user_prefs);
116  SessionStartupPref::RegisterUserPrefs(user_prefs);
117  Browser::RegisterUserPrefs(user_prefs);
118  PasswordManager::RegisterUserPrefs(user_prefs);
119  chrome_browser_net::RegisterUserPrefs(user_prefs);
120  DownloadPrefs::RegisterUserPrefs(user_prefs);
121  bookmark_utils::RegisterUserPrefs(user_prefs);
122  TabContents::RegisterUserPrefs(user_prefs);
123  TemplateURLPrepopulateData::RegisterUserPrefs(user_prefs);
124  ExtensionDOMUI::RegisterUserPrefs(user_prefs);
125  ExtensionsUI::RegisterUserPrefs(user_prefs);
126  FlagsUI::RegisterUserPrefs(user_prefs);
127  NewTabUI::RegisterUserPrefs(user_prefs);
128  PluginsUI::RegisterUserPrefs(user_prefs);
129  ProfileImpl::RegisterUserPrefs(user_prefs);
130  HostContentSettingsMap::RegisterUserPrefs(user_prefs);
131  HostZoomMap::RegisterUserPrefs(user_prefs);
132  DevToolsManager::RegisterUserPrefs(user_prefs);
133  PinnedTabCodec::RegisterUserPrefs(user_prefs);
134  ExtensionPrefs::RegisterUserPrefs(user_prefs);
135  GeolocationContentSettingsMap::RegisterUserPrefs(user_prefs);
136  TranslatePrefs::RegisterUserPrefs(user_prefs);
137  DesktopNotificationService::RegisterUserPrefs(user_prefs);
138  PrefProxyConfigService::RegisterUserPrefs(user_prefs);
139#if defined(TOOLKIT_VIEWS)
140  BrowserActionsContainer::RegisterUserPrefs(user_prefs);
141#elif defined(TOOLKIT_GTK)
142  BrowserWindowGtk::RegisterUserPrefs(user_prefs);
143#endif
144#if defined(OS_CHROMEOS)
145  chromeos::Preferences::RegisterUserPrefs(user_prefs);
146#endif
147  BackgroundContentsService::RegisterUserPrefs(user_prefs);
148  SigninManager::RegisterUserPrefs(user_prefs);
149  TemplateURLModel::RegisterUserPrefs(user_prefs);
150  InstantController::RegisterUserPrefs(user_prefs);
151  NetPrefObserver::RegisterPrefs(user_prefs);
152}
153
154}  // namespace browser
155