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

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

Issue 11364202: 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: fix? 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
« no previous file with comments | « no previous file | chrome/browser/printing/print_preview_tab_controller_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)) {
+ 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
« no previous file with comments | « no previous file | chrome/browser/printing/print_preview_tab_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698