| 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_platform_file.h" | 14 #include "ipc/ipc_platform_file.h" |
| 15 #include "printing/backend/print_backend.h" | 15 #include "printing/backend/print_backend.h" |
| 16 #include "printing/features/features.h" |
| 16 #include "printing/page_range.h" | 17 #include "printing/page_range.h" |
| 17 #include "printing/pdf_render_settings.h" | 18 #include "printing/pdf_render_settings.h" |
| 18 #include "printing/pwg_raster_settings.h" | 19 #include "printing/pwg_raster_settings.h" |
| 19 | 20 |
| 20 #if defined(OS_WIN) | 21 #if defined(OS_WIN) |
| 21 #include <windows.h> | 22 #include <windows.h> |
| 22 #endif | 23 #endif |
| 23 | 24 |
| 24 #define IPC_MESSAGE_START ChromeUtilityPrintingMsgStart | 25 #define IPC_MESSAGE_START ChromeUtilityPrintingMsgStart |
| 25 | 26 |
| 26 // Preview and Cloud Print messages. | 27 // Preview and Cloud Print messages. |
| 27 #if defined(ENABLE_PRINT_PREVIEW) | 28 #if BUILDFLAG(ENABLE_PRINT_PREVIEW) |
| 28 IPC_STRUCT_TRAITS_BEGIN(printing::PrinterCapsAndDefaults) | 29 IPC_STRUCT_TRAITS_BEGIN(printing::PrinterCapsAndDefaults) |
| 29 IPC_STRUCT_TRAITS_MEMBER(printer_capabilities) | 30 IPC_STRUCT_TRAITS_MEMBER(printer_capabilities) |
| 30 IPC_STRUCT_TRAITS_MEMBER(caps_mime_type) | 31 IPC_STRUCT_TRAITS_MEMBER(caps_mime_type) |
| 31 IPC_STRUCT_TRAITS_MEMBER(printer_defaults) | 32 IPC_STRUCT_TRAITS_MEMBER(printer_defaults) |
| 32 IPC_STRUCT_TRAITS_MEMBER(defaults_mime_type) | 33 IPC_STRUCT_TRAITS_MEMBER(defaults_mime_type) |
| 33 IPC_STRUCT_TRAITS_END() | 34 IPC_STRUCT_TRAITS_END() |
| 34 | 35 |
| 35 IPC_ENUM_TRAITS_MAX_VALUE(printing::ColorModel, printing::PROCESSCOLORMODEL_RGB) | 36 IPC_ENUM_TRAITS_MAX_VALUE(printing::ColorModel, printing::PROCESSCOLORMODEL_RGB) |
| 36 | 37 |
| 37 IPC_STRUCT_TRAITS_BEGIN(printing::PrinterSemanticCapsAndDefaults::Paper) | 38 IPC_STRUCT_TRAITS_BEGIN(printing::PrinterSemanticCapsAndDefaults::Paper) |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 // Tells the utility process to get capabilities and defaults for the specified | 88 // Tells the utility process to get capabilities and defaults for the specified |
| 88 // printer. Used on Windows to isolate the service process from printer driver | 89 // printer. Used on Windows to isolate the service process from printer driver |
| 89 // crashes by executing this in a separate process. This does not run in a | 90 // crashes by executing this in a separate process. This does not run in a |
| 90 // sandbox. Returns result as printing::PrinterSemanticCapsAndDefaults. | 91 // sandbox. Returns result as printing::PrinterSemanticCapsAndDefaults. |
| 91 IPC_MESSAGE_CONTROL1(ChromeUtilityMsg_GetPrinterSemanticCapsAndDefaults, | 92 IPC_MESSAGE_CONTROL1(ChromeUtilityMsg_GetPrinterSemanticCapsAndDefaults, |
| 92 std::string /* printer name */) | 93 std::string /* printer name */) |
| 93 #endif // ENABLE_PRINT_PREVIEW | 94 #endif // ENABLE_PRINT_PREVIEW |
| 94 | 95 |
| 95 // Windows uses messages for printing even without preview. crbug.com/170859 | 96 // Windows uses messages for printing even without preview. crbug.com/170859 |
| 96 // Primary user of Windows without preview is CEF. crbug.com/417967 | 97 // Primary user of Windows without preview is CEF. crbug.com/417967 |
| 97 #if defined(ENABLE_PRINTING) && defined(OS_WIN) | 98 #if BUILDFLAG(ENABLE_PRINTING) && defined(OS_WIN) |
| 98 // Tell the utility process to start rendering the given PDF into a metafile. | 99 // Tell the utility process to start rendering the given PDF into a metafile. |
| 99 // Utility process would be alive until | 100 // Utility process would be alive until |
| 100 // ChromeUtilityMsg_RenderPDFPagesToMetafiles_Stop message. | 101 // ChromeUtilityMsg_RenderPDFPagesToMetafiles_Stop message. |
| 101 IPC_MESSAGE_CONTROL3(ChromeUtilityMsg_RenderPDFPagesToMetafiles, | 102 IPC_MESSAGE_CONTROL3(ChromeUtilityMsg_RenderPDFPagesToMetafiles, |
| 102 IPC::PlatformFileForTransit /* input_file */, | 103 IPC::PlatformFileForTransit /* input_file */, |
| 103 printing::PdfRenderSettings /* settings */, | 104 printing::PdfRenderSettings /* settings */, |
| 104 bool /* print_text_with_gdi */) | 105 bool /* print_text_with_gdi */) |
| 105 | 106 |
| 106 // Requests conversion of the next page. | 107 // Requests conversion of the next page. |
| 107 IPC_MESSAGE_CONTROL2(ChromeUtilityMsg_RenderPDFPagesToMetafiles_GetPage, | 108 IPC_MESSAGE_CONTROL2(ChromeUtilityMsg_RenderPDFPagesToMetafiles_GetPage, |
| 108 int /* page_number */, | 109 int /* page_number */, |
| 109 IPC::PlatformFileForTransit /* output_file */) | 110 IPC::PlatformFileForTransit /* output_file */) |
| 110 | 111 |
| 111 // Requests utility process to stop conversion and exit. | 112 // Requests utility process to stop conversion and exit. |
| 112 IPC_MESSAGE_CONTROL0(ChromeUtilityMsg_RenderPDFPagesToMetafiles_Stop) | 113 IPC_MESSAGE_CONTROL0(ChromeUtilityMsg_RenderPDFPagesToMetafiles_Stop) |
| 113 #endif // ENABLE_PRINTING && OS_WIN | 114 #endif // ENABLE_PRINTING && OS_WIN |
| 114 | 115 |
| 115 //------------------------------------------------------------------------------ | 116 //------------------------------------------------------------------------------ |
| 116 // Utility process host messages: | 117 // Utility process host messages: |
| 117 // These are messages from the utility process to the browser. | 118 // These are messages from the utility process to the browser. |
| 118 | 119 |
| 119 #if defined(ENABLE_PRINT_PREVIEW) | 120 #if BUILDFLAG(ENABLE_PRINT_PREVIEW) |
| 120 // Reply when the utility process has succeeded in rendering the PDF to PWG. | 121 // Reply when the utility process has succeeded in rendering the PDF to PWG. |
| 121 IPC_MESSAGE_CONTROL0(ChromeUtilityHostMsg_RenderPDFPagesToPWGRaster_Succeeded) | 122 IPC_MESSAGE_CONTROL0(ChromeUtilityHostMsg_RenderPDFPagesToPWGRaster_Succeeded) |
| 122 | 123 |
| 123 // Reply when an error occurred rendering the PDF to PWG. | 124 // Reply when an error occurred rendering the PDF to PWG. |
| 124 IPC_MESSAGE_CONTROL0(ChromeUtilityHostMsg_RenderPDFPagesToPWGRaster_Failed) | 125 IPC_MESSAGE_CONTROL0(ChromeUtilityHostMsg_RenderPDFPagesToPWGRaster_Failed) |
| 125 | 126 |
| 126 // Reply when the utility process has succeeded in obtaining the printer | 127 // Reply when the utility process has succeeded in obtaining the printer |
| 127 // capabilities and defaults. | 128 // capabilities and defaults. |
| 128 IPC_MESSAGE_CONTROL2(ChromeUtilityHostMsg_GetPrinterCapsAndDefaults_Succeeded, | 129 IPC_MESSAGE_CONTROL2(ChromeUtilityHostMsg_GetPrinterCapsAndDefaults_Succeeded, |
| 129 std::string /* printer name */, | 130 std::string /* printer name */, |
| (...skipping 11 matching lines...) Expand all Loading... |
| 141 IPC_MESSAGE_CONTROL1(ChromeUtilityHostMsg_GetPrinterCapsAndDefaults_Failed, | 142 IPC_MESSAGE_CONTROL1(ChromeUtilityHostMsg_GetPrinterCapsAndDefaults_Failed, |
| 142 std::string /* printer name */) | 143 std::string /* printer name */) |
| 143 | 144 |
| 144 // Reply when the utility process has failed to obtain the printer | 145 // Reply when the utility process has failed to obtain the printer |
| 145 // semantic capabilities and defaults. | 146 // semantic capabilities and defaults. |
| 146 IPC_MESSAGE_CONTROL1( | 147 IPC_MESSAGE_CONTROL1( |
| 147 ChromeUtilityHostMsg_GetPrinterSemanticCapsAndDefaults_Failed, | 148 ChromeUtilityHostMsg_GetPrinterSemanticCapsAndDefaults_Failed, |
| 148 std::string /* printer name */) | 149 std::string /* printer name */) |
| 149 #endif // ENABLE_PRINT_PREVIEW | 150 #endif // ENABLE_PRINT_PREVIEW |
| 150 | 151 |
| 151 #if defined(ENABLE_PRINTING) && defined(OS_WIN) | 152 #if BUILDFLAG(ENABLE_PRINTING) && defined(OS_WIN) |
| 152 // Reply when the utility process loaded PDF. |page_count| is 0, if loading | 153 // Reply when the utility process loaded PDF. |page_count| is 0, if loading |
| 153 // failed. | 154 // failed. |
| 154 IPC_MESSAGE_CONTROL1(ChromeUtilityHostMsg_RenderPDFPagesToMetafiles_PageCount, | 155 IPC_MESSAGE_CONTROL1(ChromeUtilityHostMsg_RenderPDFPagesToMetafiles_PageCount, |
| 155 int /* page_count */) | 156 int /* page_count */) |
| 156 | 157 |
| 157 // Reply when the utility process rendered the PDF page. | 158 // Reply when the utility process rendered the PDF page. |
| 158 IPC_MESSAGE_CONTROL2(ChromeUtilityHostMsg_RenderPDFPagesToMetafiles_PageDone, | 159 IPC_MESSAGE_CONTROL2(ChromeUtilityHostMsg_RenderPDFPagesToMetafiles_PageDone, |
| 159 bool /* success */, | 160 bool /* success */, |
| 160 float /* scale_factor */) | 161 float /* scale_factor */) |
| 161 | 162 |
| 162 // Request that the given font characters be loaded by the browser so it's | 163 // Request that the given font characters be loaded by the browser so it's |
| 163 // cached by the OS. Please see | 164 // cached by the OS. Please see |
| 164 // PdfToEmfUtilityProcessHostClient::OnPreCacheFontCharacters for details. | 165 // PdfToEmfUtilityProcessHostClient::OnPreCacheFontCharacters for details. |
| 165 IPC_SYNC_MESSAGE_CONTROL2_0(ChromeUtilityHostMsg_PreCacheFontCharacters, | 166 IPC_SYNC_MESSAGE_CONTROL2_0(ChromeUtilityHostMsg_PreCacheFontCharacters, |
| 166 LOGFONT /* font_data */, | 167 LOGFONT /* font_data */, |
| 167 base::string16 /* characters */) | 168 base::string16 /* characters */) |
| 168 | 169 |
| 169 #endif // ENABLE_PRINTING && OS_WIN | 170 #endif // ENABLE_PRINTING && OS_WIN |
| OLD | NEW |