| 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/background_mode_manager.h" | 9 #include "chrome/browser/background/background_mode_manager.h" |
| 10 #include "chrome/browser/bookmarks/bookmark_model.h" | 10 #include "chrome/browser/bookmarks/bookmark_model.h" |
| 11 #include "chrome/browser/bookmarks/bookmark_utils.h" | 11 #include "chrome/browser/bookmarks/bookmark_utils.h" |
| 12 #include "chrome/browser/browser_shutdown.h" | 12 #include "chrome/browser/browser_shutdown.h" |
| 13 #include "chrome/browser/content_settings/cookie_settings.h" | 13 #include "chrome/browser/content_settings/cookie_settings.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_window.h" | 16 #include "chrome/browser/debugger/devtools_window.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/apps_promo.h" |
| 19 #include "chrome/browser/extensions/component_loader.h" |
| 19 #include "chrome/browser/extensions/extension_prefs.h" | 20 #include "chrome/browser/extensions/extension_prefs.h" |
| 20 #include "chrome/browser/extensions/extension_web_ui.h" | 21 #include "chrome/browser/extensions/extension_web_ui.h" |
| 21 #include "chrome/browser/external_protocol/external_protocol_handler.h" | 22 #include "chrome/browser/external_protocol/external_protocol_handler.h" |
| 22 #include "chrome/browser/geolocation/geolocation_prefs.h" | 23 #include "chrome/browser/geolocation/geolocation_prefs.h" |
| 23 #include "chrome/browser/google/google_url_tracker.h" | 24 #include "chrome/browser/google/google_url_tracker.h" |
| 24 #include "chrome/browser/instant/instant_controller.h" | 25 #include "chrome/browser/instant/instant_controller.h" |
| 25 #include "chrome/browser/intranet_redirect_detector.h" | 26 #include "chrome/browser/intranet_redirect_detector.h" |
| 26 #include "chrome/browser/metrics/metrics_log.h" | 27 #include "chrome/browser/metrics/metrics_log.h" |
| 27 #include "chrome/browser/metrics/metrics_service.h" | 28 #include "chrome/browser/metrics/metrics_service.h" |
| 28 #include "chrome/browser/net/http_server_properties_manager.h" | 29 #include "chrome/browser/net/http_server_properties_manager.h" |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 PresentationModePrefs::RegisterUserPrefs(user_prefs); | 188 PresentationModePrefs::RegisterUserPrefs(user_prefs); |
| 188 #endif | 189 #endif |
| 189 #if defined(ENABLE_CONFIGURATION_POLICY) | 190 #if defined(ENABLE_CONFIGURATION_POLICY) |
| 190 policy::URLBlacklistManager::RegisterPrefs(user_prefs); | 191 policy::URLBlacklistManager::RegisterPrefs(user_prefs); |
| 191 #endif | 192 #endif |
| 192 SyncPromoUI::RegisterUserPrefs(user_prefs); | 193 SyncPromoUI::RegisterUserPrefs(user_prefs); |
| 193 chrome_browser_net::HttpServerPropertiesManager::RegisterPrefs(user_prefs); | 194 chrome_browser_net::HttpServerPropertiesManager::RegisterPrefs(user_prefs); |
| 194 #if !defined(OS_CHROMEOS) | 195 #if !defined(OS_CHROMEOS) |
| 195 default_apps::RegisterUserPrefs(user_prefs); | 196 default_apps::RegisterUserPrefs(user_prefs); |
| 196 #endif | 197 #endif |
| 198 extensions::ComponentLoader::RegisterUserPrefs(user_prefs); |
| 197 } | 199 } |
| 198 | 200 |
| 199 void MigrateBrowserPrefs(PrefService* user_prefs, PrefService* local_state) { | 201 void MigrateBrowserPrefs(PrefService* user_prefs, PrefService* local_state) { |
| 200 // Copy pref values which have been migrated to user_prefs from local_state, | 202 // Copy pref values which have been migrated to user_prefs from local_state, |
| 201 // or remove them from local_state outright, if copying is not required. | 203 // or remove them from local_state outright, if copying is not required. |
| 202 int current_version = | 204 int current_version = |
| 203 local_state->GetInteger(prefs::kMultipleProfilePrefMigration); | 205 local_state->GetInteger(prefs::kMultipleProfilePrefMigration); |
| 204 | 206 |
| 205 if ((current_version & WINDOWS_PREFS) == 0) { | 207 if ((current_version & WINDOWS_PREFS) == 0) { |
| 206 // Migrate the devtools split location preference. | 208 // Migrate the devtools split location preference. |
| (...skipping 13 matching lines...) Expand all Loading... |
| 220 user_prefs->Set(prefs::kBrowserWindowPlacement, *(pref->GetValue())); | 222 user_prefs->Set(prefs::kBrowserWindowPlacement, *(pref->GetValue())); |
| 221 } | 223 } |
| 222 local_state->ClearPref(prefs::kBrowserWindowPlacement); | 224 local_state->ClearPref(prefs::kBrowserWindowPlacement); |
| 223 | 225 |
| 224 local_state->SetInteger(prefs::kMultipleProfilePrefMigration, | 226 local_state->SetInteger(prefs::kMultipleProfilePrefMigration, |
| 225 current_version | WINDOWS_PREFS); | 227 current_version | WINDOWS_PREFS); |
| 226 } | 228 } |
| 227 } | 229 } |
| 228 | 230 |
| 229 } // namespace browser | 231 } // namespace browser |
| OLD | NEW |