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..6474930879684f6952d103e9285f80c9e899ffaf 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_managed_setting(setting_source != SETTING_SOURCE_USER); |
if (setting_source != SETTING_SOURCE_USER) { |
set_radio_group_enabled(false); |
} else { |
@@ -449,9 +451,16 @@ ContentSettingPluginBubbleModel::ContentSettingPluginBubbleModel( |
: ContentSettingSingleRadioGroup( |
delegate, web_contents, profile, content_type) { |
DCHECK_EQ(content_type, CONTENT_SETTINGS_TYPE_PLUGINS); |
- set_custom_link_enabled(web_contents && |
- TabSpecificContentSettings::FromWebContents( |
- web_contents)->load_plugins_link_enabled()); |
+ // 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. |
+ if (managed_setting()) { |
+ set_custom_link_enabled(false); |
Bernhard Bauer
2014/01/07 18:08:00
There is a way to combine these logical expression
markusheintz_
2014/01/07 18:42:22
Done.
|
+ } else { |
+ set_custom_link_enabled(web_contents && |
+ TabSpecificContentSettings::FromWebContents( |
+ web_contents)->load_plugins_link_enabled()); |
+ } |
} |
ContentSettingPluginBubbleModel::~ContentSettingPluginBubbleModel() { |
@@ -1263,7 +1272,8 @@ ContentSettingBubbleModel::ContentSettingBubbleModel( |
ContentSettingsType content_type) |
: web_contents_(web_contents), |
profile_(profile), |
- content_type_(content_type) { |
+ content_type_(content_type), |
+ managed_setting_(false) { |
registrar_.Add(this, content::NOTIFICATION_WEB_CONTENTS_DESTROYED, |
content::Source<WebContents>(web_contents)); |
registrar_.Add(this, chrome::NOTIFICATION_PROFILE_DESTROYED, |