Chromium Code Reviews| 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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 213 // chrome/browser/protector/protected_prefs_watcher.cc in source | 214 // chrome/browser/protector/protected_prefs_watcher.cc in source |
| 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 // The AutomaticProfileResetter service, which has since been unimplemented, | |
| 225 // used this preference to save that the profile reset prompt had already been | |
| 226 // shown. We keep the name here for now so that we can clear out legacy values. | |
| 227 // TODO(engedy): Remove this and usages in M42 or later. See crbug.com/398813. | |
| 228 const char kProfileResetPromptMemento[] = "profile.reset_prompt_memento"; | |
|
gab
2014/09/03 14:51:39
Shall we instead use a new pref name? I think it w
engedy
2014/09/04 11:59:45
For Profile Prefs, I think the current name is ver
| |
| 229 #endif | 224 #endif |
| 230 | 225 |
| 231 } // namespace | 226 } // namespace |
| 232 | 227 |
| 233 namespace chrome { | 228 namespace chrome { |
| 234 | 229 |
| 235 void RegisterLocalState(PrefRegistrySimple* registry) { | 230 void RegisterLocalState(PrefRegistrySimple* registry) { |
| 236 // Prefs in Local State. | 231 // Prefs in Local State. |
| 237 registry->RegisterIntegerPref(prefs::kMultipleProfilePrefMigration, 0); | 232 registry->RegisterIntegerPref(prefs::kMultipleProfilePrefMigration, 0); |
| 238 | 233 |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 283 | 278 |
| 284 #if defined(ENABLE_PLUGIN_INSTALLATION) | 279 #if defined(ENABLE_PLUGIN_INSTALLATION) |
| 285 PluginsResourceService::RegisterPrefs(registry); | 280 PluginsResourceService::RegisterPrefs(registry); |
| 286 #endif | 281 #endif |
| 287 | 282 |
| 288 #if defined(ENABLE_TASK_MANAGER) | 283 #if defined(ENABLE_TASK_MANAGER) |
| 289 TaskManager::RegisterPrefs(registry); | 284 TaskManager::RegisterPrefs(registry); |
| 290 #endif // defined(ENABLE_TASK_MANAGER) | 285 #endif // defined(ENABLE_TASK_MANAGER) |
| 291 | 286 |
| 292 #if !defined(OS_ANDROID) | 287 #if !defined(OS_ANDROID) |
| 288 AutomaticProfileResetterFactory::RegisterPrefs(registry); | |
| 293 BackgroundModeManager::RegisterPrefs(registry); | 289 BackgroundModeManager::RegisterPrefs(registry); |
| 294 RegisterBrowserPrefs(registry); | 290 RegisterBrowserPrefs(registry); |
| 295 #if !defined(OS_CHROMEOS) | 291 #if !defined(OS_CHROMEOS) |
| 296 RegisterDefaultBrowserPromptPrefs(registry); | 292 RegisterDefaultBrowserPromptPrefs(registry); |
| 297 #endif // !defined(OS_CHROMEOS) | 293 #endif // !defined(OS_CHROMEOS) |
| 298 #endif // !defined(OS_ANDROID) | 294 #endif // !defined(OS_ANDROID) |
| 299 | 295 |
| 300 #if defined(OS_CHROMEOS) | 296 #if defined(OS_CHROMEOS) |
| 301 ChromeOSMetricsProvider::RegisterPrefs(registry); | 297 ChromeOSMetricsProvider::RegisterPrefs(registry); |
| 302 chromeos::AudioDevicesPrefHandlerImpl::RegisterPrefs(registry); | 298 chromeos::AudioDevicesPrefHandlerImpl::RegisterPrefs(registry); |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 340 | 336 |
| 341 #if defined(OS_WIN) | 337 #if defined(OS_WIN) |
| 342 app_metro_launch::RegisterPrefs(registry); | 338 app_metro_launch::RegisterPrefs(registry); |
| 343 component_updater::RegisterPrefsForSwReporter(registry); | 339 component_updater::RegisterPrefsForSwReporter(registry); |
| 344 password_manager::PasswordManager::RegisterLocalPrefs(registry); | 340 password_manager::PasswordManager::RegisterLocalPrefs(registry); |
| 345 #endif | 341 #endif |
| 346 | 342 |
| 347 #if defined(TOOLKIT_VIEWS) | 343 #if defined(TOOLKIT_VIEWS) |
| 348 RegisterBrowserViewLocalPrefs(registry); | 344 RegisterBrowserViewLocalPrefs(registry); |
| 349 #endif | 345 #endif |
| 350 | |
| 351 // Preferences registered only for migration (clearing or moving to a new key) | |
| 352 // go here. | |
| 353 #if !defined(OS_ANDROID) | |
| 354 registry->RegisterDictionaryPref(kProfileResetPromptMemento); | |
| 355 #endif // !defined(OS_ANDROID) | |
| 356 } | 346 } |
| 357 | 347 |
| 358 // Register prefs applicable to all profiles. | 348 // Register prefs applicable to all profiles. |
| 359 void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { | 349 void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { |
| 360 TRACE_EVENT0("browser", "chrome::RegisterUserPrefs"); | 350 TRACE_EVENT0("browser", "chrome::RegisterUserPrefs"); |
| 361 // User prefs. Please keep this list alphabetized. | 351 // User prefs. Please keep this list alphabetized. |
| 362 autofill::AutofillManager::RegisterProfilePrefs(registry); | 352 autofill::AutofillManager::RegisterProfilePrefs(registry); |
| 363 bookmarks::RegisterProfilePrefs(registry); | 353 bookmarks::RegisterProfilePrefs(registry); |
| 364 sync_driver::SyncPrefs::RegisterProfilePrefs(registry); | 354 sync_driver::SyncPrefs::RegisterProfilePrefs(registry); |
| 365 ChromeContentBrowserClient::RegisterProfilePrefs(registry); | 355 ChromeContentBrowserClient::RegisterProfilePrefs(registry); |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 476 | 466 |
| 477 #if defined(TOOLKIT_VIEWS) | 467 #if defined(TOOLKIT_VIEWS) |
| 478 RegisterBrowserViewProfilePrefs(registry); | 468 RegisterBrowserViewProfilePrefs(registry); |
| 479 RegisterInvertBubbleUserPrefs(registry); | 469 RegisterInvertBubbleUserPrefs(registry); |
| 480 #endif | 470 #endif |
| 481 | 471 |
| 482 #if defined(USE_ASH) | 472 #if defined(USE_ASH) |
| 483 ash::RegisterChromeLauncherUserPrefs(registry); | 473 ash::RegisterChromeLauncherUserPrefs(registry); |
| 484 #endif | 474 #endif |
| 485 | 475 |
| 486 // Preferences registered only for migration (clearing or moving to a new key) | 476 // Prefs registered only for migration (clearing or moving to a new |
| 487 // go here. | 477 // key) go here. |
|
gab
2014/09/03 14:51:39
Leave this as it had been fixed.
engedy
2014/09/04 11:59:45
Done.
| |
| 488 registry->RegisterDictionaryPref( | 478 registry->RegisterDictionaryPref( |
| 489 kBackupPref, | 479 kBackupPref, |
| 490 new base::DictionaryValue(), | 480 new base::DictionaryValue(), |
| 491 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 481 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 492 #if !defined(OS_ANDROID) | 482 #if !defined(OS_ANDROID) |
| 493 registry->RegisterStringPref( | 483 registry->RegisterStringPref( |
| 494 kSyncPromoErrorMessage, | 484 kSyncPromoErrorMessage, |
| 495 std::string(), | 485 std::string(), |
| 496 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 486 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 497 #endif | 487 #endif |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 595 prefs::kLastPromptedGoogleURL, | 585 prefs::kLastPromptedGoogleURL, |
| 596 local_state->GetString(prefs::kLastPromptedGoogleURL)); | 586 local_state->GetString(prefs::kLastPromptedGoogleURL)); |
| 597 } | 587 } |
| 598 local_state->ClearPref(prefs::kLastPromptedGoogleURL); | 588 local_state->ClearPref(prefs::kLastPromptedGoogleURL); |
| 599 | 589 |
| 600 current_version |= GOOGLE_URL_TRACKER_PREFS; | 590 current_version |= GOOGLE_URL_TRACKER_PREFS; |
| 601 local_state->SetInteger(prefs::kMultipleProfilePrefMigration, | 591 local_state->SetInteger(prefs::kMultipleProfilePrefMigration, |
| 602 current_version); | 592 current_version); |
| 603 } | 593 } |
| 604 | 594 |
| 605 #if !defined(OS_ANDROID) | |
| 606 local_state->ClearPref(kProfileResetPromptMemento); | |
| 607 #endif | |
| 608 | |
| 609 #if defined(OS_CHROMEOS) | 595 #if defined(OS_CHROMEOS) |
| 610 chromeos::default_pinned_apps_field_trial::MigratePrefs(local_state); | 596 chromeos::default_pinned_apps_field_trial::MigratePrefs(local_state); |
| 611 #endif | 597 #endif |
| 612 | 598 |
| 613 #if defined(TOOLKIT_VIEWS) | 599 #if defined(TOOLKIT_VIEWS) |
| 614 MigrateBrowserTabStripPrefs(local_state); | 600 MigrateBrowserTabStripPrefs(local_state); |
| 615 #endif | 601 #endif |
| 616 } | 602 } |
| 617 | 603 |
| 618 } // namespace chrome | 604 } // namespace chrome |
| OLD | NEW |