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 9a15415a236673d54e8491f1d6d93d6fc9b35be0..1acc624455e3d7927bd3ef0232a5cddd646ffedf 100644 |
--- a/chrome/browser/plugins/plugin_info_message_filter.cc |
+++ b/chrome/browser/plugins/plugin_info_message_filter.cc |
@@ -11,6 +11,7 @@ |
#include "base/strings/utf_string_conversions.h" |
#include "chrome/browser/content_settings/content_settings_utils.h" |
#include "chrome/browser/content_settings/host_content_settings_map.h" |
+#include "chrome/browser/extensions/extension_renderer_state.h" |
#include "chrome/browser/plugins/chrome_plugin_service_filter.h" |
#include "chrome/browser/plugins/plugin_finder.h" |
#include "chrome/browser/plugins/plugin_metadata.h" |
@@ -199,6 +200,17 @@ void PluginInfoMessageFilter::Context::DecidePluginStatus( |
return; |
} |
#endif |
+ if (plugin.type == WebPluginInfo::PLUGIN_TYPE_NPAPI) { |
+ CHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)); |
+ // NPAPI plugins are not supported inside <webview> guests. |
+ ExtensionRendererState::WebViewInfo info; |
+ if (ExtensionRendererState::GetInstance()->GetWebViewInfo( |
+ render_process_id_, params.render_view_id, &info)) { |
+ status->value = |
+ ChromeViewHostMsg_GetPluginInfo_Status::kNPAPINotSupported; |
Bernhard Bauer
2013/09/26 06:19:39
On Windows in Metro mode (see above) this triggers
sadrul
2013/09/26 06:43:23
It won't. Infobars are not supported for guests in
Bernhard Bauer
2013/09/26 06:56:33
Oh, I see, the PluginPermissionFilter filters the
sadrul
2013/09/26 06:59:52
The PluginPermissionHelper doesn't actually handle
Bernhard Bauer
2013/09/26 08:39:09
Hm, I thought we DCHECK if we can't find a handler
sadrul
2013/09/26 15:35:26
Done.
|
+ return; |
+ } |
+ } |
ContentSetting plugin_setting = CONTENT_SETTING_DEFAULT; |
bool uses_default_content_setting = true; |
@@ -250,6 +262,19 @@ void PluginInfoMessageFilter::Context::DecidePluginStatus( |
status->value = ChromeViewHostMsg_GetPluginInfo_Status::kClickToPlay; |
else if (plugin_setting == CONTENT_SETTING_BLOCK) |
status->value = ChromeViewHostMsg_GetPluginInfo_Status::kBlocked; |
+ |
+ if (status->value == ChromeViewHostMsg_GetPluginInfo_Status::kAllowed) { |
+ // Allow an embedder of <webview> to block a plugin from being loaded inside |
+ // the guest. In order to do this, set the status to 'Unauthorized' here, |
+ // and update the status as appropriate depending on the response from the |
+ // embedder. |
+ ExtensionRendererState::WebViewInfo info; |
+ if (ExtensionRendererState::GetInstance()->GetWebViewInfo( |
+ render_process_id_, params.render_view_id, &info)) { |
+ status->value = |
+ ChromeViewHostMsg_GetPluginInfo_Status::kUnauthorized; |
+ } |
+ } |
} |
bool PluginInfoMessageFilter::Context::FindEnabledPlugin( |