Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(582)

Side by Side Diff: chrome/common/chrome_utility_printing_messages.h

Issue 323693002: Split printing utility IPC messages into its own file. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 // Multiply-included message file, so no include guard.
6
7 #include <string>
8 #include <vector>
9
10 #include "ipc/ipc_message_macros.h"
11 #include "ipc/ipc_platform_file.h"
12 #include "printing/backend/print_backend.h"
13 #include "printing/page_range.h"
14 #include "printing/pdf_render_settings.h"
15 #include "printing/pwg_raster_settings.h"
16
17 #if !defined(ENABLE_FULL_PRINTING)
18 #error "Full printing must be enabled"
19 #endif
20
21 #define IPC_MESSAGE_START UtilityPrintingMsgStart
22
23 IPC_STRUCT_TRAITS_BEGIN(printing::PageRange)
24 IPC_STRUCT_TRAITS_MEMBER(from)
25 IPC_STRUCT_TRAITS_MEMBER(to)
26 IPC_STRUCT_TRAITS_END()
27
28 IPC_STRUCT_TRAITS_BEGIN(printing::PrinterCapsAndDefaults)
29 IPC_STRUCT_TRAITS_MEMBER(printer_capabilities)
30 IPC_STRUCT_TRAITS_MEMBER(caps_mime_type)
31 IPC_STRUCT_TRAITS_MEMBER(printer_defaults)
32 IPC_STRUCT_TRAITS_MEMBER(defaults_mime_type)
33 IPC_STRUCT_TRAITS_END()
34
35 IPC_ENUM_TRAITS_MAX_VALUE(printing::ColorModel, printing::PROCESSCOLORMODEL_RGB)
36 IPC_ENUM_TRAITS_MAX_VALUE(printing::DuplexMode, printing::SHORT_EDGE)
37
38 IPC_STRUCT_TRAITS_BEGIN(printing::PrinterSemanticCapsAndDefaults::Paper)
39 IPC_STRUCT_TRAITS_MEMBER(name)
40 IPC_STRUCT_TRAITS_MEMBER(size_um)
41 IPC_STRUCT_TRAITS_END()
42
43 IPC_STRUCT_TRAITS_BEGIN(printing::PrinterSemanticCapsAndDefaults)
44 IPC_STRUCT_TRAITS_MEMBER(collate_capable)
45 IPC_STRUCT_TRAITS_MEMBER(collate_default)
46 IPC_STRUCT_TRAITS_MEMBER(copies_capable)
47 IPC_STRUCT_TRAITS_MEMBER(duplex_capable)
48 IPC_STRUCT_TRAITS_MEMBER(duplex_default)
49 IPC_STRUCT_TRAITS_MEMBER(color_changeable)
50 IPC_STRUCT_TRAITS_MEMBER(color_default)
51 IPC_STRUCT_TRAITS_MEMBER(color_model)
52 IPC_STRUCT_TRAITS_MEMBER(bw_model)
53 IPC_STRUCT_TRAITS_MEMBER(papers)
54 IPC_STRUCT_TRAITS_MEMBER(default_paper)
55 IPC_STRUCT_TRAITS_MEMBER(dpis)
56 IPC_STRUCT_TRAITS_MEMBER(default_dpi)
57 IPC_STRUCT_TRAITS_END()
58
59 IPC_ENUM_TRAITS(printing::PwgRasterTransformType);
60
61 IPC_STRUCT_TRAITS_BEGIN(printing::PwgRasterSettings)
62 IPC_STRUCT_TRAITS_MEMBER(odd_page_transform)
63 IPC_STRUCT_TRAITS_MEMBER(rotate_all_pages)
64 IPC_STRUCT_TRAITS_MEMBER(reverse_page_order)
65 IPC_STRUCT_TRAITS_END()
66
67 //------------------------------------------------------------------------------
68 // Utility process messages:
69 // These are messages from the browser to the utility process.
70
71 // Tell the utility process to render the given PDF into a PWGRaster.
72 IPC_MESSAGE_CONTROL4(ChromeUtilityMsg_RenderPDFPagesToPWGRaster,
73 IPC::PlatformFileForTransit, /* Input PDF file */
74 printing::PdfRenderSettings, /* PDF render settings */
75 // PWG transform settings.
76 printing::PwgRasterSettings,
77 IPC::PlatformFileForTransit /* Output PWG file */)
78
79 // Tells the utility process to get capabilities and defaults for the specified
80 // printer. Used on Windows to isolate the service process from printer driver
81 // crashes by executing this in a separate process. This does not run in a
82 // sandbox.
83 IPC_MESSAGE_CONTROL1(ChromeUtilityMsg_GetPrinterCapsAndDefaults,
84 std::string /* printer name */)
85
86 // Tells the utility process to get capabilities and defaults for the specified
87 // printer. Used on Windows to isolate the service process from printer driver
88 // crashes by executing this in a separate process. This does not run in a
89 // sandbox. Returns result as printing::PrinterSemanticCapsAndDefaults.
90 IPC_MESSAGE_CONTROL1(ChromeUtilityMsg_GetPrinterSemanticCapsAndDefaults,
91 std::string /* printer name */)
92
93
94 #if defined(WIN_PDF_METAFILE_FOR_PRINTING)
95 // Tell the utility process to render the given PDF into a metafile.
96 // The metafile path will have ".%d" inserted where the %d is the page number.
97 // If no page range is specified, all pages will be converted.
98 IPC_MESSAGE_CONTROL4(ChromeUtilityMsg_RenderPDFPagesToMetafiles,
99 IPC::PlatformFileForTransit, // PDF file
100 base::FilePath, // Base location for output metafile
101 printing::PdfRenderSettings, // PDF render settings
102 std::vector<printing::PageRange>)
103 #endif
104
105 //------------------------------------------------------------------------------
106 // Utility process host messages:
107 // These are messages from the utility process to the browser.
108
109 // Reply when the utility process has succeeded in rendering the PDF to PWG.
110 IPC_MESSAGE_CONTROL0(ChromeUtilityHostMsg_RenderPDFPagesToPWGRaster_Succeeded)
111
112 // Reply when an error occurred rendering the PDF to PWG.
113 IPC_MESSAGE_CONTROL0(ChromeUtilityHostMsg_RenderPDFPagesToPWGRaster_Failed)
114
115 // Reply when the utility process has succeeded in obtaining the printer
116 // capabilities and defaults.
117 IPC_MESSAGE_CONTROL2(ChromeUtilityHostMsg_GetPrinterCapsAndDefaults_Succeeded,
118 std::string /* printer name */,
119 printing::PrinterCapsAndDefaults)
120
121 // Reply when the utility process has succeeded in obtaining the printer
122 // semantic capabilities and defaults.
123 IPC_MESSAGE_CONTROL2(
124 ChromeUtilityHostMsg_GetPrinterSemanticCapsAndDefaults_Succeeded,
125 std::string /* printer name */,
126 printing::PrinterSemanticCapsAndDefaults)
127
128 // Reply when the utility process has failed to obtain the printer
129 // capabilities and defaults.
130 IPC_MESSAGE_CONTROL1(ChromeUtilityHostMsg_GetPrinterCapsAndDefaults_Failed,
131 std::string /* printer name */)
132
133 // Reply when the utility process has failed to obtain the printer
134 // semantic capabilities and defaults.
135 IPC_MESSAGE_CONTROL1(
136 ChromeUtilityHostMsg_GetPrinterSemanticCapsAndDefaults_Failed,
137 std::string /* printer name */)
138
139 #if defined(WIN_PDF_METAFILE_FOR_PRINTING)
140 // Reply when the utility process has succeeded in rendering the PDF.
141 IPC_MESSAGE_CONTROL2(ChromeUtilityHostMsg_RenderPDFPagesToMetafiles_Succeeded,
142 std::vector<printing::PageRange>, // Pages rendered
143 double) // Scale factor
144
145 // Reply when an error occurred rendering the PDF.
146 IPC_MESSAGE_CONTROL0(ChromeUtilityHostMsg_RenderPDFPagesToMetafile_Failed)
147 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698