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

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

Issue 271673006: Eliminate all code related to the AutomaticProfileResetter. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added hard deadline for removing migration code. Created 6 years, 5 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
Index: chrome/browser/prefs/browser_prefs.cc
diff --git a/chrome/browser/prefs/browser_prefs.cc b/chrome/browser/prefs/browser_prefs.cc
index dfdb4ae803749ec10fec75b5e4367ff65785a5e8..af6e423d89da9755151982a2b44ce041af771086 100644
--- a/chrome/browser/prefs/browser_prefs.cc
+++ b/chrome/browser/prefs/browser_prefs.cc
@@ -136,7 +136,6 @@
#include "chrome/browser/android/new_tab_page_prefs.h"
#else
#include "chrome/browser/notifications/sync_notifier/chrome_notifier_service.h"
-#include "chrome/browser/profile_resetter/automatic_profile_resetter_factory.h"
#include "chrome/browser/ui/autofill/generated_credit_card_bubble_controller.h"
#endif
@@ -221,6 +220,13 @@ const char kBackupPref[] = "backup";
// The sync promo error message preference has been removed; this pref will
// be cleared from user data.
const char kSyncPromoErrorMessage[] = "sync_promo.error_message";
+
+// The AutomaticProfileResetter service, which has been unimplemented, used to
+// use this preference to save that the profile reset prompt had already been
+// shown. We keep the name here for now so that we can clear out legacy values
+// that might be retained in Preferences and/or Local State.
+// TODO(engedy): Remove this and usages in M42 or later. See crbug.com/398813.
+const char kProfileResetPromptMemento[] = "profile.reset_prompt_memento";
#endif
} // namespace
@@ -286,7 +292,6 @@ void RegisterLocalState(PrefRegistrySimple* registry) {
#endif // defined(ENABLE_TASK_MANAGER)
#if !defined(OS_ANDROID)
- AutomaticProfileResetterFactory::RegisterPrefs(registry);
BackgroundModeManager::RegisterPrefs(registry);
RegisterBrowserPrefs(registry);
#if !defined(OS_CHROMEOS)
@@ -343,6 +348,12 @@ void RegisterLocalState(PrefRegistrySimple* registry) {
#if defined(TOOLKIT_VIEWS)
RegisterBrowserViewLocalPrefs(registry);
#endif
+
+ // Preferences registered only for migration (clearing or moving to a new key)
+ // go here.
+ #if !defined(OS_ANDROID)
+ registry->RegisterDictionaryPref(kProfileResetPromptMemento);
+ #endif // !defined(OS_ANDROID)
}
// Register prefs applicable to all profiles.
@@ -476,8 +487,8 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {
ash::RegisterChromeLauncherUserPrefs(registry);
#endif
- // Prefs registered only for migration (clearing or moving to a new
- // key) go here.
+ // Preferences registered only for migration (clearing or moving to a new key)
+ // go here.
registry->RegisterDictionaryPref(
kBackupPref,
new base::DictionaryValue(),
@@ -487,6 +498,10 @@ void RegisterProfilePrefs(user_prefs::PrefRegistrySyncable* registry) {
kSyncPromoErrorMessage,
std::string(),
user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
+ registry->RegisterStringPref(
+ kProfileResetPromptMemento,
+ std::string(),
+ user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
#endif
}
@@ -522,6 +537,10 @@ void MigrateUserPrefs(Profile* profile) {
prefs->ClearPref(kSyncPromoErrorMessage);
#endif
+#if !defined(OS_ANDROID)
+ prefs->ClearPref(kProfileResetPromptMemento);
+#endif
+
PromoResourceService::MigrateUserPrefs(prefs);
translate::TranslatePrefs::MigrateUserPrefs(prefs, prefs::kAcceptLanguages);
@@ -590,6 +609,10 @@ void MigrateBrowserPrefs(Profile* profile, PrefService* local_state) {
current_version);
}
+#if !defined(OS_ANDROID)
+ local_state->ClearPref(kProfileResetPromptMemento);
+#endif
+
#if defined(OS_CHROMEOS)
chromeos::default_pinned_apps_field_trial::MigratePrefs(local_state);
#endif

Powered by Google App Engine
This is Rietveld 408576698