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

Unified Diff: chrome/browser/plugins/plugin_info_message_filter.cc

Issue 134233002: Disable the Run option in context menu for blocked plugins if they were blocked by policy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix 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/plugins/plugin_info_message_filter.h ('k') | chrome/common/render_messages.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/plugins/plugin_info_message_filter.cc
diff --git a/chrome/browser/plugins/plugin_info_message_filter.cc b/chrome/browser/plugins/plugin_info_message_filter.cc
index 71870a48df9fe91ea9b0b8387ab4761286f6b179..2995751a1948b7e01d61941583c1eac884c41290 100644
--- a/chrome/browser/plugins/plugin_info_message_filter.cc
+++ b/chrome/browser/plugins/plugin_info_message_filter.cc
@@ -219,11 +219,12 @@ void PluginInfoMessageFilter::Context::DecidePluginStatus(
ContentSetting plugin_setting = CONTENT_SETTING_DEFAULT;
bool uses_default_content_setting = true;
+ bool is_managed = false;
// Check plug-in content settings. The primary URL is the top origin URL and
// the secondary URL is the plug-in URL.
GetPluginContentSetting(plugin, params.top_origin_url, params.url,
plugin_metadata->identifier(), &plugin_setting,
- &uses_default_content_setting);
+ &uses_default_content_setting, &is_managed);
DCHECK(plugin_setting != CONTENT_SETTING_DEFAULT);
PluginMetadata::SecurityStatus plugin_status =
@@ -272,10 +273,13 @@ void PluginInfoMessageFilter::Context::DecidePluginStatus(
return;
}
- if (plugin_setting == CONTENT_SETTING_ASK)
- status->value = ChromeViewHostMsg_GetPluginInfo_Status::kClickToPlay;
- else if (plugin_setting == CONTENT_SETTING_BLOCK)
- status->value = ChromeViewHostMsg_GetPluginInfo_Status::kBlocked;
+ if (plugin_setting == CONTENT_SETTING_ASK) {
+ status->value = ChromeViewHostMsg_GetPluginInfo_Status::kClickToPlay;
+ } else if (plugin_setting == CONTENT_SETTING_BLOCK) {
+ status->value =
+ is_managed ? ChromeViewHostMsg_GetPluginInfo_Status::kBlockedByPolicy
+ : ChromeViewHostMsg_GetPluginInfo_Status::kBlocked;
+ }
if (status->value == ChromeViewHostMsg_GetPluginInfo_Status::kAllowed) {
// Allow an embedder of <webview> to block a plugin from being loaded inside
@@ -344,7 +348,8 @@ void PluginInfoMessageFilter::Context::GetPluginContentSetting(
const GURL& plugin_url,
const std::string& resource,
ContentSetting* setting,
- bool* uses_default_content_setting) const {
+ bool* uses_default_content_setting,
+ bool* is_managed) const {
scoped_ptr<base::Value> value;
content_settings::SettingInfo info;
bool uses_plugin_specific_setting = false;
@@ -371,6 +376,7 @@ void PluginInfoMessageFilter::Context::GetPluginContentSetting(
!uses_plugin_specific_setting &&
info.primary_pattern == ContentSettingsPattern::Wildcard() &&
info.secondary_pattern == ContentSettingsPattern::Wildcard();
+ *is_managed = info.source == content_settings::SETTING_SOURCE_POLICY;
}
void PluginInfoMessageFilter::Context::MaybeGrantAccess(
« no previous file with comments | « chrome/browser/plugins/plugin_info_message_filter.h ('k') | chrome/common/render_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698