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

Unified Diff: chrome/browser/ui/pdf/pdf_unsupported_feature.cc

Issue 10910168: Separate plugin_metadata from plugin_installer, thread-safe plugin_finder (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: .. 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.cc ('k') | chrome/browser/ui/webui/plugins_ui.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/pdf/pdf_unsupported_feature.cc
diff --git a/chrome/browser/ui/pdf/pdf_unsupported_feature.cc b/chrome/browser/ui/pdf/pdf_unsupported_feature.cc
index 3f55439fd453c2cf3be42606846a69b132c2860b..66f5bad0d149179ef1c793ee91e99a8aea2b4902 100644
--- a/chrome/browser/ui/pdf/pdf_unsupported_feature.cc
+++ b/chrome/browser/ui/pdf/pdf_unsupported_feature.cc
@@ -13,7 +13,7 @@
#include "chrome/browser/infobars/infobar_tab_helper.h"
#include "chrome/browser/lifetime/application_lifetime.h"
#include "chrome/browser/plugins/plugin_finder.h"
-#include "chrome/browser/plugins/plugin_installer.h"
+#include "chrome/browser/plugins/plugin_metadata.h"
#include "chrome/browser/plugins/plugin_prefs.h"
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/profiles/profile.h"
@@ -291,12 +291,11 @@ PDFUnsupportedFeaturePromptDelegate::PDFUnsupportedFeaturePromptDelegate(
reader_webplugininfo_ = *reader;
#if defined(ENABLE_PLUGIN_INSTALLATION)
- PluginInstaller* installer =
- plugin_finder->FindPluginWithIdentifier("adobe-reader");
+ PluginMetadata* plugin_metadata =
+ plugin_finder->GetPluginMetadata(reader_webplugininfo_);
- reader_vulnerable_ =
- installer->GetSecurityStatus(*reader) !=
- PluginInstaller::SECURITY_STATUS_UP_TO_DATE;
+ reader_vulnerable_ = plugin_metadata->GetSecurityStatus(*reader) !=
+ PluginMetadata::SECURITY_STATUS_UP_TO_DATE;
#else
NOTREACHED();
#endif
@@ -365,7 +364,6 @@ void PDFUnsupportedFeaturePromptDelegate::Cancel() {
void GotPluginsCallback(int process_id,
int routing_id,
- PluginFinder* plugin_finder,
const std::vector<webkit::WebPluginInfo>& plugins) {
WebContents* web_contents =
tab_util::GetWebContentsByID(process_id, routing_id);
@@ -385,9 +383,11 @@ void GotPluginsCallback(int process_id,
}
const webkit::WebPluginInfo* reader = NULL;
+ PluginFinder* plugin_finder = PluginFinder::GetInstance();
for (size_t i = 0; i < plugins.size(); ++i) {
- PluginInstaller* installer = plugin_finder->GetPluginInstaller(plugins[i]);
- if (reader_group_name == installer->name()) {
+ PluginMetadata* plugin_metadata =
+ plugin_finder->GetPluginMetadata(plugins[i]);
+ if (reader_group_name == plugin_metadata->name()) {
DCHECK(!reader);
reader = &plugins[i];
}
@@ -399,21 +399,13 @@ void GotPluginsCallback(int process_id,
pdf_tab_helper->ShowOpenInReaderPrompt(prompt.Pass());
}
-void GotPluginFinderCallback(int process_id,
- int routing_id,
- PluginFinder* plugin_finder) {
- PluginService::GetInstance()->GetPlugins(
- base::Bind(&GotPluginsCallback, process_id, routing_id,
- base::Unretained(plugin_finder)));
-}
-
} // namespace
void PDFHasUnsupportedFeature(content::WebContents* web_contents) {
#if defined(OS_WIN) && defined(ENABLE_PLUGIN_INSTALLATION)
// Only works for Windows for now. For Mac, we'll have to launch the file
// externally since Adobe Reader doesn't work inside Chrome.
- PluginFinder::Get(base::Bind(&GotPluginFinderCallback,
+ PluginService::GetInstance()->GetPlugins(base::Bind(&GotPluginsCallback,
web_contents->GetRenderProcessHost()->GetID(),
web_contents->GetRenderViewHost()->GetRoutingID()));
#endif
« no previous file with comments | « chrome/browser/renderer_host/plugin_info_message_filter.cc ('k') | chrome/browser/ui/webui/plugins_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698