| 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.
|
| +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) {
|
|
|