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

Unified Diff: chrome/browser/prefs/browser_prefs.cc

Issue 12330008: Get rid of the ability to unregister preferences. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix browser_tests that tested migration in PrefsTabHelper. 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/chromeos/login/oauth2_login_manager.cc ('k') | chrome/browser/prefs/pref_model_associator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/prefs/browser_prefs.cc
diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc
index 4a1cd3183e3d510740c1d7ec10d98742a54a3a2a..be917cbe2a40ef7e9aeab44814b68d1c3f455fb9 100644
--- a/chrome/browser/prefs/browser_prefs.cc
+++ b/chrome/browser/prefs/browser_prefs.cc
@@ -115,6 +115,7 @@
#include "chrome/browser/chromeos/customization_document.h"
#include "chrome/browser/chromeos/display/display_preferences.h"
#include "chrome/browser/chromeos/login/login_utils.h"
+#include "chrome/browser/chromeos/login/oauth2_login_manager.h"
#include "chrome/browser/chromeos/login/user_image_manager.h"
#include "chrome/browser/chromeos/login/user_manager.h"
#include "chrome/browser/chromeos/login/wallpaper_manager.h"
@@ -155,6 +156,9 @@ enum MigratedPreferences {
GOOGLE_URL_TRACKER_PREFS = 1 << 2,
};
+// Name of an old pref that is cleared in MigrateUserPrefs.
Mattias Nissler (ping if slow) 2013/02/20 17:17:27 I think it'd be nicer to actually have this in pre
Jói 2013/02/21 12:05:10 This wasn't in pref_names, it was in a .cc file th
+const char kBackupPref[] = "backup";
+
} // namespace
namespace chrome {
@@ -337,6 +341,7 @@ void RegisterUserPrefs(PrefService* user_prefs,
#endif
#if defined(OS_CHROMEOS)
+ chromeos::OAuth2LoginManager::RegisterUserPrefs(registry);
chromeos::Preferences::RegisterUserPrefs(registry);
chromeos::ProxyConfigServiceImpl::RegisterUserPrefs(registry);
#endif
@@ -344,21 +349,20 @@ void RegisterUserPrefs(PrefService* user_prefs,
#if defined(OS_WIN)
NetworkProfileBubble::RegisterUserPrefs(registry);
#endif
+
+ // Prefs registered only for migration (clearing or moving to a new
+ // key) go here.
+ registry->RegisterDictionaryPref(kBackupPref, new DictionaryValue(),
+ PrefRegistrySyncable::UNSYNCABLE_PREF);
}
void MigrateUserPrefs(Profile* profile) {
- // Cleanup old prefs.
- static const char kBackupPref[] = "backup";
PrefService* prefs = profile->GetPrefs();
- // TODO(joi): Fix to not require post-construction registration?
- scoped_refptr<PrefRegistrySyncable> registry(
- static_cast<PrefRegistrySyncable*>(prefs->DeprecatedGetPrefRegistry()));
- registry->RegisterDictionaryPref(kBackupPref, new DictionaryValue(),
- PrefRegistrySyncable::UNSYNCABLE_PREF);
+
+ // Cleanup old prefs.
prefs->ClearPref(kBackupPref);
- registry->DeprecatedUnregisterPreference(kBackupPref);
- PrefsTabHelper::MigrateUserPrefs(prefs, registry);
+ PrefsTabHelper::MigrateUserPrefs(prefs);
}
void MigrateBrowserPrefs(Profile* profile, PrefService* local_state) {
« no previous file with comments | « chrome/browser/chromeos/login/oauth2_login_manager.cc ('k') | chrome/browser/prefs/pref_model_associator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698