Index: chrome/browser/prefs/browser_prefs.cc |
=================================================================== |
--- chrome/browser/prefs/browser_prefs.cc (revision 71191) |
+++ chrome/browser/prefs/browser_prefs.cc (working copy) |
@@ -54,6 +54,7 @@ |
#include "chrome/browser/translate/translate_prefs.h" |
#include "chrome/browser/ui/browser.h" |
#include "chrome/browser/upgrade_detector.h" |
+#include "chrome/common/pref_names.h" |
#if defined(TOOLKIT_VIEWS) // TODO(port): whittle this down as we port |
#include "chrome/browser/ui/views/browser_actions_container.h" |
@@ -155,4 +156,32 @@ |
NetPrefObserver::RegisterPrefs(user_prefs); |
} |
+void ClearObsoletePrefs(PrefService* user_prefs, PrefService* local_state) { |
+ // Remove prefs which have been moved to user_prefs from local_state. |
+ int current_version = |
+ user_prefs->GetInteger(prefs::kMultipleProfilePrefMigration); |
+ switch (current_version) { |
+ case 0: |
+ // Remove the dns preferences. |
+ local_state->RegisterListPref(prefs::kDnsStartupPrefetchList); |
+ local_state->RegisterListPref(prefs::kDnsHostReferralList); |
+ local_state->ClearPref(prefs::kDnsStartupPrefetchList); |
+ local_state->ClearPref(prefs::kDnsHostReferralList); |
+ // FALL THROUGH |
+ |
+ case 1: |
+ // Remove the devtools preference. |
+ local_state->RegisterIntegerPref(prefs::kDevToolsSplitLocation, -1); |
+ local_state->ClearPref(prefs::kDevToolsSplitLocation); |
+ |
+ // Remove the browser preferences. |
+ local_state->RegisterDictionaryPref(prefs::kBrowserWindowPlacement); |
+ local_state->ClearPref(prefs::kBrowserWindowPlacement); |
+ // FALL THROUGH |
+ |
+ // In the last case, set the new state of the preferences migration. |
+ user_prefs->SetInteger(prefs::kMultipleProfilePrefMigration, 2); |
+ } |
+} |
+ |
} // namespace browser |