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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 IPC_END_MESSAGE_MAP() | 69 IPC_END_MESSAGE_MAP() |
70 return handled; | 70 return handled; |
71 } | 71 } |
72 | 72 |
73 #if defined(OS_WIN) | 73 #if defined(OS_WIN) |
74 void PrintingHandler::OnRenderPDFPagesToMetafile( | 74 void PrintingHandler::OnRenderPDFPagesToMetafile( |
75 IPC::PlatformFileForTransit pdf_transit, | 75 IPC::PlatformFileForTransit pdf_transit, |
76 const PdfRenderSettings& settings) { | 76 const PdfRenderSettings& settings) { |
77 pdf_rendering_settings_ = settings; | 77 pdf_rendering_settings_ = settings; |
78 base::File pdf_file = IPC::PlatformFileForTransitToFile(pdf_transit); | 78 base::File pdf_file = IPC::PlatformFileForTransitToFile(pdf_transit); |
79 int page_count = LoadPDF(pdf_file.Pass()); | 79 int page_count = LoadPDF(std::move(pdf_file)); |
80 Send( | 80 Send( |
81 new ChromeUtilityHostMsg_RenderPDFPagesToMetafiles_PageCount(page_count)); | 81 new ChromeUtilityHostMsg_RenderPDFPagesToMetafiles_PageCount(page_count)); |
82 } | 82 } |
83 | 83 |
84 void PrintingHandler::OnRenderPDFPagesToMetafileGetPage( | 84 void PrintingHandler::OnRenderPDFPagesToMetafileGetPage( |
85 int page_number, | 85 int page_number, |
86 IPC::PlatformFileForTransit output_file) { | 86 IPC::PlatformFileForTransit output_file) { |
87 base::File emf_file = IPC::PlatformFileForTransitToFile(output_file); | 87 base::File emf_file = IPC::PlatformFileForTransitToFile(output_file); |
88 float scale_factor = 1.0f; | 88 float scale_factor = 1.0f; |
89 bool success = | 89 bool success = |
90 RenderPdfPageToMetafile(page_number, emf_file.Pass(), &scale_factor); | 90 RenderPdfPageToMetafile(page_number, std::move(emf_file), &scale_factor); |
91 Send(new ChromeUtilityHostMsg_RenderPDFPagesToMetafiles_PageDone( | 91 Send(new ChromeUtilityHostMsg_RenderPDFPagesToMetafiles_PageDone( |
92 success, scale_factor)); | 92 success, scale_factor)); |
93 } | 93 } |
94 | 94 |
95 void PrintingHandler::OnRenderPDFPagesToMetafileStop() { | 95 void PrintingHandler::OnRenderPDFPagesToMetafileStop() { |
96 ReleaseProcessIfNeeded(); | 96 ReleaseProcessIfNeeded(); |
97 } | 97 } |
98 | 98 |
99 #endif // OS_WIN | 99 #endif // OS_WIN |
100 | 100 |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 printer_name, printer_info)); | 304 printer_name, printer_info)); |
305 } else { | 305 } else { |
306 Send(new ChromeUtilityHostMsg_GetPrinterSemanticCapsAndDefaults_Failed( | 306 Send(new ChromeUtilityHostMsg_GetPrinterSemanticCapsAndDefaults_Failed( |
307 printer_name)); | 307 printer_name)); |
308 } | 308 } |
309 ReleaseProcessIfNeeded(); | 309 ReleaseProcessIfNeeded(); |
310 } | 310 } |
311 #endif // ENABLE_PRINT_PREVIEW | 311 #endif // ENABLE_PRINT_PREVIEW |
312 | 312 |
313 } // namespace printing | 313 } // namespace printing |
OLD | NEW |