| 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/prefs/browser_prefs.h" | 5 #include "chrome/browser/prefs/browser_prefs.h" | 
| 6 | 6 | 
| 7 #include "chrome/browser/about_flags.h" | 7 #include "chrome/browser/about_flags.h" | 
| 8 #include "chrome/browser/autofill/autofill_manager.h" | 8 #include "chrome/browser/autofill/autofill_manager.h" | 
| 9 #include "chrome/browser/background_contents_service.h" | 9 #include "chrome/browser/background_contents_service.h" | 
| 10 #include "chrome/browser/background_mode_manager.h" | 10 #include "chrome/browser/background_mode_manager.h" | 
| 11 #include "chrome/browser/background_page_tracker.h" | 11 #include "chrome/browser/background_page_tracker.h" | 
| 12 #include "chrome/browser/bookmarks/bookmark_utils.h" | 12 #include "chrome/browser/bookmarks/bookmark_utils.h" | 
| 13 #include "chrome/browser/browser_shutdown.h" | 13 #include "chrome/browser/browser_shutdown.h" | 
| 14 #include "chrome/browser/content_settings/host_content_settings_map.h" | 14 #include "chrome/browser/content_settings/host_content_settings_map.h" | 
| 15 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" | 15 #include "chrome/browser/custom_handlers/protocol_handler_registry.h" | 
| 16 #include "chrome/browser/debugger/devtools_manager.h" | 16 #include "chrome/browser/debugger/devtools_manager.h" | 
| 17 #include "chrome/browser/download/download_prefs.h" | 17 #include "chrome/browser/download/download_prefs.h" | 
|  | 18 #include "chrome/browser/extensions/apps_promo.h" | 
| 18 #include "chrome/browser/extensions/extension_prefs.h" | 19 #include "chrome/browser/extensions/extension_prefs.h" | 
| 19 #include "chrome/browser/extensions/extension_web_ui.h" | 20 #include "chrome/browser/extensions/extension_web_ui.h" | 
| 20 #include "chrome/browser/extensions/extensions_ui.h" | 21 #include "chrome/browser/extensions/extensions_ui.h" | 
| 21 #include "chrome/browser/external_protocol_handler.h" | 22 #include "chrome/browser/external_protocol_handler.h" | 
| 22 #include "chrome/browser/geolocation/geolocation_content_settings_map.h" | 23 #include "chrome/browser/geolocation/geolocation_content_settings_map.h" | 
| 23 #include "chrome/browser/geolocation/geolocation_prefs.h" | 24 #include "chrome/browser/geolocation/geolocation_prefs.h" | 
| 24 #include "chrome/browser/google/google_url_tracker.h" | 25 #include "chrome/browser/google/google_url_tracker.h" | 
| 25 #include "chrome/browser/instant/instant_controller.h" | 26 #include "chrome/browser/instant/instant_controller.h" | 
| 26 #include "chrome/browser/intranet_redirect_detector.h" | 27 #include "chrome/browser/intranet_redirect_detector.h" | 
| 27 #include "chrome/browser/metrics/metrics_log.h" | 28 #include "chrome/browser/metrics/metrics_log.h" | 
| (...skipping 19 matching lines...) Expand all  Loading... | 
| 47 #include "chrome/browser/tabs/pinned_tab_codec.h" | 48 #include "chrome/browser/tabs/pinned_tab_codec.h" | 
| 48 #include "chrome/browser/task_manager/task_manager.h" | 49 #include "chrome/browser/task_manager/task_manager.h" | 
| 49 #include "chrome/browser/translate/translate_prefs.h" | 50 #include "chrome/browser/translate/translate_prefs.h" | 
| 50 #include "chrome/browser/ui/browser.h" | 51 #include "chrome/browser/ui/browser.h" | 
| 51 #include "chrome/browser/ui/search_engines/keyword_editor_controller.h" | 52 #include "chrome/browser/ui/search_engines/keyword_editor_controller.h" | 
| 52 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 53 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 
| 53 #include "chrome/browser/ui/webui/flags_ui.h" | 54 #include "chrome/browser/ui/webui/flags_ui.h" | 
| 54 #include "chrome/browser/ui/webui/new_tab_ui.h" | 55 #include "chrome/browser/ui/webui/new_tab_ui.h" | 
| 55 #include "chrome/browser/ui/webui/plugins_ui.h" | 56 #include "chrome/browser/ui/webui/plugins_ui.h" | 
| 56 #include "chrome/browser/upgrade_detector.h" | 57 #include "chrome/browser/upgrade_detector.h" | 
|  | 58 #include "chrome/browser/web_resource/promo_resource_service.h" | 
| 57 #include "chrome/common/pref_names.h" | 59 #include "chrome/common/pref_names.h" | 
| 58 #include "content/browser/host_zoom_map.h" | 60 #include "content/browser/host_zoom_map.h" | 
| 59 | 61 | 
| 60 #if defined(TOOLKIT_VIEWS)  // TODO(port): whittle this down as we port | 62 #if defined(TOOLKIT_VIEWS)  // TODO(port): whittle this down as we port | 
| 61 #include "chrome/browser/ui/views/browser_actions_container.h" | 63 #include "chrome/browser/ui/views/browser_actions_container.h" | 
| 62 #include "chrome/browser/ui/views/frame/browser_view.h" | 64 #include "chrome/browser/ui/views/frame/browser_view.h" | 
| 63 #endif | 65 #endif | 
| 64 | 66 | 
| 65 #if defined(TOOLKIT_GTK) | 67 #if defined(TOOLKIT_GTK) | 
| 66 #include "chrome/browser/ui/gtk/browser_window_gtk.h" | 68 #include "chrome/browser/ui/gtk/browser_window_gtk.h" | 
| 67 #endif | 69 #endif | 
| 68 | 70 | 
| 69 #if defined(OS_CHROMEOS) | 71 #if defined(OS_CHROMEOS) | 
| 70 #include "chrome/browser/chromeos/audio_mixer_alsa.h" | 72 #include "chrome/browser/chromeos/audio_mixer_alsa.h" | 
| 71 #include "chrome/browser/chromeos/login/apply_services_customization.h" | 73 #include "chrome/browser/chromeos/login/apply_services_customization.h" | 
| 72 #include "chrome/browser/chromeos/login/signed_settings_temp_storage.h" | 74 #include "chrome/browser/chromeos/login/signed_settings_temp_storage.h" | 
| 73 #include "chrome/browser/chromeos/login/user_manager.h" | 75 #include "chrome/browser/chromeos/login/user_manager.h" | 
| 74 #include "chrome/browser/chromeos/login/wizard_controller.h" | 76 #include "chrome/browser/chromeos/login/wizard_controller.h" | 
| 75 #include "chrome/browser/chromeos/preferences.h" | 77 #include "chrome/browser/chromeos/preferences.h" | 
| 76 #include "chrome/browser/chromeos/status/input_method_menu.h" | 78 #include "chrome/browser/chromeos/status/input_method_menu.h" | 
| 77 #include "chrome/browser/chromeos/user_cros_settings_provider.h" | 79 #include "chrome/browser/chromeos/user_cros_settings_provider.h" | 
| 78 #endif | 80 #endif | 
| 79 | 81 | 
| 80 namespace browser { | 82 namespace browser { | 
| 81 | 83 | 
| 82 void RegisterLocalState(PrefService* local_state) { | 84 void RegisterLocalState(PrefService* local_state) { | 
| 83   // Prefs in Local State | 85   // Prefs in Local State | 
|  | 86   AppsPromo::RegisterPrefs(local_state); | 
| 84   Browser::RegisterPrefs(local_state); | 87   Browser::RegisterPrefs(local_state); | 
| 85   FlagsUI::RegisterPrefs(local_state); | 88   FlagsUI::RegisterPrefs(local_state); | 
| 86   WebCacheManager::RegisterPrefs(local_state); | 89   WebCacheManager::RegisterPrefs(local_state); | 
| 87   ExternalProtocolHandler::RegisterPrefs(local_state); | 90   ExternalProtocolHandler::RegisterPrefs(local_state); | 
| 88   GoogleURLTracker::RegisterPrefs(local_state); | 91   GoogleURLTracker::RegisterPrefs(local_state); | 
| 89   IntranetRedirectDetector::RegisterPrefs(local_state); | 92   IntranetRedirectDetector::RegisterPrefs(local_state); | 
| 90   KeywordEditorController::RegisterPrefs(local_state); | 93   KeywordEditorController::RegisterPrefs(local_state); | 
| 91   MetricsLog::RegisterPrefs(local_state); | 94   MetricsLog::RegisterPrefs(local_state); | 
| 92   MetricsService::RegisterPrefs(local_state); | 95   MetricsService::RegisterPrefs(local_state); | 
|  | 96   PromoResourceService::RegisterPrefs(local_state); | 
| 93   SafeBrowsingService::RegisterPrefs(local_state); | 97   SafeBrowsingService::RegisterPrefs(local_state); | 
| 94   browser_shutdown::RegisterPrefs(local_state); | 98   browser_shutdown::RegisterPrefs(local_state); | 
| 95 #if defined(TOOLKIT_VIEWS) | 99 #if defined(TOOLKIT_VIEWS) | 
| 96   BrowserView::RegisterBrowserViewPrefs(local_state); | 100   BrowserView::RegisterBrowserViewPrefs(local_state); | 
| 97 #endif | 101 #endif | 
| 98   UpgradeDetector::RegisterPrefs(local_state); | 102   UpgradeDetector::RegisterPrefs(local_state); | 
| 99   TaskManager::RegisterPrefs(local_state); | 103   TaskManager::RegisterPrefs(local_state); | 
| 100   geolocation::RegisterPrefs(local_state); | 104   geolocation::RegisterPrefs(local_state); | 
| 101   AutofillManager::RegisterBrowserPrefs(local_state); | 105   AutofillManager::RegisterBrowserPrefs(local_state); | 
| 102   BackgroundPageTracker::RegisterPrefs(local_state); | 106   BackgroundPageTracker::RegisterPrefs(local_state); | 
| 103   NotificationUIManager::RegisterPrefs(local_state); | 107   NotificationUIManager::RegisterPrefs(local_state); | 
| 104   PrefProxyConfigService::RegisterPrefs(local_state); | 108   PrefProxyConfigService::RegisterPrefs(local_state); | 
| 105   policy::BrowserPolicyConnector::RegisterPrefs(local_state); | 109   policy::BrowserPolicyConnector::RegisterPrefs(local_state); | 
| 106 #if defined(OS_CHROMEOS) | 110 #if defined(OS_CHROMEOS) | 
| 107   chromeos::AudioMixerAlsa::RegisterPrefs(local_state); | 111   chromeos::AudioMixerAlsa::RegisterPrefs(local_state); | 
| 108   chromeos::UserManager::RegisterPrefs(local_state); | 112   chromeos::UserManager::RegisterPrefs(local_state); | 
| 109   chromeos::UserCrosSettingsProvider::RegisterPrefs(local_state); | 113   chromeos::UserCrosSettingsProvider::RegisterPrefs(local_state); | 
| 110   WizardController::RegisterPrefs(local_state); | 114   WizardController::RegisterPrefs(local_state); | 
| 111   chromeos::InputMethodMenu::RegisterPrefs(local_state); | 115   chromeos::InputMethodMenu::RegisterPrefs(local_state); | 
| 112   chromeos::ApplyServicesCustomization::RegisterPrefs(local_state); | 116   chromeos::ApplyServicesCustomization::RegisterPrefs(local_state); | 
| 113   chromeos::SignedSettingsTempStorage::RegisterPrefs(local_state); | 117   chromeos::SignedSettingsTempStorage::RegisterPrefs(local_state); | 
| 114 #endif | 118 #endif | 
| 115 } | 119 } | 
| 116 | 120 | 
| 117 void RegisterUserPrefs(PrefService* user_prefs) { | 121 void RegisterUserPrefs(PrefService* user_prefs) { | 
| 118   // User prefs | 122   // User prefs | 
|  | 123   AppsPromo::RegisterUserPrefs(user_prefs); | 
| 119   AutofillManager::RegisterUserPrefs(user_prefs); | 124   AutofillManager::RegisterUserPrefs(user_prefs); | 
| 120   SessionStartupPref::RegisterUserPrefs(user_prefs); | 125   SessionStartupPref::RegisterUserPrefs(user_prefs); | 
| 121   Browser::RegisterUserPrefs(user_prefs); | 126   Browser::RegisterUserPrefs(user_prefs); | 
| 122   PasswordManager::RegisterUserPrefs(user_prefs); | 127   PasswordManager::RegisterUserPrefs(user_prefs); | 
| 123   chrome_browser_net::RegisterUserPrefs(user_prefs); | 128   chrome_browser_net::RegisterUserPrefs(user_prefs); | 
| 124   DownloadPrefs::RegisterUserPrefs(user_prefs); | 129   DownloadPrefs::RegisterUserPrefs(user_prefs); | 
| 125   bookmark_utils::RegisterUserPrefs(user_prefs); | 130   bookmark_utils::RegisterUserPrefs(user_prefs); | 
| 126   TabContentsWrapper::RegisterUserPrefs(user_prefs); | 131   TabContentsWrapper::RegisterUserPrefs(user_prefs); | 
| 127   TemplateURLPrepopulateData::RegisterUserPrefs(user_prefs); | 132   TemplateURLPrepopulateData::RegisterUserPrefs(user_prefs); | 
| 128   ExtensionWebUI::RegisterUserPrefs(user_prefs); | 133   ExtensionWebUI::RegisterUserPrefs(user_prefs); | 
| 129   ExtensionsUI::RegisterUserPrefs(user_prefs); | 134   ExtensionsUI::RegisterUserPrefs(user_prefs); | 
| 130   NewTabUI::RegisterUserPrefs(user_prefs); | 135   NewTabUI::RegisterUserPrefs(user_prefs); | 
| 131   PluginsUI::RegisterUserPrefs(user_prefs); | 136   PluginsUI::RegisterUserPrefs(user_prefs); | 
| 132   ProfileImpl::RegisterUserPrefs(user_prefs); | 137   ProfileImpl::RegisterUserPrefs(user_prefs); | 
|  | 138   PromoResourceService::RegisterUserPrefs(user_prefs); | 
| 133   HostContentSettingsMap::RegisterUserPrefs(user_prefs); | 139   HostContentSettingsMap::RegisterUserPrefs(user_prefs); | 
| 134   HostZoomMap::RegisterUserPrefs(user_prefs); | 140   HostZoomMap::RegisterUserPrefs(user_prefs); | 
| 135   DevToolsManager::RegisterUserPrefs(user_prefs); | 141   DevToolsManager::RegisterUserPrefs(user_prefs); | 
| 136   PinnedTabCodec::RegisterUserPrefs(user_prefs); | 142   PinnedTabCodec::RegisterUserPrefs(user_prefs); | 
| 137   ExtensionPrefs::RegisterUserPrefs(user_prefs); | 143   ExtensionPrefs::RegisterUserPrefs(user_prefs); | 
| 138   GeolocationContentSettingsMap::RegisterUserPrefs(user_prefs); | 144   GeolocationContentSettingsMap::RegisterUserPrefs(user_prefs); | 
| 139   TranslatePrefs::RegisterUserPrefs(user_prefs); | 145   TranslatePrefs::RegisterUserPrefs(user_prefs); | 
| 140   DesktopNotificationService::RegisterUserPrefs(user_prefs); | 146   DesktopNotificationService::RegisterUserPrefs(user_prefs); | 
| 141   PrefProxyConfigService::RegisterPrefs(user_prefs); | 147   PrefProxyConfigService::RegisterPrefs(user_prefs); | 
| 142 #if defined(TOOLKIT_VIEWS) | 148 #if defined(TOOLKIT_VIEWS) | 
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 182       user_prefs->Set(prefs::kBrowserWindowPlacement, *(pref->GetValue())); | 188       user_prefs->Set(prefs::kBrowserWindowPlacement, *(pref->GetValue())); | 
| 183     } | 189     } | 
| 184     local_state->ClearPref(prefs::kBrowserWindowPlacement); | 190     local_state->ClearPref(prefs::kBrowserWindowPlacement); | 
| 185 | 191 | 
| 186     local_state->SetInteger(prefs::kMultipleProfilePrefMigration, | 192     local_state->SetInteger(prefs::kMultipleProfilePrefMigration, | 
| 187                             current_version | WINDOWS_PREFS); | 193                             current_version | WINDOWS_PREFS); | 
| 188   } | 194   } | 
| 189 } | 195 } | 
| 190 | 196 | 
| 191 }  // namespace browser | 197 }  // namespace browser | 
| OLD | NEW | 
|---|