Chromium Code Reviews| Index: chrome/browser/prefs/browser_prefs.cc |
| diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc |
| index 88209877b10658772773b51080be1881dd9f9620..da97658fea8d4898a059a0cd5efb71cbb6c70f3d 100644 |
| --- a/chrome/browser/prefs/browser_prefs.cc |
| +++ b/chrome/browser/prefs/browser_prefs.cc |
| @@ -230,7 +230,7 @@ enum MigratedPreferences { |
| // chrome/browser/protector/protected_prefs_watcher.cc in source |
| // control history) used this string as a prefix for various prefs it |
| // registered. We keep it here for now to clear out those old prefs in |
| -// MigrateUserPrefs. |
| +// MigrateObsoleteProfilePrefs. |
| const char kBackupPref[] = "backup"; |
|
gab
2015/02/23 16:09:38
Remove it completely.
rkaplow
2015/02/23 22:55:04
Done.
|
| #if !defined(OS_ANDROID) |
| @@ -247,8 +247,6 @@ const char kLegacyProfileResetPromptMemento[] = "profile.reset_prompt_memento"; |
| namespace chrome { |
| void RegisterLocalState(PrefRegistrySimple* registry) { |
| - // Prefs in Local State. |
| - registry->RegisterIntegerPref(prefs::kMultipleProfilePrefMigration, 0); |
| // Please keep this list alphabetized. |
| AppListService::RegisterPrefs(registry); |
| @@ -555,76 +553,40 @@ void RegisterLoginProfilePrefs(user_prefs::PrefRegistrySyncable* registry) { |
| } |
| #endif |
| -void MigrateUserPrefs(Profile* profile) { |
| - PrefService* prefs = profile->GetPrefs(); |
| +void MigrateObsoleteProfilePrefs(PrefService* profile_prefs) { |
| + // This method should prune away migrations year+ old. |
|
gab
2015/02/23 16:09:38
s/migrations year+ old/year+ old migrations/
gab
2015/02/23 16:09:38
s/should prune away/should be pruned from/
(i.e.
rkaplow
2015/02/23 22:55:04
Done.
rkaplow
2015/02/23 22:55:04
true, wording was odd ;)
|
| + |
| +#if defined(OS_MACOSX) && !defined(OS_IOS) |
| + // Added 06/2014. |
| + autofill::AutofillManager::MigrateUserPrefs(profile_prefs); |
| +#endif // defined(OS_MACOSX) && !defined(OS_IOS) |
| - // Cleanup prefs from now-removed protector feature. |
| - prefs->ClearPref(kBackupPref); |
| + // Added 07/2014. |
| + translate::TranslatePrefs::MigrateUserPrefs(profile_prefs, |
| + prefs::kAcceptLanguages); |
| #if !defined(OS_ANDROID) |
| + // Added 08/2014. |
| // Migrate kNetworkPredictionEnabled to kNetworkPredictionOptions when not on |
| // Android. On Android, platform-specific code performs preference migration. |
| // TODO(bnc): https://crbug.com/401970 Remove migration code one year after |
| // M38. |
| - chrome_browser_net::MigrateNetworkPredictionUserPrefs(prefs); |
| + chrome_browser_net::MigrateNetworkPredictionUserPrefs(profile_prefs); |
| #endif |
| - |
| - PromoResourceService::MigrateUserPrefs(prefs); |
| - translate::TranslatePrefs::MigrateUserPrefs(prefs, prefs::kAcceptLanguages); |
| - |
| -#if defined(OS_MACOSX) && !defined(OS_IOS) |
| - autofill::AutofillManager::MigrateUserPrefs(prefs); |
| -#endif // defined(OS_MACOSX) && !defined(OS_IOS) |
| } |
|
gab
2015/02/23 16:09:38
Looks like you'll need to sync/merge again for the
rkaplow
2015/02/23 22:55:04
Done.
|
| -void MigrateBrowserPrefs(Profile* profile, PrefService* local_state) { |
| - // Copy pref values which have been migrated to user_prefs from local_state, |
| - // or remove them from local_state outright, if copying is not required. |
| - int current_version = |
| - local_state->GetInteger(prefs::kMultipleProfilePrefMigration); |
| - PrefRegistrySimple* registry = static_cast<PrefRegistrySimple*>( |
| - local_state->DeprecatedGetPrefRegistry()); |
|
gab
2015/02/23 16:09:38
Woot, one less call to DeprecatedGetPrefRegistry()
rkaplow
2015/02/23 23:27:52
:)
|
| - |
| - if (!(current_version & DNS_PREFS)) { |
|
gab
2015/02/23 16:09:37
Looks like you can now also get rid of the enum de
rkaplow
2015/02/23 23:27:52
Done.
|
| - registry->RegisterListPref(prefs::kDnsStartupPrefetchList); |
| - local_state->ClearPref(prefs::kDnsStartupPrefetchList); |
| - |
| - registry->RegisterListPref(prefs::kDnsHostReferralList); |
| - local_state->ClearPref(prefs::kDnsHostReferralList); |
| +void MigrateObsoleteBrowserPrefs(PrefService* local_state) { |
| + // This method should prune away migrations year+ old. |
|
gab
2015/02/23 16:09:37
Same comments as above.
rkaplow
2015/02/23 22:55:04
Done.
|
| - current_version |= DNS_PREFS; |
| - local_state->SetInteger(prefs::kMultipleProfilePrefMigration, |
| - current_version); |
| - } |
| - |
| - PrefService* user_prefs = profile->GetPrefs(); |
| - if (!(current_version & WINDOWS_PREFS)) { |
| - registry->RegisterDictionaryPref(prefs::kBrowserWindowPlacement); |
| - if (local_state->HasPrefPath(prefs::kBrowserWindowPlacement)) { |
| - const PrefService::Preference* pref = |
| - local_state->FindPreference(prefs::kBrowserWindowPlacement); |
| - DCHECK(pref); |
| - user_prefs->Set(prefs::kBrowserWindowPlacement, |
| - *(pref->GetValue())); |
| - } |
| - local_state->ClearPref(prefs::kBrowserWindowPlacement); |
| - |
| - current_version |= WINDOWS_PREFS; |
| - local_state->SetInteger(prefs::kMultipleProfilePrefMigration, |
| - current_version); |
| - } |
| + // Added 05/2014. |
| +#if defined(TOOLKIT_VIEWS) |
| + MigrateBrowserTabStripPrefs(local_state); |
| +#endif |
| + // Added 08/2014. |
| #if !defined(OS_ANDROID) |
| local_state->ClearPref(kLegacyProfileResetPromptMemento); |
| #endif |
| - |
| -#if defined(OS_CHROMEOS) |
| - chromeos::default_pinned_apps_field_trial::MigratePrefs(local_state); |
|
gab
2015/02/23 16:09:38
Also clean up this no longer call method (and all
rkaplow
2015/02/23 23:27:52
Done.
|
| -#endif |
| - |
| -#if defined(TOOLKIT_VIEWS) |
| - MigrateBrowserTabStripPrefs(local_state); |
|
gab
2015/02/23 16:09:38
Also remove call (and associated registrations) @
rkaplow
2015/02/23 23:27:52
Done.
|
| -#endif |
| } |
| // As part of the migration from per-profile to per-partition HostZoomMaps, |