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

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

Issue 10951029: Removes PluginInfoMessageFilter dependency on PluginGroup. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: fixed conflict Created 8 years, 3 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/renderer_host/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/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 f495ab6059a9c00917551af55254a856448be087..026836338701943a9a077e12a3dcbe318ea3757e 100644
--- a/chrome/browser/renderer_host/plugin_info_message_filter.cc
+++ b/chrome/browser/renderer_host/plugin_info_message_filter.cc
@@ -9,6 +9,8 @@
#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/plugin_finder.h"
+#include "chrome/browser/plugins/plugin_installer.h"
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/chrome_content_client.h"
@@ -22,11 +24,6 @@
#include "webkit/plugins/npapi/plugin_group.h"
#include "webkit/plugins/npapi/plugin_list.h"
-#if defined(ENABLE_PLUGIN_INSTALLATION)
-#include "chrome/browser/plugins/plugin_finder.h"
-#include "chrome/browser/plugins/plugin_installer.h"
-#endif
-
using content::PluginService;
using webkit::WebPluginInfo;
@@ -110,36 +107,30 @@ void PluginInfoMessageFilter::PluginsLoaded(
const GetPluginInfo_Params& params,
IPC::Message* reply_msg,
const std::vector<WebPluginInfo>& plugins) {
- ChromeViewHostMsg_GetPluginInfo_Status status;
- WebPluginInfo plugin;
- std::string actual_mime_type;
+ ChromeViewHostMsg_GetPluginInfo_Output output;
// This also fills in |actual_mime_type|.
if (!context_.FindEnabledPlugin(params.render_view_id, params.url,
params.top_origin_url, params.mime_type,
- &status, &plugin, &actual_mime_type)) {
- ChromeViewHostMsg_GetPluginInfo::WriteReplyParams(
- reply_msg, status, plugin, actual_mime_type);
+ &output.status, &output.plugin,
+ &output.actual_mime_type)) {
+ ChromeViewHostMsg_GetPluginInfo::WriteReplyParams(reply_msg, output);
Send(reply_msg);
return;
}
-#if defined(ENABLE_PLUGIN_INSTALLATION)
+
PluginFinder::Get(base::Bind(&PluginInfoMessageFilter::GotPluginFinder, this,
- params, reply_msg, plugin, actual_mime_type));
-#else
- GotPluginFinder(params, reply_msg, plugin, actual_mime_type, NULL);
-#endif
+ params, reply_msg, output));
}
void PluginInfoMessageFilter::GotPluginFinder(
const GetPluginInfo_Params& params,
IPC::Message* reply_msg,
- const WebPluginInfo& plugin,
- const std::string& actual_mime_type,
+ ChromeViewHostMsg_GetPluginInfo_Output output,
PluginFinder* plugin_finder) {
- ChromeViewHostMsg_GetPluginInfo_Status status;
- context_.DecidePluginStatus(params, plugin, plugin_finder, &status);
- ChromeViewHostMsg_GetPluginInfo::WriteReplyParams(
- reply_msg, status, plugin, actual_mime_type);
+ context_.DecidePluginStatus(params, output.plugin, plugin_finder,
+ &output.status, &output.group_identifier,
+ &output.group_name);
+ ChromeViewHostMsg_GetPluginInfo::WriteReplyParams(reply_msg, output);
Send(reply_msg);
}
@@ -147,32 +138,25 @@ void PluginInfoMessageFilter::Context::DecidePluginStatus(
const GetPluginInfo_Params& params,
const WebPluginInfo& plugin,
PluginFinder* plugin_finder,
- ChromeViewHostMsg_GetPluginInfo_Status* status) const {
- scoped_ptr<webkit::npapi::PluginGroup> group(
- webkit::npapi::PluginList::Singleton()->GetPluginGroup(plugin));
+ ChromeViewHostMsg_GetPluginInfo_Status* status,
+ std::string* group_identifier,
+ string16* group_name) const {
+ PluginInstaller* installer = plugin_finder->GetPluginInstaller(plugin);
+ *group_name = installer->name();
+ *group_identifier = installer->identifier();
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
// the secondary URL is the plug-in URL.
GetPluginContentSetting(plugin, params.top_origin_url, params.url,
- group->identifier(), &plugin_setting,
+ *group_identifier, &plugin_setting,
&uses_default_content_setting);
DCHECK(plugin_setting != CONTENT_SETTING_DEFAULT);
#if defined(ENABLE_PLUGIN_INSTALLATION)
-#if defined(OS_LINUX)
- // On Linux, unknown plugins require authorization.
- PluginInstaller::SecurityStatus plugin_status =
- PluginInstaller::SECURITY_STATUS_REQUIRES_AUTHORIZATION;
-#else
PluginInstaller::SecurityStatus plugin_status =
- PluginInstaller::SECURITY_STATUS_UP_TO_DATE;
-#endif
- PluginInstaller* installer =
- plugin_finder->FindPluginWithIdentifier(group->identifier());
- if (installer)
- plugin_status = installer->GetSecurityStatus(plugin);
+ installer->GetSecurityStatus(plugin);
// Check if the plug-in is outdated.
if (plugin_status == PluginInstaller::SECURITY_STATUS_OUT_OF_DATE &&
!allow_outdated_plugins_.GetValue()) {
« no previous file with comments | « chrome/browser/renderer_host/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