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 #define IPC_MESSAGE_START ChromeUtilityPrintingMsgStart | 17 #define IPC_MESSAGE_START ChromeUtilityPrintingMsgStart |
18 | 18 |
19 // Preview and Cloud Print messages. | 19 // Preview and Cloud Print messages. |
20 #if defined(ENABLE_FULL_PRINTING) | 20 #if defined(ENABLE_PRINT_PREVIEW) |
21 IPC_STRUCT_TRAITS_BEGIN(printing::PrinterCapsAndDefaults) | 21 IPC_STRUCT_TRAITS_BEGIN(printing::PrinterCapsAndDefaults) |
22 IPC_STRUCT_TRAITS_MEMBER(printer_capabilities) | 22 IPC_STRUCT_TRAITS_MEMBER(printer_capabilities) |
23 IPC_STRUCT_TRAITS_MEMBER(caps_mime_type) | 23 IPC_STRUCT_TRAITS_MEMBER(caps_mime_type) |
24 IPC_STRUCT_TRAITS_MEMBER(printer_defaults) | 24 IPC_STRUCT_TRAITS_MEMBER(printer_defaults) |
25 IPC_STRUCT_TRAITS_MEMBER(defaults_mime_type) | 25 IPC_STRUCT_TRAITS_MEMBER(defaults_mime_type) |
26 IPC_STRUCT_TRAITS_END() | 26 IPC_STRUCT_TRAITS_END() |
27 | 27 |
28 IPC_ENUM_TRAITS_MAX_VALUE(printing::ColorModel, printing::PROCESSCOLORMODEL_RGB) | 28 IPC_ENUM_TRAITS_MAX_VALUE(printing::ColorModel, printing::PROCESSCOLORMODEL_RGB) |
29 | 29 |
30 IPC_STRUCT_TRAITS_BEGIN(printing::PrinterSemanticCapsAndDefaults::Paper) | 30 IPC_STRUCT_TRAITS_BEGIN(printing::PrinterSemanticCapsAndDefaults::Paper) |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 // sandbox. | 76 // sandbox. |
77 IPC_MESSAGE_CONTROL1(ChromeUtilityMsg_GetPrinterCapsAndDefaults, | 77 IPC_MESSAGE_CONTROL1(ChromeUtilityMsg_GetPrinterCapsAndDefaults, |
78 std::string /* printer name */) | 78 std::string /* printer name */) |
79 | 79 |
80 // Tells the utility process to get capabilities and defaults for the specified | 80 // Tells the utility process to get capabilities and defaults for the specified |
81 // printer. Used on Windows to isolate the service process from printer driver | 81 // printer. Used on Windows to isolate the service process from printer driver |
82 // crashes by executing this in a separate process. This does not run in a | 82 // crashes by executing this in a separate process. This does not run in a |
83 // sandbox. Returns result as printing::PrinterSemanticCapsAndDefaults. | 83 // sandbox. Returns result as printing::PrinterSemanticCapsAndDefaults. |
84 IPC_MESSAGE_CONTROL1(ChromeUtilityMsg_GetPrinterSemanticCapsAndDefaults, | 84 IPC_MESSAGE_CONTROL1(ChromeUtilityMsg_GetPrinterSemanticCapsAndDefaults, |
85 std::string /* printer name */) | 85 std::string /* printer name */) |
86 #endif // ENABLE_FULL_PRINTING | 86 #endif // ENABLE_PRINT_PREVIEW |
87 | 87 |
88 // Windows uses messages for printing even without preview. crbug.com/170859 | 88 // Windows uses messages for printing even without preview. crbug.com/170859 |
89 // Primary user of Windows without preview is CEF. crbug.com/417967 | 89 // Primary user of Windows without preview is CEF. crbug.com/417967 |
90 #if defined(ENABLE_PRINTING) && defined(OS_WIN) | 90 #if defined(ENABLE_PRINTING) && defined(OS_WIN) |
91 // Tell the utility process to start rendering the given PDF into a metafile. | 91 // Tell the utility process to start rendering the given PDF into a metafile. |
92 // Utility process would be alive until | 92 // Utility process would be alive until |
93 // ChromeUtilityMsg_RenderPDFPagesToMetafiles_Stop message. | 93 // ChromeUtilityMsg_RenderPDFPagesToMetafiles_Stop message. |
94 IPC_MESSAGE_CONTROL2(ChromeUtilityMsg_RenderPDFPagesToMetafiles, | 94 IPC_MESSAGE_CONTROL2(ChromeUtilityMsg_RenderPDFPagesToMetafiles, |
95 IPC::PlatformFileForTransit, /* input_file */ | 95 IPC::PlatformFileForTransit, /* input_file */ |
96 printing::PdfRenderSettings /* settings */) | 96 printing::PdfRenderSettings /* settings */) |
97 | 97 |
98 // Requests conversion of the next page. | 98 // Requests conversion of the next page. |
99 IPC_MESSAGE_CONTROL2(ChromeUtilityMsg_RenderPDFPagesToMetafiles_GetPage, | 99 IPC_MESSAGE_CONTROL2(ChromeUtilityMsg_RenderPDFPagesToMetafiles_GetPage, |
100 int /* page_number */, | 100 int /* page_number */, |
101 IPC::PlatformFileForTransit /* output_file */) | 101 IPC::PlatformFileForTransit /* output_file */) |
102 | 102 |
103 // Requests utility process to stop conversion and exit. | 103 // Requests utility process to stop conversion and exit. |
104 IPC_MESSAGE_CONTROL0(ChromeUtilityMsg_RenderPDFPagesToMetafiles_Stop) | 104 IPC_MESSAGE_CONTROL0(ChromeUtilityMsg_RenderPDFPagesToMetafiles_Stop) |
105 #endif // ENABLE_PRINTING && OS_WIN | 105 #endif // ENABLE_PRINTING && OS_WIN |
106 | 106 |
107 //------------------------------------------------------------------------------ | 107 //------------------------------------------------------------------------------ |
108 // Utility process host messages: | 108 // Utility process host messages: |
109 // These are messages from the utility process to the browser. | 109 // These are messages from the utility process to the browser. |
110 | 110 |
111 #if defined(ENABLE_FULL_PRINTING) | 111 #if defined(ENABLE_PRINT_PREVIEW) |
112 // Reply when the utility process has succeeded in rendering the PDF to PWG. | 112 // Reply when the utility process has succeeded in rendering the PDF to PWG. |
113 IPC_MESSAGE_CONTROL0(ChromeUtilityHostMsg_RenderPDFPagesToPWGRaster_Succeeded) | 113 IPC_MESSAGE_CONTROL0(ChromeUtilityHostMsg_RenderPDFPagesToPWGRaster_Succeeded) |
114 | 114 |
115 // Reply when an error occurred rendering the PDF to PWG. | 115 // Reply when an error occurred rendering the PDF to PWG. |
116 IPC_MESSAGE_CONTROL0(ChromeUtilityHostMsg_RenderPDFPagesToPWGRaster_Failed) | 116 IPC_MESSAGE_CONTROL0(ChromeUtilityHostMsg_RenderPDFPagesToPWGRaster_Failed) |
117 | 117 |
118 // Reply when the utility process has succeeded in obtaining the printer | 118 // Reply when the utility process has succeeded in obtaining the printer |
119 // capabilities and defaults. | 119 // capabilities and defaults. |
120 IPC_MESSAGE_CONTROL2(ChromeUtilityHostMsg_GetPrinterCapsAndDefaults_Succeeded, | 120 IPC_MESSAGE_CONTROL2(ChromeUtilityHostMsg_GetPrinterCapsAndDefaults_Succeeded, |
121 std::string /* printer name */, | 121 std::string /* printer name */, |
122 printing::PrinterCapsAndDefaults) | 122 printing::PrinterCapsAndDefaults) |
123 | 123 |
124 // Reply when the utility process has succeeded in obtaining the printer | 124 // Reply when the utility process has succeeded in obtaining the printer |
125 // semantic capabilities and defaults. | 125 // semantic capabilities and defaults. |
126 IPC_MESSAGE_CONTROL2( | 126 IPC_MESSAGE_CONTROL2( |
127 ChromeUtilityHostMsg_GetPrinterSemanticCapsAndDefaults_Succeeded, | 127 ChromeUtilityHostMsg_GetPrinterSemanticCapsAndDefaults_Succeeded, |
128 std::string /* printer name */, | 128 std::string /* printer name */, |
129 printing::PrinterSemanticCapsAndDefaults) | 129 printing::PrinterSemanticCapsAndDefaults) |
130 | 130 |
131 // Reply when the utility process has failed to obtain the printer | 131 // Reply when the utility process has failed to obtain the printer |
132 // capabilities and defaults. | 132 // capabilities and defaults. |
133 IPC_MESSAGE_CONTROL1(ChromeUtilityHostMsg_GetPrinterCapsAndDefaults_Failed, | 133 IPC_MESSAGE_CONTROL1(ChromeUtilityHostMsg_GetPrinterCapsAndDefaults_Failed, |
134 std::string /* printer name */) | 134 std::string /* printer name */) |
135 | 135 |
136 // Reply when the utility process has failed to obtain the printer | 136 // Reply when the utility process has failed to obtain the printer |
137 // semantic capabilities and defaults. | 137 // semantic capabilities and defaults. |
138 IPC_MESSAGE_CONTROL1( | 138 IPC_MESSAGE_CONTROL1( |
139 ChromeUtilityHostMsg_GetPrinterSemanticCapsAndDefaults_Failed, | 139 ChromeUtilityHostMsg_GetPrinterSemanticCapsAndDefaults_Failed, |
140 std::string /* printer name */) | 140 std::string /* printer name */) |
141 #endif // ENABLE_FULL_PRINTING | 141 #endif // ENABLE_PRINT_PREVIEW |
142 | 142 |
143 #if defined(ENABLE_PRINTING) && defined(OS_WIN) | 143 #if defined(ENABLE_PRINTING) && defined(OS_WIN) |
144 // Reply when the utility process loaded PDF. |page_count| is 0, if loading | 144 // Reply when the utility process loaded PDF. |page_count| is 0, if loading |
145 // failed. | 145 // failed. |
146 IPC_MESSAGE_CONTROL1(ChromeUtilityHostMsg_RenderPDFPagesToMetafiles_PageCount, | 146 IPC_MESSAGE_CONTROL1(ChromeUtilityHostMsg_RenderPDFPagesToMetafiles_PageCount, |
147 int /* page_count */) | 147 int /* page_count */) |
148 | 148 |
149 // Reply when the utility process rendered the PDF page. | 149 // Reply when the utility process rendered the PDF page. |
150 IPC_MESSAGE_CONTROL2(ChromeUtilityHostMsg_RenderPDFPagesToMetafiles_PageDone, | 150 IPC_MESSAGE_CONTROL2(ChromeUtilityHostMsg_RenderPDFPagesToMetafiles_PageDone, |
151 bool /* success */, | 151 bool /* success */, |
152 float /* scale_factor */) | 152 float /* scale_factor */) |
153 #endif // ENABLE_PRINTING && OS_WIN | 153 #endif // ENABLE_PRINTING && OS_WIN |
OLD | NEW |