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 "build/build_config.h" | 11 #include "build/build_config.h" |
11 #include "components/printing/common/printing_param_traits_macros.h" | 12 #include "components/printing/common/printing_param_traits_macros.h" |
12 #include "ipc/ipc_message_macros.h" | 13 #include "ipc/ipc_message_macros.h" |
13 #include "ipc/ipc_platform_file.h" | 14 #include "ipc/ipc_platform_file.h" |
14 #include "printing/backend/print_backend.h" | 15 #include "printing/backend/print_backend.h" |
15 #include "printing/page_range.h" | 16 #include "printing/page_range.h" |
16 #include "printing/pdf_render_settings.h" | 17 #include "printing/pdf_render_settings.h" |
17 #include "printing/pwg_raster_settings.h" | 18 #include "printing/pwg_raster_settings.h" |
18 | 19 |
| 20 #if defined(OS_WIN) |
| 21 #include <windows.h> |
| 22 #endif |
| 23 |
19 #define IPC_MESSAGE_START ChromeUtilityPrintingMsgStart | 24 #define IPC_MESSAGE_START ChromeUtilityPrintingMsgStart |
20 | 25 |
21 // Preview and Cloud Print messages. | 26 // Preview and Cloud Print messages. |
22 #if defined(ENABLE_PRINT_PREVIEW) | 27 #if defined(ENABLE_PRINT_PREVIEW) |
23 IPC_STRUCT_TRAITS_BEGIN(printing::PrinterCapsAndDefaults) | 28 IPC_STRUCT_TRAITS_BEGIN(printing::PrinterCapsAndDefaults) |
24 IPC_STRUCT_TRAITS_MEMBER(printer_capabilities) | 29 IPC_STRUCT_TRAITS_MEMBER(printer_capabilities) |
25 IPC_STRUCT_TRAITS_MEMBER(caps_mime_type) | 30 IPC_STRUCT_TRAITS_MEMBER(caps_mime_type) |
26 IPC_STRUCT_TRAITS_MEMBER(printer_defaults) | 31 IPC_STRUCT_TRAITS_MEMBER(printer_defaults) |
27 IPC_STRUCT_TRAITS_MEMBER(defaults_mime_type) | 32 IPC_STRUCT_TRAITS_MEMBER(defaults_mime_type) |
28 IPC_STRUCT_TRAITS_END() | 33 IPC_STRUCT_TRAITS_END() |
(...skipping 30 matching lines...) Expand all Loading... |
59 IPC_STRUCT_TRAITS_MEMBER(rotate_all_pages) | 64 IPC_STRUCT_TRAITS_MEMBER(rotate_all_pages) |
60 IPC_STRUCT_TRAITS_MEMBER(reverse_page_order) | 65 IPC_STRUCT_TRAITS_MEMBER(reverse_page_order) |
61 IPC_STRUCT_TRAITS_END() | 66 IPC_STRUCT_TRAITS_END() |
62 | 67 |
63 //------------------------------------------------------------------------------ | 68 //------------------------------------------------------------------------------ |
64 // Utility process messages: | 69 // Utility process messages: |
65 // These are messages from the browser to the utility process. | 70 // These are messages from the browser to the utility process. |
66 | 71 |
67 // Tell the utility process to render the given PDF into a PWGRaster. | 72 // Tell the utility process to render the given PDF into a PWGRaster. |
68 IPC_MESSAGE_CONTROL4(ChromeUtilityMsg_RenderPDFPagesToPWGRaster, | 73 IPC_MESSAGE_CONTROL4(ChromeUtilityMsg_RenderPDFPagesToPWGRaster, |
69 IPC::PlatformFileForTransit, /* Input PDF file */ | 74 IPC::PlatformFileForTransit /* Input PDF file */, |
70 printing::PdfRenderSettings, /* PDF render settings */ | 75 printing::PdfRenderSettings /* PDF render settings */, |
71 // PWG transform settings. | 76 // PWG transform settings. |
72 printing::PwgRasterSettings, | 77 printing::PwgRasterSettings, |
73 IPC::PlatformFileForTransit /* Output PWG file */) | 78 IPC::PlatformFileForTransit /* Output PWG file */) |
74 | 79 |
75 // 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 |
76 // 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 |
77 // 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 |
78 // sandbox. | 83 // sandbox. |
79 IPC_MESSAGE_CONTROL1(ChromeUtilityMsg_GetPrinterCapsAndDefaults, | 84 IPC_MESSAGE_CONTROL1(ChromeUtilityMsg_GetPrinterCapsAndDefaults, |
80 std::string /* printer name */) | 85 std::string /* printer name */) |
81 | 86 |
82 // Tells the utility process to get capabilities and defaults for the specified | 87 // Tells the utility process to get capabilities and defaults for the specified |
83 // printer. Used on Windows to isolate the service process from printer driver | 88 // printer. Used on Windows to isolate the service process from printer driver |
84 // crashes by executing this in a separate process. This does not run in a | 89 // crashes by executing this in a separate process. This does not run in a |
85 // sandbox. Returns result as printing::PrinterSemanticCapsAndDefaults. | 90 // sandbox. Returns result as printing::PrinterSemanticCapsAndDefaults. |
86 IPC_MESSAGE_CONTROL1(ChromeUtilityMsg_GetPrinterSemanticCapsAndDefaults, | 91 IPC_MESSAGE_CONTROL1(ChromeUtilityMsg_GetPrinterSemanticCapsAndDefaults, |
87 std::string /* printer name */) | 92 std::string /* printer name */) |
88 #endif // ENABLE_PRINT_PREVIEW | 93 #endif // ENABLE_PRINT_PREVIEW |
89 | 94 |
90 // Windows uses messages for printing even without preview. crbug.com/170859 | 95 // Windows uses messages for printing even without preview. crbug.com/170859 |
91 // Primary user of Windows without preview is CEF. crbug.com/417967 | 96 // Primary user of Windows without preview is CEF. crbug.com/417967 |
92 #if defined(ENABLE_PRINTING) && defined(OS_WIN) | 97 #if defined(ENABLE_PRINTING) && defined(OS_WIN) |
93 // Tell the utility process to start rendering the given PDF into a metafile. | 98 // Tell the utility process to start rendering the given PDF into a metafile. |
94 // Utility process would be alive until | 99 // Utility process would be alive until |
95 // ChromeUtilityMsg_RenderPDFPagesToMetafiles_Stop message. | 100 // ChromeUtilityMsg_RenderPDFPagesToMetafiles_Stop message. |
96 IPC_MESSAGE_CONTROL2(ChromeUtilityMsg_RenderPDFPagesToMetafiles, | 101 IPC_MESSAGE_CONTROL3(ChromeUtilityMsg_RenderPDFPagesToMetafiles, |
97 IPC::PlatformFileForTransit, /* input_file */ | 102 IPC::PlatformFileForTransit /* input_file */, |
98 printing::PdfRenderSettings /* settings */) | 103 printing::PdfRenderSettings /* settings */, |
| 104 bool /* print_text_with_gdi */) |
99 | 105 |
100 // Requests conversion of the next page. | 106 // Requests conversion of the next page. |
101 IPC_MESSAGE_CONTROL2(ChromeUtilityMsg_RenderPDFPagesToMetafiles_GetPage, | 107 IPC_MESSAGE_CONTROL2(ChromeUtilityMsg_RenderPDFPagesToMetafiles_GetPage, |
102 int /* page_number */, | 108 int /* page_number */, |
103 IPC::PlatformFileForTransit /* output_file */) | 109 IPC::PlatformFileForTransit /* output_file */) |
104 | 110 |
105 // Requests utility process to stop conversion and exit. | 111 // Requests utility process to stop conversion and exit. |
106 IPC_MESSAGE_CONTROL0(ChromeUtilityMsg_RenderPDFPagesToMetafiles_Stop) | 112 IPC_MESSAGE_CONTROL0(ChromeUtilityMsg_RenderPDFPagesToMetafiles_Stop) |
107 #endif // ENABLE_PRINTING && OS_WIN | 113 #endif // ENABLE_PRINTING && OS_WIN |
108 | 114 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 #if defined(ENABLE_PRINTING) && defined(OS_WIN) | 151 #if defined(ENABLE_PRINTING) && defined(OS_WIN) |
146 // Reply when the utility process loaded PDF. |page_count| is 0, if loading | 152 // Reply when the utility process loaded PDF. |page_count| is 0, if loading |
147 // failed. | 153 // failed. |
148 IPC_MESSAGE_CONTROL1(ChromeUtilityHostMsg_RenderPDFPagesToMetafiles_PageCount, | 154 IPC_MESSAGE_CONTROL1(ChromeUtilityHostMsg_RenderPDFPagesToMetafiles_PageCount, |
149 int /* page_count */) | 155 int /* page_count */) |
150 | 156 |
151 // Reply when the utility process rendered the PDF page. | 157 // Reply when the utility process rendered the PDF page. |
152 IPC_MESSAGE_CONTROL2(ChromeUtilityHostMsg_RenderPDFPagesToMetafiles_PageDone, | 158 IPC_MESSAGE_CONTROL2(ChromeUtilityHostMsg_RenderPDFPagesToMetafiles_PageDone, |
153 bool /* success */, | 159 bool /* success */, |
154 float /* scale_factor */) | 160 float /* scale_factor */) |
| 161 |
| 162 // Request that the given font characters be loaded by the browser so it's |
| 163 // cached by the OS. Please see |
| 164 // PdfToEmfUtilityProcessHostClient::OnPreCacheFontCharacters for details. |
| 165 IPC_SYNC_MESSAGE_CONTROL2_0(ChromeUtilityHostMsg_PreCacheFontCharacters, |
| 166 LOGFONT /* font_data */, |
| 167 base::string16 /* characters */) |
| 168 |
155 #endif // ENABLE_PRINTING && OS_WIN | 169 #endif // ENABLE_PRINTING && OS_WIN |
OLD | NEW |