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 "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
11 #include "build/build_config.h" | 11 #include "build/build_config.h" |
12 #include "components/printing/common/printing_param_traits_macros.h" | 12 #include "components/printing/common/printing_param_traits_macros.h" |
13 #include "ipc/ipc_message_macros.h" | 13 #include "ipc/ipc_message_macros.h" |
| 14 #include "ipc/ipc_param_traits.h" |
14 #include "ipc/ipc_platform_file.h" | 15 #include "ipc/ipc_platform_file.h" |
15 #include "printing/backend/print_backend.h" | 16 #include "printing/backend/print_backend.h" |
16 #include "printing/features/features.h" | 17 #include "printing/features/features.h" |
17 #include "printing/page_range.h" | 18 #include "printing/page_range.h" |
18 #include "printing/pdf_render_settings.h" | 19 #include "printing/pdf_render_settings.h" |
19 #include "printing/pwg_raster_settings.h" | 20 #include "printing/pwg_raster_settings.h" |
20 | 21 |
21 #if defined(OS_WIN) | 22 #if defined(OS_WIN) |
22 #include <windows.h> | 23 #include <windows.h> |
23 #endif | 24 #endif |
24 | 25 |
25 #define IPC_MESSAGE_START ChromeUtilityPrintingMsgStart | 26 #define IPC_MESSAGE_START ChromeUtilityPrintingMsgStart |
26 | 27 |
27 // Preview and Cloud Print messages. | 28 // Preview and Cloud Print messages. |
28 #if BUILDFLAG(ENABLE_PRINT_PREVIEW) | 29 #if BUILDFLAG(ENABLE_PRINT_PREVIEW) |
| 30 IPC_ENUM_TRAITS_MAX_VALUE(printing::PdfRenderSettings::Mode, |
| 31 printing::PdfRenderSettings::Mode::LAST) |
| 32 |
| 33 IPC_STRUCT_TRAITS_BEGIN(printing::PdfRenderSettings) |
| 34 IPC_STRUCT_TRAITS_MEMBER(area) |
| 35 IPC_STRUCT_TRAITS_MEMBER(dpi) |
| 36 IPC_STRUCT_TRAITS_MEMBER(autorotate) |
| 37 IPC_STRUCT_TRAITS_MEMBER(mode) |
| 38 IPC_STRUCT_TRAITS_END() |
| 39 |
29 IPC_STRUCT_TRAITS_BEGIN(printing::PrinterCapsAndDefaults) | 40 IPC_STRUCT_TRAITS_BEGIN(printing::PrinterCapsAndDefaults) |
30 IPC_STRUCT_TRAITS_MEMBER(printer_capabilities) | 41 IPC_STRUCT_TRAITS_MEMBER(printer_capabilities) |
31 IPC_STRUCT_TRAITS_MEMBER(caps_mime_type) | 42 IPC_STRUCT_TRAITS_MEMBER(caps_mime_type) |
32 IPC_STRUCT_TRAITS_MEMBER(printer_defaults) | 43 IPC_STRUCT_TRAITS_MEMBER(printer_defaults) |
33 IPC_STRUCT_TRAITS_MEMBER(defaults_mime_type) | 44 IPC_STRUCT_TRAITS_MEMBER(defaults_mime_type) |
34 IPC_STRUCT_TRAITS_END() | 45 IPC_STRUCT_TRAITS_END() |
35 | 46 |
36 IPC_ENUM_TRAITS_MAX_VALUE(printing::ColorModel, printing::PROCESSCOLORMODEL_RGB) | 47 IPC_ENUM_TRAITS_MAX_VALUE(printing::ColorModel, printing::PROCESSCOLORMODEL_RGB) |
37 | 48 |
38 IPC_STRUCT_TRAITS_BEGIN(printing::PrinterSemanticCapsAndDefaults::Paper) | 49 IPC_STRUCT_TRAITS_BEGIN(printing::PrinterSemanticCapsAndDefaults::Paper) |
(...skipping 23 matching lines...) Expand all Loading... |
62 | 73 |
63 IPC_STRUCT_TRAITS_BEGIN(printing::PwgRasterSettings) | 74 IPC_STRUCT_TRAITS_BEGIN(printing::PwgRasterSettings) |
64 IPC_STRUCT_TRAITS_MEMBER(odd_page_transform) | 75 IPC_STRUCT_TRAITS_MEMBER(odd_page_transform) |
65 IPC_STRUCT_TRAITS_MEMBER(rotate_all_pages) | 76 IPC_STRUCT_TRAITS_MEMBER(rotate_all_pages) |
66 IPC_STRUCT_TRAITS_MEMBER(reverse_page_order) | 77 IPC_STRUCT_TRAITS_MEMBER(reverse_page_order) |
67 IPC_STRUCT_TRAITS_END() | 78 IPC_STRUCT_TRAITS_END() |
68 | 79 |
69 //------------------------------------------------------------------------------ | 80 //------------------------------------------------------------------------------ |
70 // Utility process messages: | 81 // Utility process messages: |
71 // These are messages from the browser to the utility process. | 82 // These are messages from the browser to the utility process. |
72 | |
73 // Tell the utility process to render the given PDF into a PWGRaster. | 83 // Tell the utility process to render the given PDF into a PWGRaster. |
74 IPC_MESSAGE_CONTROL4(ChromeUtilityMsg_RenderPDFPagesToPWGRaster, | 84 IPC_MESSAGE_CONTROL4(ChromeUtilityMsg_RenderPDFPagesToPWGRaster, |
75 IPC::PlatformFileForTransit /* Input PDF file */, | 85 IPC::PlatformFileForTransit /* Input PDF file */, |
76 printing::PdfRenderSettings /* PDF render settings */, | 86 printing::PdfRenderSettings /* PDF render settings */, |
77 // PWG transform settings. | 87 // PWG transform settings. |
78 printing::PwgRasterSettings, | 88 printing::PwgRasterSettings, |
79 IPC::PlatformFileForTransit /* Output PWG file */) | 89 IPC::PlatformFileForTransit /* Output PWG file */) |
80 | 90 |
81 // Tells the utility process to get capabilities and defaults for the specified | 91 // 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 | 92 // 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 | 93 // crashes by executing this in a separate process. This does not run in a |
84 // sandbox. | 94 // sandbox. |
85 IPC_MESSAGE_CONTROL1(ChromeUtilityMsg_GetPrinterCapsAndDefaults, | 95 IPC_MESSAGE_CONTROL1(ChromeUtilityMsg_GetPrinterCapsAndDefaults, |
86 std::string /* printer name */) | 96 std::string /* printer name */) |
87 | 97 |
88 // Tells the utility process to get capabilities and defaults for the specified | 98 // Tells the utility process to get capabilities and defaults for the specified |
89 // printer. Used on Windows to isolate the service process from printer driver | 99 // printer. Used on Windows to isolate the service process from printer driver |
90 // crashes by executing this in a separate process. This does not run in a | 100 // crashes by executing this in a separate process. This does not run in a |
91 // sandbox. Returns result as printing::PrinterSemanticCapsAndDefaults. | 101 // sandbox. Returns result as printing::PrinterSemanticCapsAndDefaults. |
92 IPC_MESSAGE_CONTROL1(ChromeUtilityMsg_GetPrinterSemanticCapsAndDefaults, | 102 IPC_MESSAGE_CONTROL1(ChromeUtilityMsg_GetPrinterSemanticCapsAndDefaults, |
93 std::string /* printer name */) | 103 std::string /* printer name */) |
94 #endif // ENABLE_PRINT_PREVIEW | 104 #endif // ENABLE_PRINT_PREVIEW |
95 | 105 |
96 // Windows uses messages for printing even without preview. crbug.com/170859 | 106 // Windows uses messages for printing even without preview. crbug.com/170859 |
97 // Primary user of Windows without preview is CEF. crbug.com/417967 | 107 // Primary user of Windows without preview is CEF. crbug.com/417967 |
98 #if BUILDFLAG(ENABLE_PRINTING) && defined(OS_WIN) | 108 #if BUILDFLAG(ENABLE_PRINTING) && defined(OS_WIN) |
99 // Tell the utility process to start rendering the given PDF into a metafile. | 109 // Tell the utility process to start rendering the given PDF into a metafile. |
100 // Utility process would be alive until | 110 // Utility process would be alive until |
101 // ChromeUtilityMsg_RenderPDFPagesToMetafiles_Stop message. | 111 // ChromeUtilityMsg_RenderPDFPagesToMetafiles_Stop message. |
102 IPC_MESSAGE_CONTROL3(ChromeUtilityMsg_RenderPDFPagesToMetafiles, | 112 IPC_MESSAGE_CONTROL2(ChromeUtilityMsg_RenderPDFPagesToMetafiles, |
103 IPC::PlatformFileForTransit /* input_file */, | 113 IPC::PlatformFileForTransit /* input_file */, |
104 printing::PdfRenderSettings /* settings */, | 114 printing::PdfRenderSettings /* settings */) |
105 bool /* print_text_with_gdi */) | |
106 | 115 |
107 // Requests conversion of the next page. | 116 // Requests conversion of the next page. |
108 IPC_MESSAGE_CONTROL2(ChromeUtilityMsg_RenderPDFPagesToMetafiles_GetPage, | 117 IPC_MESSAGE_CONTROL2(ChromeUtilityMsg_RenderPDFPagesToMetafiles_GetPage, |
109 int /* page_number */, | 118 int /* page_number */, |
110 IPC::PlatformFileForTransit /* output_file */) | 119 IPC::PlatformFileForTransit /* output_file */) |
111 | 120 |
112 // Requests utility process to stop conversion and exit. | 121 // Requests utility process to stop conversion and exit. |
113 IPC_MESSAGE_CONTROL0(ChromeUtilityMsg_RenderPDFPagesToMetafiles_Stop) | 122 IPC_MESSAGE_CONTROL0(ChromeUtilityMsg_RenderPDFPagesToMetafiles_Stop) |
114 #endif // ENABLE_PRINTING && OS_WIN | 123 #endif // ENABLE_PRINTING && OS_WIN |
115 | 124 |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
161 float /* scale_factor */) | 170 float /* scale_factor */) |
162 | 171 |
163 // Request that the given font characters be loaded by the browser so it's | 172 // Request that the given font characters be loaded by the browser so it's |
164 // cached by the OS. Please see | 173 // cached by the OS. Please see |
165 // PdfToEmfUtilityProcessHostClient::OnPreCacheFontCharacters for details. | 174 // PdfToEmfUtilityProcessHostClient::OnPreCacheFontCharacters for details. |
166 IPC_SYNC_MESSAGE_CONTROL2_0(ChromeUtilityHostMsg_PreCacheFontCharacters, | 175 IPC_SYNC_MESSAGE_CONTROL2_0(ChromeUtilityHostMsg_PreCacheFontCharacters, |
167 LOGFONT /* font_data */, | 176 LOGFONT /* font_data */, |
168 base::string16 /* characters */) | 177 base::string16 /* characters */) |
169 | 178 |
170 #endif // ENABLE_PRINTING && OS_WIN | 179 #endif // ENABLE_PRINTING && OS_WIN |
OLD | NEW |