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

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

Issue 12086077: Only permit plug-in loads in the browser if the plug-in isn't blocked or the (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 7 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
Index: chrome/browser/plugins/plugin_info_message_filter.cc
===================================================================
--- chrome/browser/plugins/plugin_info_message_filter.cc (revision 179787)
+++ chrome/browser/plugins/plugin_info_message_filter.cc (working copy)
@@ -10,6 +10,7 @@
#include "base/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/plugins/chrome_plugin_service_filter.h"
#include "chrome/browser/plugins/plugin_finder.h"
#include "chrome/browser/plugins/plugin_metadata.h"
#include "chrome/browser/prefs/pref_service.h"
@@ -132,6 +133,8 @@
output.group_name = plugin_metadata->name();
}
+ context_.GrantAccess(output.status, output.plugin.path);
+
ChromeViewHostMsg_GetPluginInfo::WriteReplyParams(reply_msg, output);
Send(reply_msg);
}
@@ -225,7 +228,7 @@
PluginService::GetInstance()->GetFilter();
size_t i = 0;
for (; i < matching_plugins.size(); ++i) {
- if (!filter || filter->ShouldUsePlugin(render_process_id_,
+ if (!filter || filter->IsPluginEnabled(render_process_id_,
render_view_id,
resource_context_,
url,
@@ -289,3 +292,14 @@
info.primary_pattern == ContentSettingsPattern::Wildcard() &&
info.secondary_pattern == ContentSettingsPattern::Wildcard();
}
+
+void PluginInfoMessageFilter::Context::GrantAccess(
+ const ChromeViewHostMsg_GetPluginInfo_Status& status,
+ const FilePath& path) const {
+ if (status.value == ChromeViewHostMsg_GetPluginInfo_Status::kAllowed ||
+ status.value == ChromeViewHostMsg_GetPluginInfo_Status::kClickToPlay) {
+ ChromePluginServiceFilter::GetInstance()->AuthorizePlugin(
+ render_process_id_, path);
+ }
+}
+

Powered by Google App Engine
This is Rietveld 408576698