| 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 // Multiply-included message file, so no include guard. | 5 // Multiply-included message file, so no include guard. |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "ipc/ipc_message_macros.h" | 10 #include "ipc/ipc_message_macros.h" |
| 11 #include "ipc/ipc_platform_file.h" | 11 #include "ipc/ipc_platform_file.h" |
| 12 #include "printing/backend/print_backend.h" | 12 #include "printing/backend/print_backend.h" |
| 13 #include "printing/page_range.h" | 13 #include "printing/page_range.h" |
| 14 #include "printing/pdf_render_settings.h" | 14 #include "printing/pdf_render_settings.h" |
| 15 #include "printing/pwg_raster_settings.h" | 15 #include "printing/pwg_raster_settings.h" |
| 16 | 16 |
| 17 #if !defined(ENABLE_FULL_PRINTING) | 17 #define IPC_MESSAGE_START ChromeUtilityPrintingMsgStart |
| 18 #error "Full printing must be enabled" | |
| 19 #endif | |
| 20 | 18 |
| 21 #define IPC_MESSAGE_START ChromeUtilityPrintingMsgStart | 19 #if defined(ENABLE_FULL_PRINTING) |
| 22 | 20 |
| 23 IPC_STRUCT_TRAITS_BEGIN(printing::PrinterCapsAndDefaults) | 21 IPC_STRUCT_TRAITS_BEGIN(printing::PrinterCapsAndDefaults) |
| 24 IPC_STRUCT_TRAITS_MEMBER(printer_capabilities) | 22 IPC_STRUCT_TRAITS_MEMBER(printer_capabilities) |
| 25 IPC_STRUCT_TRAITS_MEMBER(caps_mime_type) | 23 IPC_STRUCT_TRAITS_MEMBER(caps_mime_type) |
| 26 IPC_STRUCT_TRAITS_MEMBER(printer_defaults) | 24 IPC_STRUCT_TRAITS_MEMBER(printer_defaults) |
| 27 IPC_STRUCT_TRAITS_MEMBER(defaults_mime_type) | 25 IPC_STRUCT_TRAITS_MEMBER(defaults_mime_type) |
| 28 IPC_STRUCT_TRAITS_END() | 26 IPC_STRUCT_TRAITS_END() |
| 29 | 27 |
| 30 IPC_ENUM_TRAITS_MAX_VALUE(printing::ColorModel, printing::PROCESSCOLORMODEL_RGB) | 28 IPC_ENUM_TRAITS_MAX_VALUE(printing::ColorModel, printing::PROCESSCOLORMODEL_RGB) |
| 31 | 29 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 IPC_MESSAGE_CONTROL1(ChromeUtilityMsg_GetPrinterCapsAndDefaults, | 76 IPC_MESSAGE_CONTROL1(ChromeUtilityMsg_GetPrinterCapsAndDefaults, |
| 79 std::string /* printer name */) | 77 std::string /* printer name */) |
| 80 | 78 |
| 81 // Tells the utility process to get capabilities and defaults for the specified | 79 // Tells the utility process to get capabilities and defaults for the specified |
| 82 // printer. Used on Windows to isolate the service process from printer driver | 80 // printer. Used on Windows to isolate the service process from printer driver |
| 83 // crashes by executing this in a separate process. This does not run in a | 81 // crashes by executing this in a separate process. This does not run in a |
| 84 // sandbox. Returns result as printing::PrinterSemanticCapsAndDefaults. | 82 // sandbox. Returns result as printing::PrinterSemanticCapsAndDefaults. |
| 85 IPC_MESSAGE_CONTROL1(ChromeUtilityMsg_GetPrinterSemanticCapsAndDefaults, | 83 IPC_MESSAGE_CONTROL1(ChromeUtilityMsg_GetPrinterSemanticCapsAndDefaults, |
| 86 std::string /* printer name */) | 84 std::string /* printer name */) |
| 87 | 85 |
| 88 #if defined(OS_WIN) | |
| 89 // Tell the utility process to render the given PDF into a metafile. | |
| 90 // The metafile path will have ".%d" inserted where the %d is the page number. | |
| 91 // If no page range is specified, all pages will be converted. | |
| 92 IPC_MESSAGE_CONTROL4(ChromeUtilityMsg_RenderPDFPagesToMetafiles, | |
| 93 IPC::PlatformFileForTransit, // PDF file | |
| 94 base::FilePath, // Base location for output metafile | |
| 95 printing::PdfRenderSettings, // PDF render settings | |
| 96 std::vector<printing::PageRange>) | |
| 97 #endif // OS_WIN | |
| 98 | |
| 99 //------------------------------------------------------------------------------ | 86 //------------------------------------------------------------------------------ |
| 100 // Utility process host messages: | 87 // Utility process host messages: |
| 101 // These are messages from the utility process to the browser. | 88 // These are messages from the utility process to the browser. |
| 102 | 89 |
| 103 // Reply when the utility process has succeeded in rendering the PDF to PWG. | 90 // Reply when the utility process has succeeded in rendering the PDF to PWG. |
| 104 IPC_MESSAGE_CONTROL0(ChromeUtilityHostMsg_RenderPDFPagesToPWGRaster_Succeeded) | 91 IPC_MESSAGE_CONTROL0(ChromeUtilityHostMsg_RenderPDFPagesToPWGRaster_Succeeded) |
| 105 | 92 |
| 106 // Reply when an error occurred rendering the PDF to PWG. | 93 // Reply when an error occurred rendering the PDF to PWG. |
| 107 IPC_MESSAGE_CONTROL0(ChromeUtilityHostMsg_RenderPDFPagesToPWGRaster_Failed) | 94 IPC_MESSAGE_CONTROL0(ChromeUtilityHostMsg_RenderPDFPagesToPWGRaster_Failed) |
| 108 | 95 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 123 // capabilities and defaults. | 110 // capabilities and defaults. |
| 124 IPC_MESSAGE_CONTROL1(ChromeUtilityHostMsg_GetPrinterCapsAndDefaults_Failed, | 111 IPC_MESSAGE_CONTROL1(ChromeUtilityHostMsg_GetPrinterCapsAndDefaults_Failed, |
| 125 std::string /* printer name */) | 112 std::string /* printer name */) |
| 126 | 113 |
| 127 // Reply when the utility process has failed to obtain the printer | 114 // Reply when the utility process has failed to obtain the printer |
| 128 // semantic capabilities and defaults. | 115 // semantic capabilities and defaults. |
| 129 IPC_MESSAGE_CONTROL1( | 116 IPC_MESSAGE_CONTROL1( |
| 130 ChromeUtilityHostMsg_GetPrinterSemanticCapsAndDefaults_Failed, | 117 ChromeUtilityHostMsg_GetPrinterSemanticCapsAndDefaults_Failed, |
| 131 std::string /* printer name */) | 118 std::string /* printer name */) |
| 132 | 119 |
| 120 #endif // ENABLE_FULL_PRINTING |
| 121 |
| 133 #if defined(OS_WIN) | 122 #if defined(OS_WIN) |
| 123 // Tell the utility process to render the given PDF into a metafile. |
| 124 // The metafile path will have ".%d" inserted where the %d is the page number. |
| 125 // If no page range is specified, all pages will be converted. |
| 126 IPC_MESSAGE_CONTROL4(ChromeUtilityMsg_RenderPDFPagesToMetafiles, |
| 127 IPC::PlatformFileForTransit, // PDF file |
| 128 base::FilePath, // Base location for output metafile |
| 129 printing::PdfRenderSettings, // PDF render settings |
| 130 std::vector<printing::PageRange>) |
| 131 |
| 134 // Reply when the utility process has succeeded in rendering the PDF. | 132 // Reply when the utility process has succeeded in rendering the PDF. |
| 135 IPC_MESSAGE_CONTROL2(ChromeUtilityHostMsg_RenderPDFPagesToMetafiles_Succeeded, | 133 IPC_MESSAGE_CONTROL2(ChromeUtilityHostMsg_RenderPDFPagesToMetafiles_Succeeded, |
| 136 std::vector<printing::PageRange>, // Pages rendered | 134 std::vector<printing::PageRange>, // Pages rendered |
| 137 double) // Scale factor | 135 double) // Scale factor |
| 138 | 136 |
| 139 // Reply when an error occurred rendering the PDF. | 137 // Reply when an error occurred rendering the PDF. |
| 140 IPC_MESSAGE_CONTROL0(ChromeUtilityHostMsg_RenderPDFPagesToMetafile_Failed) | 138 IPC_MESSAGE_CONTROL0(ChromeUtilityHostMsg_RenderPDFPagesToMetafile_Failed) |
| 139 |
| 141 #endif // OS_WIN | 140 #endif // OS_WIN |
| OLD | NEW |