| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |