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

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

Issue 10872034: Changing PluginPrefs to use PluginFinder's async interface. (Closed) Base URL: http://git.chromium.org/chromium/src.git@test_async
Patch Set: Remove exclusion of plugin_installer and plugin_finder from build when enable_plugin_installation i… 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
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 67f3837da529b450fd5e35e9207bfc53b22e5c6d..29686efb76fed17203816335467a6952a2dd2067 100644
--- a/chrome/browser/ui/pdf/pdf_unsupported_feature.cc
+++ b/chrome/browser/ui/pdf/pdf_unsupported_feature.cc
@@ -11,6 +11,8 @@
#include "chrome/browser/api/infobars/confirm_infobar_delegate.h"
#include "chrome/browser/chrome_plugin_service_filter.h"
#include "chrome/browser/infobars/infobar_tab_helper.h"
+#include "chrome/browser/plugin_finder.h"
+#include "chrome/browser/plugin_installer.h"
#include "chrome/browser/plugin_prefs.h"
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/profiles/profile.h"
@@ -36,15 +38,6 @@
#include "ui/gfx/image/image.h"
#include "webkit/plugins/npapi/plugin_group.h"
-#if defined(ENABLE_PLUGIN_INSTALLATION)
-#include "chrome/browser/plugin_finder.h"
-#include "chrome/browser/plugin_installer.h"
-#else
-// Forward-declare PluginFinder. It's never actually used, but we pass a NULL
-// pointer instead.
-class PluginFinder;
-#endif
-
using content::InterstitialPage;
using content::OpenURLParams;
using content::PluginService;
@@ -385,10 +378,10 @@ void PDFUnsupportedFeatureInfoBarDelegate::OnNo() {
UserMetricsAction("PDF_InstallReaderInfoBarCancel"));
}
-void GotPluginGroupsCallback(int process_id,
- int routing_id,
- PluginFinder* plugin_finder,
- const std::vector<PluginGroup>& groups) {
+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);
if (!web_contents)
@@ -407,13 +400,11 @@ void GotPluginGroupsCallback(int process_id,
}
const webkit::WebPluginInfo* reader = NULL;
- for (size_t i = 0; i < groups.size(); ++i) {
- if (groups[i].GetGroupName() == reader_group_name) {
- const std::vector<WebPluginInfo>& plugins =
- groups[i].web_plugin_infos();
- DCHECK_EQ(plugins.size(), 1u);
- reader = &plugins[0];
- break;
+ for (size_t i = 0; i < plugins.size(); ++i) {
+ PluginInstaller* installer = plugin_finder->GetPluginInstaller(plugins[i]);
+ if (reader_group_name == installer->name()) {
+ DCHECK(!reader);
+ reader = &plugins[i];
}
}
@@ -424,9 +415,9 @@ void GotPluginGroupsCallback(int process_id,
void GotPluginFinderCallback(int process_id,
int routing_id,
PluginFinder* plugin_finder) {
- PluginService::GetInstance()->GetPluginGroups(
- base::Bind(&GotPluginGroupsCallback, process_id, routing_id,
- base::Unretained(plugin_finder)));
+ PluginService::GetInstance()->GetPlugins(
+ base::Bind(&GotPluginsCallback, process_id, routing_id,
+ base::Unretained(plugin_finder)));
}
} // namespace

Powered by Google App Engine
This is Rietveld 408576698