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

Side by Side Diff: chrome/utility/printing_handler.cc

Issue 2640033005: Substitute boolean GDI printing for a mode type (Closed)
Patch Set: Fix nits Created 3 years, 10 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 unified diff | Download patch
« no previous file with comments | « chrome/utility/printing_handler.h ('k') | printing/pdf_render_settings.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/utility/printing_handler.h" 5 #include "chrome/utility/printing_handler.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "base/files/file_util.h" 10 #include "base/files/file_util.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 OnGetPrinterSemanticCapsAndDefaults) 80 OnGetPrinterSemanticCapsAndDefaults)
81 #endif // ENABLE_PRINT_PREVIEW 81 #endif // ENABLE_PRINT_PREVIEW
82 IPC_MESSAGE_UNHANDLED(handled = false) 82 IPC_MESSAGE_UNHANDLED(handled = false)
83 IPC_END_MESSAGE_MAP() 83 IPC_END_MESSAGE_MAP()
84 return handled; 84 return handled;
85 } 85 }
86 86
87 #if defined(OS_WIN) 87 #if defined(OS_WIN)
88 void PrintingHandler::OnRenderPDFPagesToMetafile( 88 void PrintingHandler::OnRenderPDFPagesToMetafile(
89 IPC::PlatformFileForTransit pdf_transit, 89 IPC::PlatformFileForTransit pdf_transit,
90 const PdfRenderSettings& settings, 90 const PdfRenderSettings& settings) {
91 bool print_text_with_gdi) {
92 pdf_rendering_settings_ = settings; 91 pdf_rendering_settings_ = settings;
93 chrome_pdf::SetPDFUseGDIPrinting(print_text_with_gdi); 92 chrome_pdf::SetPDFUseGDIPrinting(pdf_rendering_settings_.mode ==
93 PdfRenderSettings::Mode::GDI_TEXT);
94 base::File pdf_file = IPC::PlatformFileForTransitToFile(pdf_transit); 94 base::File pdf_file = IPC::PlatformFileForTransitToFile(pdf_transit);
95 int page_count = LoadPDF(std::move(pdf_file)); 95 int page_count = LoadPDF(std::move(pdf_file));
96 Send( 96 Send(
97 new ChromeUtilityHostMsg_RenderPDFPagesToMetafiles_PageCount(page_count)); 97 new ChromeUtilityHostMsg_RenderPDFPagesToMetafiles_PageCount(page_count));
98 } 98 }
99 99
100 void PrintingHandler::OnRenderPDFPagesToMetafileGetPage( 100 void PrintingHandler::OnRenderPDFPagesToMetafileGetPage(
101 int page_number, 101 int page_number,
102 IPC::PlatformFileForTransit output_file) { 102 IPC::PlatformFileForTransit output_file) {
103 base::File emf_file = IPC::PlatformFileForTransitToFile(output_file); 103 base::File emf_file = IPC::PlatformFileForTransitToFile(output_file);
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 printer_name, printer_info)); 305 printer_name, printer_info));
306 } else { 306 } else {
307 Send(new ChromeUtilityHostMsg_GetPrinterSemanticCapsAndDefaults_Failed( 307 Send(new ChromeUtilityHostMsg_GetPrinterSemanticCapsAndDefaults_Failed(
308 printer_name)); 308 printer_name));
309 } 309 }
310 ReleaseProcessIfNeeded(); 310 ReleaseProcessIfNeeded();
311 } 311 }
312 #endif // ENABLE_PRINT_PREVIEW 312 #endif // ENABLE_PRINT_PREVIEW
313 313
314 } // namespace printing 314 } // namespace printing
OLDNEW
« no previous file with comments | « chrome/utility/printing_handler.h ('k') | printing/pdf_render_settings.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698