OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // IPC messages for printing. | 5 // IPC messages for printing. |
6 // Multiply-included message file, hence no include guard. | 6 // Multiply-included message file, hence no include guard. |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/memory/shared_memory.h" | 13 #include "base/memory/shared_memory.h" |
14 #include "base/values.h" | 14 #include "base/values.h" |
15 #include "build/build_config.h" | 15 #include "build/build_config.h" |
16 #include "components/printing/common/printing_param_traits_macros.h" | 16 #include "components/printing/common/printing_param_traits_macros.h" |
17 #include "ipc/ipc_message_macros.h" | 17 #include "ipc/ipc_message_macros.h" |
| 18 #include "printing/features/features.h" |
18 #include "printing/page_range.h" | 19 #include "printing/page_range.h" |
19 #include "printing/page_size_margins.h" | 20 #include "printing/page_size_margins.h" |
20 #include "printing/print_job_constants.h" | 21 #include "printing/print_job_constants.h" |
21 #include "third_party/WebKit/public/web/WebPrintScalingOption.h" | 22 #include "third_party/WebKit/public/web/WebPrintScalingOption.h" |
22 #include "ui/gfx/geometry/rect.h" | 23 #include "ui/gfx/geometry/rect.h" |
23 #include "ui/gfx/ipc/geometry/gfx_param_traits.h" | 24 #include "ui/gfx/ipc/geometry/gfx_param_traits.h" |
24 #include "ui/gfx/ipc/skia/gfx_skia_param_traits.h" | 25 #include "ui/gfx/ipc/skia/gfx_skia_param_traits.h" |
25 #include "ui/gfx/native_widget_types.h" | 26 #include "ui/gfx/native_widget_types.h" |
26 | 27 |
27 // Force multiple inclusion of the param traits file to generate all methods. | 28 // Force multiple inclusion of the param traits file to generate all methods. |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 PrintMsg_PrintPages_Params(const PrintMsg_PrintPages_Params& other); | 66 PrintMsg_PrintPages_Params(const PrintMsg_PrintPages_Params& other); |
66 ~PrintMsg_PrintPages_Params(); | 67 ~PrintMsg_PrintPages_Params(); |
67 | 68 |
68 // Resets the members of the struct to 0. | 69 // Resets the members of the struct to 0. |
69 void Reset(); | 70 void Reset(); |
70 | 71 |
71 PrintMsg_Print_Params params; | 72 PrintMsg_Print_Params params; |
72 std::vector<int> pages; | 73 std::vector<int> pages; |
73 }; | 74 }; |
74 | 75 |
75 #if defined(ENABLE_PRINT_PREVIEW) | 76 #if BUILDFLAG(ENABLE_PRINT_PREVIEW) |
76 struct PrintHostMsg_RequestPrintPreview_Params { | 77 struct PrintHostMsg_RequestPrintPreview_Params { |
77 PrintHostMsg_RequestPrintPreview_Params(); | 78 PrintHostMsg_RequestPrintPreview_Params(); |
78 ~PrintHostMsg_RequestPrintPreview_Params(); | 79 ~PrintHostMsg_RequestPrintPreview_Params(); |
79 bool is_modifiable; | 80 bool is_modifiable; |
80 bool webnode_only; | 81 bool webnode_only; |
81 bool has_selection; | 82 bool has_selection; |
82 bool selection_only; | 83 bool selection_only; |
83 }; | 84 }; |
84 | 85 |
85 struct PrintHostMsg_SetOptionsFromDocument_Params { | 86 struct PrintHostMsg_SetOptionsFromDocument_Params { |
86 PrintHostMsg_SetOptionsFromDocument_Params(); | 87 PrintHostMsg_SetOptionsFromDocument_Params(); |
87 ~PrintHostMsg_SetOptionsFromDocument_Params(); | 88 ~PrintHostMsg_SetOptionsFromDocument_Params(); |
88 | 89 |
89 bool is_scaling_disabled; | 90 bool is_scaling_disabled; |
90 int copies; | 91 int copies; |
91 printing::DuplexMode duplex; | 92 printing::DuplexMode duplex; |
92 printing::PageRanges page_ranges; | 93 printing::PageRanges page_ranges; |
93 }; | 94 }; |
94 #endif // defined(ENABLE_PRINT_PREVIEW) | 95 #endif // BUILDFLAG(ENABLE_PRINT_PREVIEW) |
95 | 96 |
96 #endif // COMPONENTS_PRINTING_COMMON_PRINT_MESSAGES_H_ | 97 #endif // COMPONENTS_PRINTING_COMMON_PRINT_MESSAGES_H_ |
97 | 98 |
98 #define IPC_MESSAGE_START PrintMsgStart | 99 #define IPC_MESSAGE_START PrintMsgStart |
99 | 100 |
100 IPC_ENUM_TRAITS_MAX_VALUE(blink::WebPrintScalingOption, | 101 IPC_ENUM_TRAITS_MAX_VALUE(blink::WebPrintScalingOption, |
101 blink::WebPrintScalingOptionLast) | 102 blink::WebPrintScalingOptionLast) |
102 | 103 |
103 // Parameters for a render request. | 104 // Parameters for a render request. |
104 IPC_STRUCT_TRAITS_BEGIN(PrintMsg_Print_Params) | 105 IPC_STRUCT_TRAITS_BEGIN(PrintMsg_Print_Params) |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 // The page number is the indicator of the square that should be rendered | 175 // The page number is the indicator of the square that should be rendered |
175 // according to the layout specified in PrintMsg_Print_Params. | 176 // according to the layout specified in PrintMsg_Print_Params. |
176 IPC_STRUCT_MEMBER(int, page_number) | 177 IPC_STRUCT_MEMBER(int, page_number) |
177 IPC_STRUCT_END() | 178 IPC_STRUCT_END() |
178 | 179 |
179 IPC_STRUCT_TRAITS_BEGIN(printing::PageRange) | 180 IPC_STRUCT_TRAITS_BEGIN(printing::PageRange) |
180 IPC_STRUCT_TRAITS_MEMBER(from) | 181 IPC_STRUCT_TRAITS_MEMBER(from) |
181 IPC_STRUCT_TRAITS_MEMBER(to) | 182 IPC_STRUCT_TRAITS_MEMBER(to) |
182 IPC_STRUCT_TRAITS_END() | 183 IPC_STRUCT_TRAITS_END() |
183 | 184 |
184 #if defined(ENABLE_PRINT_PREVIEW) | 185 #if BUILDFLAG(ENABLE_PRINT_PREVIEW) |
185 IPC_STRUCT_TRAITS_BEGIN(PrintHostMsg_RequestPrintPreview_Params) | 186 IPC_STRUCT_TRAITS_BEGIN(PrintHostMsg_RequestPrintPreview_Params) |
186 IPC_STRUCT_TRAITS_MEMBER(is_modifiable) | 187 IPC_STRUCT_TRAITS_MEMBER(is_modifiable) |
187 IPC_STRUCT_TRAITS_MEMBER(webnode_only) | 188 IPC_STRUCT_TRAITS_MEMBER(webnode_only) |
188 IPC_STRUCT_TRAITS_MEMBER(has_selection) | 189 IPC_STRUCT_TRAITS_MEMBER(has_selection) |
189 IPC_STRUCT_TRAITS_MEMBER(selection_only) | 190 IPC_STRUCT_TRAITS_MEMBER(selection_only) |
190 IPC_STRUCT_TRAITS_END() | 191 IPC_STRUCT_TRAITS_END() |
191 | 192 |
192 IPC_STRUCT_TRAITS_BEGIN(PrintHostMsg_SetOptionsFromDocument_Params) | 193 IPC_STRUCT_TRAITS_BEGIN(PrintHostMsg_SetOptionsFromDocument_Params) |
193 // Specifies whether print scaling is enabled or not. | 194 // Specifies whether print scaling is enabled or not. |
194 IPC_STRUCT_TRAITS_MEMBER(is_scaling_disabled) | 195 IPC_STRUCT_TRAITS_MEMBER(is_scaling_disabled) |
195 | 196 |
196 // Specifies number of copies to be printed. | 197 // Specifies number of copies to be printed. |
197 IPC_STRUCT_TRAITS_MEMBER(copies) | 198 IPC_STRUCT_TRAITS_MEMBER(copies) |
198 | 199 |
199 // Specifies paper handling option. | 200 // Specifies paper handling option. |
200 IPC_STRUCT_TRAITS_MEMBER(duplex) | 201 IPC_STRUCT_TRAITS_MEMBER(duplex) |
201 | 202 |
202 // Specifies page range to be printed. | 203 // Specifies page range to be printed. |
203 IPC_STRUCT_TRAITS_MEMBER(page_ranges) | 204 IPC_STRUCT_TRAITS_MEMBER(page_ranges) |
204 IPC_STRUCT_TRAITS_END() | 205 IPC_STRUCT_TRAITS_END() |
205 #endif // defined(ENABLE_PRINT_PREVIEW) | 206 #endif // BUILDFLAG(ENABLE_PRINT_PREVIEW) |
206 | 207 |
207 IPC_STRUCT_TRAITS_BEGIN(printing::PageSizeMargins) | 208 IPC_STRUCT_TRAITS_BEGIN(printing::PageSizeMargins) |
208 IPC_STRUCT_TRAITS_MEMBER(content_width) | 209 IPC_STRUCT_TRAITS_MEMBER(content_width) |
209 IPC_STRUCT_TRAITS_MEMBER(content_height) | 210 IPC_STRUCT_TRAITS_MEMBER(content_height) |
210 IPC_STRUCT_TRAITS_MEMBER(margin_left) | 211 IPC_STRUCT_TRAITS_MEMBER(margin_left) |
211 IPC_STRUCT_TRAITS_MEMBER(margin_right) | 212 IPC_STRUCT_TRAITS_MEMBER(margin_right) |
212 IPC_STRUCT_TRAITS_MEMBER(margin_top) | 213 IPC_STRUCT_TRAITS_MEMBER(margin_top) |
213 IPC_STRUCT_TRAITS_MEMBER(margin_bottom) | 214 IPC_STRUCT_TRAITS_MEMBER(margin_bottom) |
214 IPC_STRUCT_TRAITS_END() | 215 IPC_STRUCT_TRAITS_END() |
215 | 216 |
216 IPC_STRUCT_TRAITS_BEGIN(PrintMsg_PrintPages_Params) | 217 IPC_STRUCT_TRAITS_BEGIN(PrintMsg_PrintPages_Params) |
217 // Parameters to render the page as a printed page. It must always be the same | 218 // Parameters to render the page as a printed page. It must always be the same |
218 // value for all the document. | 219 // value for all the document. |
219 IPC_STRUCT_TRAITS_MEMBER(params) | 220 IPC_STRUCT_TRAITS_MEMBER(params) |
220 | 221 |
221 // If empty, this means a request to render all the printed pages. | 222 // If empty, this means a request to render all the printed pages. |
222 IPC_STRUCT_TRAITS_MEMBER(pages) | 223 IPC_STRUCT_TRAITS_MEMBER(pages) |
223 IPC_STRUCT_TRAITS_END() | 224 IPC_STRUCT_TRAITS_END() |
224 | 225 |
225 #if defined(ENABLE_PRINT_PREVIEW) | 226 #if BUILDFLAG(ENABLE_PRINT_PREVIEW) |
226 // Parameters to describe a rendered document. | 227 // Parameters to describe a rendered document. |
227 IPC_STRUCT_BEGIN(PrintHostMsg_DidPreviewDocument_Params) | 228 IPC_STRUCT_BEGIN(PrintHostMsg_DidPreviewDocument_Params) |
228 // A shared memory handle to metafile data. | 229 // A shared memory handle to metafile data. |
229 IPC_STRUCT_MEMBER(base::SharedMemoryHandle, metafile_data_handle) | 230 IPC_STRUCT_MEMBER(base::SharedMemoryHandle, metafile_data_handle) |
230 | 231 |
231 // Size of metafile data. | 232 // Size of metafile data. |
232 IPC_STRUCT_MEMBER(uint32_t, data_size) | 233 IPC_STRUCT_MEMBER(uint32_t, data_size) |
233 | 234 |
234 // Cookie for the document to ensure correctness. | 235 // Cookie for the document to ensure correctness. |
235 IPC_STRUCT_MEMBER(int, document_cookie) | 236 IPC_STRUCT_MEMBER(int, document_cookie) |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 | 273 |
273 // Scaling % to fit to page | 274 // Scaling % to fit to page |
274 IPC_STRUCT_MEMBER(int, fit_to_page_scaling) | 275 IPC_STRUCT_MEMBER(int, fit_to_page_scaling) |
275 | 276 |
276 // The id of the preview request. | 277 // The id of the preview request. |
277 IPC_STRUCT_MEMBER(int, preview_request_id) | 278 IPC_STRUCT_MEMBER(int, preview_request_id) |
278 | 279 |
279 // Indicates whether the existing preview data needs to be cleared or not. | 280 // Indicates whether the existing preview data needs to be cleared or not. |
280 IPC_STRUCT_MEMBER(bool, clear_preview_data) | 281 IPC_STRUCT_MEMBER(bool, clear_preview_data) |
281 IPC_STRUCT_END() | 282 IPC_STRUCT_END() |
282 #endif // defined(ENABLE_PRINT_PREVIEW) | 283 #endif // BUILDFLAG(ENABLE_PRINT_PREVIEW) |
283 | 284 |
284 // Parameters to describe a rendered page. | 285 // Parameters to describe a rendered page. |
285 IPC_STRUCT_BEGIN(PrintHostMsg_DidPrintPage_Params) | 286 IPC_STRUCT_BEGIN(PrintHostMsg_DidPrintPage_Params) |
286 // A shared memory handle to the EMF data. This data can be quite large so a | 287 // A shared memory handle to the EMF data. This data can be quite large so a |
287 // memory map needs to be used. | 288 // memory map needs to be used. |
288 IPC_STRUCT_MEMBER(base::SharedMemoryHandle, metafile_data_handle) | 289 IPC_STRUCT_MEMBER(base::SharedMemoryHandle, metafile_data_handle) |
289 | 290 |
290 // Size of the metafile data. | 291 // Size of the metafile data. |
291 IPC_STRUCT_MEMBER(uint32_t, data_size) | 292 IPC_STRUCT_MEMBER(uint32_t, data_size) |
292 | 293 |
(...skipping 18 matching lines...) Expand all Loading... |
311 IPC_STRUCT_MEMBER(int, expected_pages_count) | 312 IPC_STRUCT_MEMBER(int, expected_pages_count) |
312 IPC_STRUCT_MEMBER(bool, has_selection) | 313 IPC_STRUCT_MEMBER(bool, has_selection) |
313 IPC_STRUCT_MEMBER(bool, is_scripted) | 314 IPC_STRUCT_MEMBER(bool, is_scripted) |
314 IPC_STRUCT_MEMBER(bool, is_modifiable) | 315 IPC_STRUCT_MEMBER(bool, is_modifiable) |
315 IPC_STRUCT_MEMBER(printing::MarginType, margin_type) | 316 IPC_STRUCT_MEMBER(printing::MarginType, margin_type) |
316 IPC_STRUCT_END() | 317 IPC_STRUCT_END() |
317 | 318 |
318 | 319 |
319 // Messages sent from the browser to the renderer. | 320 // Messages sent from the browser to the renderer. |
320 | 321 |
321 #if defined(ENABLE_PRINT_PREVIEW) | 322 #if BUILDFLAG(ENABLE_PRINT_PREVIEW) |
322 // Tells the render view to initiate print preview for the entire document. | 323 // Tells the render view to initiate print preview for the entire document. |
323 IPC_MESSAGE_ROUTED1(PrintMsg_InitiatePrintPreview, bool /* selection_only */) | 324 IPC_MESSAGE_ROUTED1(PrintMsg_InitiatePrintPreview, bool /* selection_only */) |
324 #endif // defined(ENABLE_PRINT_PREVIEW) | 325 #endif // BUILDFLAG(ENABLE_PRINT_PREVIEW) |
325 | 326 |
326 // Tells the render frame to initiate printing or print preview for a particular | 327 // Tells the render frame to initiate printing or print preview for a particular |
327 // node, depending on which mode the render frame is in. | 328 // node, depending on which mode the render frame is in. |
328 IPC_MESSAGE_ROUTED0(PrintMsg_PrintNodeUnderContextMenu) | 329 IPC_MESSAGE_ROUTED0(PrintMsg_PrintNodeUnderContextMenu) |
329 | 330 |
330 #if defined(ENABLE_BASIC_PRINTING) && defined(ENABLE_PRINT_PREVIEW) | 331 #if BUILDFLAG(ENABLE_BASIC_PRINTING) && BUILDFLAG(ENABLE_PRINT_PREVIEW) |
331 // Tells the renderer to print the print preview tab's PDF plugin without | 332 // Tells the renderer to print the print preview tab's PDF plugin without |
332 // showing the print dialog. (This is the final step in the print preview | 333 // showing the print dialog. (This is the final step in the print preview |
333 // workflow.) | 334 // workflow.) |
334 IPC_MESSAGE_ROUTED1(PrintMsg_PrintForPrintPreview, | 335 IPC_MESSAGE_ROUTED1(PrintMsg_PrintForPrintPreview, |
335 base::DictionaryValue /* settings */) | 336 base::DictionaryValue /* settings */) |
336 #endif // defined(ENABLE_BASIC_PRINTING) && defined(ENABLE_PRINT_PREVIEW) | 337 #endif // BUILDFLAG(ENABLE_BASIC_PRINTING) && BUILDFLAG(ENABLE_PRINT_PREVIEW) |
337 | 338 |
338 #if defined(ENABLE_BASIC_PRINTING) | 339 #if BUILDFLAG(ENABLE_BASIC_PRINTING) |
339 // Tells the render view to switch the CSS to print media type, renders every | 340 // Tells the render view to switch the CSS to print media type, renders every |
340 // requested pages and switch back the CSS to display media type. | 341 // requested pages and switch back the CSS to display media type. |
341 IPC_MESSAGE_ROUTED0(PrintMsg_PrintPages) | 342 IPC_MESSAGE_ROUTED0(PrintMsg_PrintPages) |
342 | 343 |
343 // Like PrintMsg_PrintPages, but using the print preview document's frame/node. | 344 // Like PrintMsg_PrintPages, but using the print preview document's frame/node. |
344 IPC_MESSAGE_ROUTED0(PrintMsg_PrintForSystemDialog) | 345 IPC_MESSAGE_ROUTED0(PrintMsg_PrintForSystemDialog) |
345 #endif // defined(ENABLE_BASIC_PRINTING) | 346 #endif // BUILDFLAG(ENABLE_BASIC_PRINTING) |
346 | 347 |
347 // Tells the render view that printing is done so it can clean up. | 348 // Tells the render view that printing is done so it can clean up. |
348 IPC_MESSAGE_ROUTED1(PrintMsg_PrintingDone, | 349 IPC_MESSAGE_ROUTED1(PrintMsg_PrintingDone, |
349 bool /* success */) | 350 bool /* success */) |
350 | 351 |
351 // Tells the render view whether scripted printing is blocked or not. | 352 // Tells the render view whether scripted printing is blocked or not. |
352 IPC_MESSAGE_ROUTED1(PrintMsg_SetScriptedPrintingBlocked, | 353 IPC_MESSAGE_ROUTED1(PrintMsg_SetScriptedPrintingBlocked, |
353 bool /* blocked */) | 354 bool /* blocked */) |
354 | 355 |
355 #if defined(ENABLE_PRINT_PREVIEW) | 356 #if BUILDFLAG(ENABLE_PRINT_PREVIEW) |
356 // Tells the render view to switch the CSS to print media type, renders every | 357 // Tells the render view to switch the CSS to print media type, renders every |
357 // requested pages for print preview using the given |settings|. This gets | 358 // requested pages for print preview using the given |settings|. This gets |
358 // called multiple times as the user updates settings. | 359 // called multiple times as the user updates settings. |
359 IPC_MESSAGE_ROUTED1(PrintMsg_PrintPreview, | 360 IPC_MESSAGE_ROUTED1(PrintMsg_PrintPreview, |
360 base::DictionaryValue /* settings */) | 361 base::DictionaryValue /* settings */) |
361 #endif // defined(ENABLE_PRINT_PREVIEW) | 362 #endif // BUILDFLAG(ENABLE_PRINT_PREVIEW) |
362 | 363 |
363 // Messages sent from the renderer to the browser. | 364 // Messages sent from the renderer to the browser. |
364 | 365 |
365 // Check if printing is enabled. | 366 // Check if printing is enabled. |
366 IPC_SYNC_MESSAGE_ROUTED0_1(PrintHostMsg_IsPrintingEnabled, | 367 IPC_SYNC_MESSAGE_ROUTED0_1(PrintHostMsg_IsPrintingEnabled, |
367 bool /* is_enabled */) | 368 bool /* is_enabled */) |
368 | 369 |
369 // Tells the browser that the renderer is done calculating the number of | 370 // Tells the browser that the renderer is done calculating the number of |
370 // rendered pages according to the specified settings. | 371 // rendered pages according to the specified settings. |
371 IPC_MESSAGE_ROUTED2(PrintHostMsg_DidGetPrintedPagesCount, | 372 IPC_MESSAGE_ROUTED2(PrintHostMsg_DidGetPrintedPagesCount, |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
411 // in resulting PdfMetafileSkia in printing. | 412 // in resulting PdfMetafileSkia in printing. |
412 IPC_SYNC_MESSAGE_CONTROL1_2(PrintHostMsg_AllocateTempFileForPrinting, | 413 IPC_SYNC_MESSAGE_CONTROL1_2(PrintHostMsg_AllocateTempFileForPrinting, |
413 int /* render_view_id */, | 414 int /* render_view_id */, |
414 base::FileDescriptor /* temp file fd */, | 415 base::FileDescriptor /* temp file fd */, |
415 int /* fd in browser*/) // Used only by Chrome OS. | 416 int /* fd in browser*/) // Used only by Chrome OS. |
416 IPC_MESSAGE_CONTROL2(PrintHostMsg_TempFileForPrintingWritten, | 417 IPC_MESSAGE_CONTROL2(PrintHostMsg_TempFileForPrintingWritten, |
417 int /* render_view_id */, | 418 int /* render_view_id */, |
418 int /* fd in browser */) // Used only by Chrome OS. | 419 int /* fd in browser */) // Used only by Chrome OS. |
419 #endif // defined(OS_ANDROID) | 420 #endif // defined(OS_ANDROID) |
420 | 421 |
421 #if defined(ENABLE_PRINT_PREVIEW) | 422 #if BUILDFLAG(ENABLE_PRINT_PREVIEW) |
422 // Asks the browser to do print preview. | 423 // Asks the browser to do print preview. |
423 IPC_MESSAGE_ROUTED1(PrintHostMsg_RequestPrintPreview, | 424 IPC_MESSAGE_ROUTED1(PrintHostMsg_RequestPrintPreview, |
424 PrintHostMsg_RequestPrintPreview_Params /* params */) | 425 PrintHostMsg_RequestPrintPreview_Params /* params */) |
425 | 426 |
426 // Notify the browser the number of pages in the print preview document. | 427 // Notify the browser the number of pages in the print preview document. |
427 IPC_MESSAGE_ROUTED1(PrintHostMsg_DidGetPreviewPageCount, | 428 IPC_MESSAGE_ROUTED1(PrintHostMsg_DidGetPreviewPageCount, |
428 PrintHostMsg_DidGetPreviewPageCount_Params /* params */) | 429 PrintHostMsg_DidGetPreviewPageCount_Params /* params */) |
429 | 430 |
430 // Notify the browser of the default page layout according to the currently | 431 // Notify the browser of the default page layout according to the currently |
431 // selected printer and page size. | 432 // selected printer and page size. |
(...skipping 13 matching lines...) Expand all Loading... |
445 IPC_SYNC_MESSAGE_ROUTED2_1(PrintHostMsg_CheckForCancel, | 446 IPC_SYNC_MESSAGE_ROUTED2_1(PrintHostMsg_CheckForCancel, |
446 int32_t /* PrintPreviewUI ID */, | 447 int32_t /* PrintPreviewUI ID */, |
447 int /* request id */, | 448 int /* request id */, |
448 bool /* print preview cancelled */) | 449 bool /* print preview cancelled */) |
449 | 450 |
450 // Sends back to the browser the complete rendered document (non-draft mode, | 451 // Sends back to the browser the complete rendered document (non-draft mode, |
451 // used for printing) that was requested by a PrintMsg_PrintPreview message. | 452 // used for printing) that was requested by a PrintMsg_PrintPreview message. |
452 // The memory handle in this message is already valid in the browser process. | 453 // The memory handle in this message is already valid in the browser process. |
453 IPC_MESSAGE_ROUTED1(PrintHostMsg_MetafileReadyForPrinting, | 454 IPC_MESSAGE_ROUTED1(PrintHostMsg_MetafileReadyForPrinting, |
454 PrintHostMsg_DidPreviewDocument_Params /* params */) | 455 PrintHostMsg_DidPreviewDocument_Params /* params */) |
455 #endif // defined(ENABLE_PRINT_PREVIEW) | 456 #endif // BUILDFLAG(ENABLE_PRINT_PREVIEW) |
456 | 457 |
457 // This is sent when there are invalid printer settings. | 458 // This is sent when there are invalid printer settings. |
458 IPC_MESSAGE_ROUTED0(PrintHostMsg_ShowInvalidPrinterSettingsError) | 459 IPC_MESSAGE_ROUTED0(PrintHostMsg_ShowInvalidPrinterSettingsError) |
459 | 460 |
460 // Tell the browser printing failed. | 461 // Tell the browser printing failed. |
461 IPC_MESSAGE_ROUTED1(PrintHostMsg_PrintingFailed, | 462 IPC_MESSAGE_ROUTED1(PrintHostMsg_PrintingFailed, |
462 int /* document cookie */) | 463 int /* document cookie */) |
463 | 464 |
464 #if defined(ENABLE_PRINT_PREVIEW) | 465 #if BUILDFLAG(ENABLE_PRINT_PREVIEW) |
465 // Tell the browser print preview failed. | 466 // Tell the browser print preview failed. |
466 IPC_MESSAGE_ROUTED1(PrintHostMsg_PrintPreviewFailed, | 467 IPC_MESSAGE_ROUTED1(PrintHostMsg_PrintPreviewFailed, |
467 int /* document cookie */) | 468 int /* document cookie */) |
468 | 469 |
469 // Tell the browser print preview was cancelled. | 470 // Tell the browser print preview was cancelled. |
470 IPC_MESSAGE_ROUTED1(PrintHostMsg_PrintPreviewCancelled, | 471 IPC_MESSAGE_ROUTED1(PrintHostMsg_PrintPreviewCancelled, |
471 int /* document cookie */) | 472 int /* document cookie */) |
472 | 473 |
473 // Tell the browser print preview found the selected printer has invalid | 474 // Tell the browser print preview found the selected printer has invalid |
474 // settings (which typically caused by disconnected network printer or printer | 475 // settings (which typically caused by disconnected network printer or printer |
475 // driver is bogus). | 476 // driver is bogus). |
476 IPC_MESSAGE_ROUTED1(PrintHostMsg_PrintPreviewInvalidPrinterSettings, | 477 IPC_MESSAGE_ROUTED1(PrintHostMsg_PrintPreviewInvalidPrinterSettings, |
477 int /* document cookie */) | 478 int /* document cookie */) |
478 | 479 |
479 // Run a nested message loop in the renderer until print preview for | 480 // Run a nested message loop in the renderer until print preview for |
480 // window.print() finishes. | 481 // window.print() finishes. |
481 IPC_SYNC_MESSAGE_ROUTED0_0(PrintHostMsg_SetupScriptedPrintPreview) | 482 IPC_SYNC_MESSAGE_ROUTED0_0(PrintHostMsg_SetupScriptedPrintPreview) |
482 | 483 |
483 // Tell the browser to show the print preview, when the document is sufficiently | 484 // Tell the browser to show the print preview, when the document is sufficiently |
484 // loaded such that the renderer can determine whether it is modifiable or not. | 485 // loaded such that the renderer can determine whether it is modifiable or not. |
485 IPC_MESSAGE_ROUTED1(PrintHostMsg_ShowScriptedPrintPreview, | 486 IPC_MESSAGE_ROUTED1(PrintHostMsg_ShowScriptedPrintPreview, |
486 bool /* is_modifiable */) | 487 bool /* is_modifiable */) |
487 | 488 |
488 // Notify the browser to set print presets based on source PDF document. | 489 // Notify the browser to set print presets based on source PDF document. |
489 IPC_MESSAGE_ROUTED1(PrintHostMsg_SetOptionsFromDocument, | 490 IPC_MESSAGE_ROUTED1(PrintHostMsg_SetOptionsFromDocument, |
490 PrintHostMsg_SetOptionsFromDocument_Params /* params */) | 491 PrintHostMsg_SetOptionsFromDocument_Params /* params */) |
491 #endif // defined(ENABLE_PRINT_PREVIEW) | 492 #endif // BUILDFLAG(ENABLE_PRINT_PREVIEW) |
OLD | NEW |