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

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

Issue 11066043: Block NPAPI plug-ins in Metro mode instead of not loading them at all. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 2 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
Index: chrome/browser/renderer_host/plugin_info_message_filter.cc
diff --git a/chrome/browser/renderer_host/plugin_info_message_filter.cc b/chrome/browser/renderer_host/plugin_info_message_filter.cc
index 3054e49c8af55b7345050c55fbfc58a3a0a3a03c..0d3ef6b8d7ef0943bb62134e3d448955645431c8 100644
--- a/chrome/browser/renderer_host/plugin_info_message_filter.cc
+++ b/chrome/browser/renderer_host/plugin_info_message_filter.cc
@@ -24,6 +24,10 @@
#include "googleurl/src/gurl.h"
#include "webkit/plugins/npapi/plugin_list.h"
+#if defined(OS_WIN)
+#include "base/win/metro.h"
+#endif
+
using content::PluginService;
using webkit::WebPluginInfo;
@@ -135,6 +139,17 @@ void PluginInfoMessageFilter::Context::DecidePluginStatus(
*group_name = plugin_metadata->name();
*group_identifier = plugin_metadata->identifier();
+#if defined(OS_WIN)
+ if (base::win::IsMetroProcess()) {
+ // In metro mode we only allow pepper plugins.
+ if (plugin.type == WebPluginInfo::PLUGIN_TYPE_NPAPI) {
+ status->value =
+ ChromeViewHostMsg_GetPluginInfo_Status::kNpapiNotSupported;
+ return;
+ }
+ }
+#endif
+
ContentSetting plugin_setting = CONTENT_SETTING_DEFAULT;
bool uses_default_content_setting = true;
// Check plug-in content settings. The primary URL is the top origin URL and

Powered by Google App Engine
This is Rietveld 408576698