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

Unified Diff: chrome/browser/extensions/api/content_settings/content_settings_store.cc

Issue 2419413002: Deleted CONTENT_SETTINGS_TYPE_FULLSCREEN and MOUSELOCK. (Closed)
Patch Set: Fix more things. 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
Index: chrome/browser/extensions/api/content_settings/content_settings_store.cc
diff --git a/chrome/browser/extensions/api/content_settings/content_settings_store.cc b/chrome/browser/extensions/api/content_settings/content_settings_store.cc
index dd3179de8b0506a609d713d3da7c9fba99647906..3df22217d4eda7481216e34241e2ca84cd04c33c 100644
--- a/chrome/browser/extensions/api/content_settings/content_settings_store.cc
+++ b/chrome/browser/extensions/api/content_settings/content_settings_store.cc
@@ -319,15 +319,18 @@ void ContentSettingsStore::SetExtensionContentSettingFromList(
dict->GetString(keys::kContentSettingsTypeKey, &content_settings_type_str);
ContentSettingsType content_settings_type =
helpers::StringToContentSettingsType(content_settings_type_str);
- if (content_settings_type == CONTENT_SETTINGS_TYPE_FULLSCREEN ||
- content_settings_type == CONTENT_SETTINGS_TYPE_MOUSELOCK) {
- // Fullscreen and mouselock are deprecated. Skip over settings of these
- // types, effectively deleting them from the in-memory model. This will
- // implicitly delete these old settings from the pref store when it is
- // written back.
+ if (content_settings_type == CONTENT_SETTINGS_TYPE_DEFAULT) {
+ // We'll end up with DEFAULT here if the type string isn't recognised.
+ // This could be if it's a string from an old settings type that has been
+ // deleted. DCHECK to make sure this is the case (not some random string).
+ DCHECK(content_settings_type_str == "fullscreen" ||
+ content_settings_type_str == "mouselock");
+
+ // In this case, we just skip over that setting, effectively deleting it
+ // from the in-memory model. This will implicitly delete these old
+ // settings from the pref store when it is written back.
continue;
}
- DCHECK_NE(CONTENT_SETTINGS_TYPE_DEFAULT, content_settings_type);
std::string resource_identifier;
dict->GetString(keys::kResourceIdentifierKey, &resource_identifier);

Powered by Google App Engine
This is Rietveld 408576698