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

Unified Diff: chrome/utility/printing_handler.cc

Issue 2713023005: Fix some nits from r447440. (Closed)
Patch Set: rebase, git cl format Created 3 years, 9 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/service/cloud_print/print_system_win.cc ('k') | printing/pdf_render_settings.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/utility/printing_handler.cc
diff --git a/chrome/utility/printing_handler.cc b/chrome/utility/printing_handler.cc
index 6e97c7b29572b91cdf06502a5c34fb73007a3c2c..146ef7a6b1b6e467acd985f86538771dba2b1c37 100644
--- a/chrome/utility/printing_handler.cc
+++ b/chrome/utility/printing_handler.cc
@@ -89,16 +89,21 @@ void PrintingHandler::OnRenderPDFPagesToMetafile(
IPC::PlatformFileForTransit pdf_transit,
const PdfRenderSettings& settings) {
pdf_rendering_settings_ = settings;
- chrome_pdf::SetPDFPostscriptPrintingLevel(0); // Not using postscript.
chrome_pdf::SetPDFUseGDIPrinting(pdf_rendering_settings_.mode ==
PdfRenderSettings::Mode::GDI_TEXT);
- if (pdf_rendering_settings_.mode ==
- PdfRenderSettings::Mode::POSTSCRIPT_LEVEL2) {
- chrome_pdf::SetPDFPostscriptPrintingLevel(2);
- } else if (pdf_rendering_settings_.mode ==
- PdfRenderSettings::Mode::POSTSCRIPT_LEVEL3) {
- chrome_pdf::SetPDFPostscriptPrintingLevel(3);
+ int postscript_level;
+ switch (pdf_rendering_settings_.mode) {
+ case PdfRenderSettings::Mode::POSTSCRIPT_LEVEL2:
+ postscript_level = 2;
+ break;
+ case PdfRenderSettings::Mode::POSTSCRIPT_LEVEL3:
+ postscript_level = 3;
+ break;
+ default:
+ postscript_level = 0; // Not using postscript.
}
+ chrome_pdf::SetPDFPostscriptPrintingLevel(postscript_level);
+
base::File pdf_file = IPC::PlatformFileForTransitToFile(pdf_transit);
int page_count = LoadPDF(std::move(pdf_file));
Send(
« no previous file with comments | « chrome/service/cloud_print/print_system_win.cc ('k') | printing/pdf_render_settings.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698