| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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 <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/debug/trace_event.h" | 9 #include "base/debug/trace_event.h" |
| 10 #include "base/prefs/pref_registry_simple.h" | 10 #include "base/prefs/pref_registry_simple.h" |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 | 128 |
| 129 #if defined(ENABLE_PLUGIN_INSTALLATION) | 129 #if defined(ENABLE_PLUGIN_INSTALLATION) |
| 130 #include "chrome/browser/plugins/plugins_resource_service.h" | 130 #include "chrome/browser/plugins/plugins_resource_service.h" |
| 131 #endif | 131 #endif |
| 132 | 132 |
| 133 #if defined(OS_ANDROID) | 133 #if defined(OS_ANDROID) |
| 134 #include "chrome/browser/android/bookmarks/partner_bookmarks_shim.h" | 134 #include "chrome/browser/android/bookmarks/partner_bookmarks_shim.h" |
| 135 #include "chrome/browser/android/new_tab_page_prefs.h" | 135 #include "chrome/browser/android/new_tab_page_prefs.h" |
| 136 #else | 136 #else |
| 137 #include "chrome/browser/notifications/sync_notifier/chrome_notifier_service.h" | 137 #include "chrome/browser/notifications/sync_notifier/chrome_notifier_service.h" |
| 138 #include "chrome/browser/profile_resetter/automatic_profile_resetter_factory.h" |
| 138 #include "chrome/browser/ui/autofill/generated_credit_card_bubble_controller.h" | 139 #include "chrome/browser/ui/autofill/generated_credit_card_bubble_controller.h" |
| 139 #endif | 140 #endif |
| 140 | 141 |
| 141 #if defined(OS_CHROMEOS) | 142 #if defined(OS_CHROMEOS) |
| 142 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" | 143 #include "chrome/browser/chromeos/app_mode/kiosk_app_manager.h" |
| 143 #include "chrome/browser/chromeos/attestation/platform_verification_flow.h" | 144 #include "chrome/browser/chromeos/attestation/platform_verification_flow.h" |
| 144 #include "chrome/browser/chromeos/audio/audio_devices_pref_handler_impl.h" | 145 #include "chrome/browser/chromeos/audio/audio_devices_pref_handler_impl.h" |
| 145 #include "chrome/browser/chromeos/customization_document.h" | 146 #include "chrome/browser/chromeos/customization_document.h" |
| 146 #include "chrome/browser/chromeos/display/display_preferences.h" | 147 #include "chrome/browser/chromeos/display/display_preferences.h" |
| 147 #include "chrome/browser/chromeos/extensions/echo_private_api.h" | 148 #include "chrome/browser/chromeos/extensions/echo_private_api.h" |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 214 // control history) used this string as a prefix for various prefs it | 215 // control history) used this string as a prefix for various prefs it |
| 215 // registered. We keep it here for now to clear out those old prefs in | 216 // registered. We keep it here for now to clear out those old prefs in |
| 216 // MigrateUserPrefs. | 217 // MigrateUserPrefs. |
| 217 const char kBackupPref[] = "backup"; | 218 const char kBackupPref[] = "backup"; |
| 218 | 219 |
| 219 #if !defined(OS_ANDROID) | 220 #if !defined(OS_ANDROID) |
| 220 // The sync promo error message preference has been removed; this pref will | 221 // The sync promo error message preference has been removed; this pref will |
| 221 // be cleared from user data. | 222 // be cleared from user data. |
| 222 const char kSyncPromoErrorMessage[] = "sync_promo.error_message"; | 223 const char kSyncPromoErrorMessage[] = "sync_promo.error_message"; |
| 223 | 224 |
| 224 // The AutomaticProfileResetter service, which has since been unimplemented, | 225 // The AutomaticProfileResetter service used this preference to save that the |
| 225 // used this preference to save that the profile reset prompt had already been | 226 // profile reset prompt had already been shown, however, the preference has been |
| 226 // shown. We keep the name here for now so that we can clear out legacy values. | 227 // renamed in Local State. We keep the name here for now so that we can clear |
| 228 // out legacy values. |
| 227 // TODO(engedy): Remove this and usages in M42 or later. See crbug.com/398813. | 229 // TODO(engedy): Remove this and usages in M42 or later. See crbug.com/398813. |
| 228 const char kProfileResetPromptMemento[] = "profile.reset_prompt_memento"; | 230 const char kLegacyProfileResetPromptMemento[] = "profile.reset_prompt_memento"; |
| 229 #endif | 231 #endif |
| 230 | 232 |
| 231 } // namespace | 233 } // namespace |
| 232 | 234 |
| 233 namespace chrome { | 235 namespace chrome { |
| 234 | 236 |
| 235 void RegisterLocalState(PrefRegistrySimple* registry) { | 237 void RegisterLocalState(PrefRegistrySimple* registry) { |
| 236 // Prefs in Local State. | 238 // Prefs in Local State. |
| 237 registry->RegisterIntegerPref(prefs::kMultipleProfilePrefMigration, 0); | 239 registry->RegisterIntegerPref(prefs::kMultipleProfilePrefMigration, 0); |
| 238 | 240 |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 | 285 |
| 284 #if defined(ENABLE_PLUGIN_INSTALLATION) | 286 #if defined(ENABLE_PLUGIN_INSTALLATION) |
| 285 PluginsResourceService::RegisterPrefs(registry); | 287 PluginsResourceService::RegisterPrefs(registry); |
| 286 #endif | 288 #endif |
| 287 | 289 |
| 288 #if defined(ENABLE_TASK_MANAGER) | 290 #if defined(ENABLE_TASK_MANAGER) |
| 289 TaskManager::RegisterPrefs(registry); | 291 TaskManager::RegisterPrefs(registry); |
| 290 #endif // defined(ENABLE_TASK_MANAGER) | 292 #endif // defined(ENABLE_TASK_MANAGER) |
| 291 | 293 |
| 292 #if !defined(OS_ANDROID) | 294 #if !defined(OS_ANDROID) |
| 295 AutomaticProfileResetterFactory::RegisterPrefs(registry); |
| 293 BackgroundModeManager::RegisterPrefs(registry); | 296 BackgroundModeManager::RegisterPrefs(registry); |
| 294 RegisterBrowserPrefs(registry); | 297 RegisterBrowserPrefs(registry); |
| 295 #if !defined(OS_CHROMEOS) | 298 #if !defined(OS_CHROMEOS) |
| 296 RegisterDefaultBrowserPromptPrefs(registry); | 299 RegisterDefaultBrowserPromptPrefs(registry); |
| 297 #endif // !defined(OS_CHROMEOS) | 300 #endif // !defined(OS_CHROMEOS) |
| 298 #endif // !defined(OS_ANDROID) | 301 #endif // !defined(OS_ANDROID) |
| 299 | 302 |
| 300 #if defined(OS_CHROMEOS) | 303 #if defined(OS_CHROMEOS) |
| 301 ChromeOSMetricsProvider::RegisterPrefs(registry); | 304 ChromeOSMetricsProvider::RegisterPrefs(registry); |
| 302 chromeos::AudioDevicesPrefHandlerImpl::RegisterPrefs(registry); | 305 chromeos::AudioDevicesPrefHandlerImpl::RegisterPrefs(registry); |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 password_manager::PasswordManager::RegisterLocalPrefs(registry); | 347 password_manager::PasswordManager::RegisterLocalPrefs(registry); |
| 345 #endif | 348 #endif |
| 346 | 349 |
| 347 #if defined(TOOLKIT_VIEWS) | 350 #if defined(TOOLKIT_VIEWS) |
| 348 RegisterBrowserViewLocalPrefs(registry); | 351 RegisterBrowserViewLocalPrefs(registry); |
| 349 #endif | 352 #endif |
| 350 | 353 |
| 351 // Preferences registered only for migration (clearing or moving to a new key) | 354 // Preferences registered only for migration (clearing or moving to a new key) |
| 352 // go here. | 355 // go here. |
| 353 #if !defined(OS_ANDROID) | 356 #if !defined(OS_ANDROID) |
| 354 registry->RegisterDictionaryPref(kProfileResetPromptMemento); | 357 registry->RegisterDictionaryPref(kLegacyProfileResetPromptMemento); |
| 355 #endif // !defined(OS_ANDROID) | 358 #endif // !defined(OS_ANDROID) |
| 356 } | 359 } |
| 357 | 360 |
| 358 // Register prefs applicable to all profiles. | 361 // Register prefs applicable to all profiles. |
| 359 void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { | 362 void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { |
| 360 TRACE_EVENT0("browser", "chrome::RegisterUserPrefs"); | 363 TRACE_EVENT0("browser", "chrome::RegisterUserPrefs"); |
| 361 // User prefs. Please keep this list alphabetized. | 364 // User prefs. Please keep this list alphabetized. |
| 362 autofill::AutofillManager::RegisterProfilePrefs(registry); | 365 autofill::AutofillManager::RegisterProfilePrefs(registry); |
| 363 bookmarks::RegisterProfilePrefs(registry); | 366 bookmarks::RegisterProfilePrefs(registry); |
| 364 sync_driver::SyncPrefs::RegisterProfilePrefs(registry); | 367 sync_driver::SyncPrefs::RegisterProfilePrefs(registry); |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 596 local_state->GetString(prefs::kLastPromptedGoogleURL)); | 599 local_state->GetString(prefs::kLastPromptedGoogleURL)); |
| 597 } | 600 } |
| 598 local_state->ClearPref(prefs::kLastPromptedGoogleURL); | 601 local_state->ClearPref(prefs::kLastPromptedGoogleURL); |
| 599 | 602 |
| 600 current_version |= GOOGLE_URL_TRACKER_PREFS; | 603 current_version |= GOOGLE_URL_TRACKER_PREFS; |
| 601 local_state->SetInteger(prefs::kMultipleProfilePrefMigration, | 604 local_state->SetInteger(prefs::kMultipleProfilePrefMigration, |
| 602 current_version); | 605 current_version); |
| 603 } | 606 } |
| 604 | 607 |
| 605 #if !defined(OS_ANDROID) | 608 #if !defined(OS_ANDROID) |
| 606 local_state->ClearPref(kProfileResetPromptMemento); | 609 local_state->ClearPref(kLegacyProfileResetPromptMemento); |
| 607 #endif | 610 #endif |
| 608 | 611 |
| 609 #if defined(OS_CHROMEOS) | 612 #if defined(OS_CHROMEOS) |
| 610 chromeos::default_pinned_apps_field_trial::MigratePrefs(local_state); | 613 chromeos::default_pinned_apps_field_trial::MigratePrefs(local_state); |
| 611 #endif | 614 #endif |
| 612 | 615 |
| 613 #if defined(TOOLKIT_VIEWS) | 616 #if defined(TOOLKIT_VIEWS) |
| 614 MigrateBrowserTabStripPrefs(local_state); | 617 MigrateBrowserTabStripPrefs(local_state); |
| 615 #endif | 618 #endif |
| 616 } | 619 } |
| 617 | 620 |
| 618 } // namespace chrome | 621 } // namespace chrome |
| OLD | NEW |