Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(674)

Unified Diff: chrome/browser/ui/prefs/prefs_tab_helper.cc

Issue 12330008: Get rid of the ability to unregister preferences. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/prefs/prefs_tab_helper.h ('k') | chrome/common/pref_names.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/prefs/prefs_tab_helper.cc
diff --git a/chrome/browser/ui/prefs/prefs_tab_helper.cc b/chrome/browser/ui/prefs/prefs_tab_helper.cc
index b9da3e826b5d22a5bfadb1ddf59b478f7c00f7bb..c6c9ccbfd223062aebece0ccea624b795fff9246 100644
--- a/chrome/browser/ui/prefs/prefs_tab_helper.cc
+++ b/chrome/browser/ui/prefs/prefs_tab_helper.cc
@@ -576,20 +576,18 @@ void PrefsTabHelper::RegisterUserPrefs(PrefRegistrySyncable* registry) {
registry->RegisterStringPref(prefs::kRecentlySelectedEncoding,
"",
PrefRegistrySyncable::UNSYNCABLE_PREF);
-}
-void PrefsTabHelper::MigrateUserPrefs(PrefService* prefs,
- PrefRegistrySyncable* registry) {
RegisterPrefsToMigrate(registry);
+}
+
+void PrefsTabHelper::MigrateUserPrefs(PrefService* prefs) {
for (int i = 0; i < kPrefsToMigrateLength; ++i) {
const PrefService::Preference* pref =
prefs->FindPreference(kPrefNamesToMigrate[i].from);
- if (!pref) continue;
- if (!pref->IsDefaultValue()) {
+ if (pref && !pref->IsDefaultValue()) {
prefs->Set(kPrefNamesToMigrate[i].to, *pref->GetValue());
+ prefs->ClearPref(kPrefNamesToMigrate[i].from);
Jói 2013/02/20 15:34:50 Note, I moved this here since there seems no need
}
- prefs->ClearPref(kPrefNamesToMigrate[i].from);
- registry->DeprecatedUnregisterPreference(kPrefNamesToMigrate[i].from);
}
}
« no previous file with comments | « chrome/browser/ui/prefs/prefs_tab_helper.h ('k') | chrome/common/pref_names.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698