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

Unified Diff: chrome/browser/printing/print_preview_tab_controller.cc

Issue 11417003: Reland r167487: Get full WebPluginInfo for the PDF plug-in before enabling it for print preview. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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/printing/print_preview_tab_controller.cc
diff --git a/chrome/browser/printing/print_preview_tab_controller.cc b/chrome/browser/printing/print_preview_tab_controller.cc
index 63da491503603cb5e5ad6220d93b9dc090ad4588..b7fcbc0388e5f1d5f17bed8d6541ee86bfef976b 100644
--- a/chrome/browser/printing/print_preview_tab_controller.cc
+++ b/chrome/browser/printing/print_preview_tab_controller.cc
@@ -37,6 +37,7 @@
#include "content/public/browser/navigation_entry.h"
#include "content/public/browser/notification_details.h"
#include "content/public/browser/notification_source.h"
+#include "content/public/browser/plugin_service.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/web_contents.h"
@@ -56,13 +57,20 @@ namespace {
void EnableInternalPDFPluginForTab(TabContents* preview_tab) {
// Always enable the internal PDF plugin for the print preview page.
+ FilePath pdf_plugin_path;
+ if (!PathService::Get(chrome::FILE_PDF_PLUGIN, &pdf_plugin_path))
+ return;
+
webkit::WebPluginInfo pdf_plugin;
- PathService::Get(chrome::FILE_PDF_PLUGIN, &pdf_plugin.path);
+ if (!content::PluginService::GetInstance()->GetPluginInfoByPath(
+ pdf_plugin_path, &pdf_plugin)) {
Peter Kasting 2012/11/15 18:53:50 Nit: Indent 4, not 8. {} is optional.
Bernhard Bauer 2012/11/18 19:15:26 Done.
+ return;
+ }
ChromePluginServiceFilter::GetInstance()->OverridePluginForTab(
- preview_tab->web_contents()->GetRenderProcessHost()->GetID(),
- preview_tab->web_contents()->GetRenderViewHost()->GetRoutingID(),
- GURL(), pdf_plugin);
+ preview_tab->web_contents()->GetRenderProcessHost()->GetID(),
+ preview_tab->web_contents()->GetRenderViewHost()->GetRoutingID(),
+ GURL(), pdf_plugin);
}
// WebDialogDelegate that specifies what the print preview dialog

Powered by Google App Engine
This is Rietveld 408576698