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

Unified Diff: components/content_settings/core/browser/content_settings_pref_provider.cc

Issue 2428433002: Delete fullscreen/mouselock pref data. (Closed)
Patch Set: Rebase. Created 4 years, 1 month 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 | « components/content_settings/core/browser/content_settings_pref_provider.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/content_settings/core/browser/content_settings_pref_provider.cc
diff --git a/components/content_settings/core/browser/content_settings_pref_provider.cc b/components/content_settings/core/browser/content_settings_pref_provider.cc
index 8d451633e2c74e43f097bb7f6c52349dfea9e8e3..843bbedcae25cbdbe5a7787a82f93b608fc1d692 100644
--- a/components/content_settings/core/browser/content_settings_pref_provider.cc
+++ b/components/content_settings/core/browser/content_settings_pref_provider.cc
@@ -33,6 +33,22 @@
namespace content_settings {
+namespace {
+
+// These settings are no longer used, and should be deleted on profile startup.
+// NOTE: Do not use the CONTENT_SETTINGS_TYPE_* constants, as these will soon be
+// deleted.
+#if !defined(OS_IOS)
+const char kObsoleteFullscreenExceptionsPref[] =
+ "profile.content_settings.exceptions.fullscreen";
+#if !defined(OS_ANDROID)
+const char kObsoleteMouseLockExceptionsPref[] =
+ "profile.content_settings.exceptions.mouselock";
+#endif // !defined(OS_ANDROID)
+#endif // !defined(OS_IOS)
+
+} // namespace
+
// ////////////////////////////////////////////////////////////////////////////
// PrefProvider:
//
@@ -67,6 +83,8 @@ PrefProvider::PrefProvider(PrefService* prefs, bool incognito)
return;
}
+ DiscardObsoletePreferences();
+
pref_change_registrar_.Init(prefs_);
WebsiteSettingsRegistry* website_settings =
@@ -187,4 +205,15 @@ void PrefProvider::Notify(
resource_identifier);
}
+void PrefProvider::DiscardObsoletePreferences() {
+ // These prefs aren't registered on iOS/Android so they can't (and don't need
+ // to) be deleted.
+#if !defined(OS_IOS)
+ prefs_->ClearPref(kObsoleteFullscreenExceptionsPref);
+#if !defined(OS_ANDROID)
+ prefs_->ClearPref(kObsoleteMouseLockExceptionsPref);
+#endif // !defined(OS_ANDROID)
+#endif // !defined(OS_IOS)
+}
+
} // namespace content_settings
« no previous file with comments | « components/content_settings/core/browser/content_settings_pref_provider.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698