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

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: "Fixed review comments and added support for other methods in PluginPrefs to use async interface" Created 8 years, 4 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..e516b785274d87402190f72cab1efaf15514bcfd 100644
--- a/chrome/browser/ui/pdf/pdf_unsupported_feature.cc
+++ b/chrome/browser/ui/pdf/pdf_unsupported_feature.cc
@@ -385,10 +385,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 +407,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 +422,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