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

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: Merge to head for commit. 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..b1186f8816c7cf545de5557e4808737b106ef405 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,13 @@ enum MigratedPreferences {
GOOGLE_URL_TRACKER_PREFS = 1 << 2,
};
+// A previous feature (see
+// 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.
+const char kBackupPref[] = "backup";
+
} // namespace
namespace chrome {
@@ -337,6 +345,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 +353,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 prefs from now-removed protector feature.
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