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

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

Issue 126143002: Disable the "run all plugins" link on the plugins settings bubble if the setting is managed. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 6 years, 11 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
« no previous file with comments | « chrome/browser/ui/content_settings/content_setting_bubble_model.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 882eca24316cda6f9b0292c8749dd06052ab883a..9ec9944023f9ed0aaa0a513c90c215e4237370b2 100644
--- a/chrome/browser/ui/content_settings/content_setting_bubble_model.cc
+++ b/chrome/browser/ui/content_settings/content_setting_bubble_model.cc
@@ -361,6 +361,8 @@ void ContentSettingSingleRadioGroup::SetRadioGroup() {
radio_group.default_item = 1;
block_setting_ = setting;
}
+
+ set_setting_is_managed(setting_source != SETTING_SOURCE_USER);
if (setting_source != SETTING_SOURCE_USER) {
set_radio_group_enabled(false);
} else {
@@ -449,7 +451,11 @@ ContentSettingPluginBubbleModel::ContentSettingPluginBubbleModel(
: ContentSettingSingleRadioGroup(
delegate, web_contents, profile, content_type) {
DCHECK_EQ(content_type, CONTENT_SETTINGS_TYPE_PLUGINS);
- set_custom_link_enabled(web_contents &&
+ // Disable the "Run all plugins this time" link if the setting is managed and
+ // can't be controlled by the user or if the user already clicked on the link
+ // and ran all plugins.
+ set_custom_link_enabled(!setting_is_managed() &&
+ web_contents &&
TabSpecificContentSettings::FromWebContents(
web_contents)->load_plugins_link_enabled());
}
@@ -1263,7 +1269,8 @@ ContentSettingBubbleModel::ContentSettingBubbleModel(
ContentSettingsType content_type)
: web_contents_(web_contents),
profile_(profile),
- content_type_(content_type) {
+ content_type_(content_type),
+ setting_is_managed_(false) {
registrar_.Add(this, content::NOTIFICATION_WEB_CONTENTS_DESTROYED,
content::Source<WebContents>(web_contents));
registrar_.Add(this, chrome::NOTIFICATION_PROFILE_DESTROYED,
« no previous file with comments | « chrome/browser/ui/content_settings/content_setting_bubble_model.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698