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