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

Unified Diff: chrome/browser/ui/content_settings/content_setting_bubble_model.cc

Issue 2510363003: Only activate radio buttons in ContentSettingsBubble for valid content settings. This prevents fail… (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
Index: chrome/browser/ui/content_settings/content_setting_bubble_model.cc
diff --git a/chrome/browser/ui/content_settings/content_setting_bubble_model.cc b/chrome/browser/ui/content_settings/content_setting_bubble_model.cc
index 421b6e0cd2912cddad178074c8590fca0d60beb8..339ea888ccb36438e5132f0d7009c21ad6ca7482 100644
--- a/chrome/browser/ui/content_settings/content_setting_bubble_model.cc
+++ b/chrome/browser/ui/content_settings/content_setting_bubble_model.cc
@@ -401,7 +401,12 @@ void ContentSettingSingleRadioGroup::SetRadioGroup() {
setting == CONTENT_SETTING_BLOCK &&
PluginUtils::ShouldPreferHtmlOverPlugins(
HostContentSettingsMapFactory::GetForProfile(profile()));
- set_radio_group_enabled(setting_source == SETTING_SOURCE_USER &&
+
+ const auto* map = HostContentSettingsMapFactory::GetForProfile(profile());
+ // Prevent creation of content settings for illegal urls like about:blank
+ bool is_valid = map->CanSetNarrowestContentSetting(url, url, content_type());
+
+ set_radio_group_enabled(is_valid && setting_source == SETTING_SOURCE_USER &&
!flash_hidden_from_plugin_list);
selected_item_ = radio_group.default_item;

Powered by Google App Engine
This is Rietveld 408576698