| Index: components/printing/common/print_messages.h
|
| diff --git a/components/printing/common/print_messages.h b/components/printing/common/print_messages.h
|
| index 82e904edb5de9dc2ae1c2a72cef16d7bbcfd9583..372097f1a76941ed5b888c1cff30a664b4ef2bb5 100644
|
| --- a/components/printing/common/print_messages.h
|
| +++ b/components/printing/common/print_messages.h
|
| @@ -70,6 +70,7 @@ struct PrintMsg_PrintPages_Params {
|
| std::vector<int> pages;
|
| };
|
|
|
| +#if defined(ENABLE_PRINT_PREVIEW)
|
| struct PrintHostMsg_RequestPrintPreview_Params {
|
| PrintHostMsg_RequestPrintPreview_Params();
|
| ~PrintHostMsg_RequestPrintPreview_Params();
|
| @@ -88,6 +89,7 @@ struct PrintHostMsg_SetOptionsFromDocument_Params {
|
| printing::DuplexMode duplex;
|
| printing::PageRanges page_ranges;
|
| };
|
| +#endif // defined(ENABLE_PRINT_PREVIEW)
|
|
|
| #endif // COMPONENTS_PRINTING_COMMON_PRINT_MESSAGES_H_
|
|
|
| @@ -175,6 +177,12 @@ IPC_STRUCT_BEGIN(PrintMsg_PrintPage_Params)
|
| IPC_STRUCT_MEMBER(int, page_number)
|
| IPC_STRUCT_END()
|
|
|
| +IPC_STRUCT_TRAITS_BEGIN(printing::PageRange)
|
| + IPC_STRUCT_TRAITS_MEMBER(from)
|
| + IPC_STRUCT_TRAITS_MEMBER(to)
|
| +IPC_STRUCT_TRAITS_END()
|
| +
|
| +#if defined(ENABLE_PRINT_PREVIEW)
|
| IPC_STRUCT_TRAITS_BEGIN(PrintHostMsg_RequestPrintPreview_Params)
|
| IPC_STRUCT_TRAITS_MEMBER(is_modifiable)
|
| IPC_STRUCT_TRAITS_MEMBER(webnode_only)
|
| @@ -182,11 +190,6 @@ IPC_STRUCT_TRAITS_BEGIN(PrintHostMsg_RequestPrintPreview_Params)
|
| IPC_STRUCT_TRAITS_MEMBER(selection_only)
|
| IPC_STRUCT_TRAITS_END()
|
|
|
| -IPC_STRUCT_TRAITS_BEGIN(printing::PageRange)
|
| - IPC_STRUCT_TRAITS_MEMBER(from)
|
| - IPC_STRUCT_TRAITS_MEMBER(to)
|
| -IPC_STRUCT_TRAITS_END()
|
| -
|
| IPC_STRUCT_TRAITS_BEGIN(PrintHostMsg_SetOptionsFromDocument_Params)
|
| // Specifies whether print scaling is enabled or not.
|
| IPC_STRUCT_TRAITS_MEMBER(is_scaling_disabled)
|
| @@ -200,6 +203,7 @@ IPC_STRUCT_TRAITS_BEGIN(PrintHostMsg_SetOptionsFromDocument_Params)
|
| // Specifies page range to be printed.
|
| IPC_STRUCT_TRAITS_MEMBER(page_ranges)
|
| IPC_STRUCT_TRAITS_END()
|
| +#endif // defined(ENABLE_PRINT_PREVIEW)
|
|
|
| IPC_STRUCT_TRAITS_BEGIN(printing::PageSizeMargins)
|
| IPC_STRUCT_TRAITS_MEMBER(content_width)
|
| @@ -219,6 +223,7 @@ IPC_STRUCT_TRAITS_BEGIN(PrintMsg_PrintPages_Params)
|
| IPC_STRUCT_TRAITS_MEMBER(pages)
|
| IPC_STRUCT_TRAITS_END()
|
|
|
| +#if defined(ENABLE_PRINT_PREVIEW)
|
| // Parameters to describe a rendered document.
|
| IPC_STRUCT_BEGIN(PrintHostMsg_DidPreviewDocument_Params)
|
| // A shared memory handle to metafile data.
|
| @@ -272,6 +277,7 @@ IPC_STRUCT_BEGIN(PrintHostMsg_DidGetPreviewPageCount_Params)
|
| // Indicates whether the existing preview data needs to be cleared or not.
|
| IPC_STRUCT_MEMBER(bool, clear_preview_data)
|
| IPC_STRUCT_END()
|
| +#endif // defined(ENABLE_PRINT_PREVIEW)
|
|
|
| // Parameters to describe a rendered page.
|
| IPC_STRUCT_BEGIN(PrintHostMsg_DidPrintPage_Params)
|
| @@ -309,18 +315,22 @@ IPC_STRUCT_END()
|
|
|
| // Messages sent from the browser to the renderer.
|
|
|
| +#if defined(ENABLE_PRINT_PREVIEW)
|
| // Tells the render view to initiate print preview for the entire document.
|
| IPC_MESSAGE_ROUTED1(PrintMsg_InitiatePrintPreview, bool /* selection_only */)
|
| +#endif // defined(ENABLE_PRINT_PREVIEW)
|
|
|
| // Tells the render frame to initiate printing or print preview for a particular
|
| // node, depending on which mode the render frame is in.
|
| IPC_MESSAGE_ROUTED0(PrintMsg_PrintNodeUnderContextMenu)
|
|
|
| +#if defined(ENABLE_BASIC_PRINTING) && defined(ENABLE_PRINT_PREVIEW)
|
| // Tells the renderer to print the print preview tab's PDF plugin without
|
| // showing the print dialog. (This is the final step in the print preview
|
| // workflow.)
|
| IPC_MESSAGE_ROUTED1(PrintMsg_PrintForPrintPreview,
|
| base::DictionaryValue /* settings */)
|
| +#endif // defined(ENABLE_BASIC_PRINTING) && defined(ENABLE_PRINT_PREVIEW)
|
|
|
| #if defined(ENABLE_BASIC_PRINTING)
|
| // Tells the render view to switch the CSS to print media type, renders every
|
| @@ -329,7 +339,7 @@ IPC_MESSAGE_ROUTED0(PrintMsg_PrintPages)
|
|
|
| // Like PrintMsg_PrintPages, but using the print preview document's frame/node.
|
| IPC_MESSAGE_ROUTED0(PrintMsg_PrintForSystemDialog)
|
| -#endif // ENABLE_BASIC_PRINTING
|
| +#endif // defined(ENABLE_BASIC_PRINTING)
|
|
|
| // Tells the render view that printing is done so it can clean up.
|
| IPC_MESSAGE_ROUTED1(PrintMsg_PrintingDone,
|
| @@ -339,11 +349,13 @@ IPC_MESSAGE_ROUTED1(PrintMsg_PrintingDone,
|
| IPC_MESSAGE_ROUTED1(PrintMsg_SetScriptedPrintingBlocked,
|
| bool /* blocked */)
|
|
|
| +#if defined(ENABLE_PRINT_PREVIEW)
|
| // Tells the render view to switch the CSS to print media type, renders every
|
| // requested pages for print preview using the given |settings|. This gets
|
| // called multiple times as the user updates settings.
|
| IPC_MESSAGE_ROUTED1(PrintMsg_PrintPreview,
|
| base::DictionaryValue /* settings */)
|
| +#endif // defined(ENABLE_PRINT_PREVIEW)
|
|
|
| // Messages sent from the renderer to the browser.
|
|
|
| @@ -409,8 +421,9 @@ IPC_SYNC_MESSAGE_CONTROL1_2(PrintHostMsg_AllocateTempFileForPrinting,
|
| IPC_MESSAGE_CONTROL2(PrintHostMsg_TempFileForPrintingWritten,
|
| int /* render_view_id */,
|
| int /* fd in browser */) // Used only by Chrome OS.
|
| -#endif
|
| +#endif // defined(OS_ANDROID)
|
|
|
| +#if defined(ENABLE_PRINT_PREVIEW)
|
| // Asks the browser to do print preview.
|
| IPC_MESSAGE_ROUTED1(PrintHostMsg_RequestPrintPreview,
|
| PrintHostMsg_RequestPrintPreview_Params /* params */)
|
| @@ -439,19 +452,21 @@ IPC_SYNC_MESSAGE_ROUTED2_1(PrintHostMsg_CheckForCancel,
|
| int /* request id */,
|
| bool /* print preview cancelled */)
|
|
|
| -// This is sent when there are invalid printer settings.
|
| -IPC_MESSAGE_ROUTED0(PrintHostMsg_ShowInvalidPrinterSettingsError)
|
| -
|
| // Sends back to the browser the complete rendered document (non-draft mode,
|
| // used for printing) that was requested by a PrintMsg_PrintPreview message.
|
| // The memory handle in this message is already valid in the browser process.
|
| IPC_MESSAGE_ROUTED1(PrintHostMsg_MetafileReadyForPrinting,
|
| PrintHostMsg_DidPreviewDocument_Params /* params */)
|
| +#endif // defined(ENABLE_PRINT_PREVIEW)
|
| +
|
| +// This is sent when there are invalid printer settings.
|
| +IPC_MESSAGE_ROUTED0(PrintHostMsg_ShowInvalidPrinterSettingsError)
|
|
|
| // Tell the browser printing failed.
|
| IPC_MESSAGE_ROUTED1(PrintHostMsg_PrintingFailed,
|
| int /* document cookie */)
|
|
|
| +#if defined(ENABLE_PRINT_PREVIEW)
|
| // Tell the browser print preview failed.
|
| IPC_MESSAGE_ROUTED1(PrintHostMsg_PrintPreviewFailed,
|
| int /* document cookie */)
|
| @@ -478,3 +493,4 @@ IPC_MESSAGE_ROUTED1(PrintHostMsg_ShowScriptedPrintPreview,
|
| // Notify the browser to set print presets based on source PDF document.
|
| IPC_MESSAGE_ROUTED1(PrintHostMsg_SetOptionsFromDocument,
|
| PrintHostMsg_SetOptionsFromDocument_Params /* params */)
|
| +#endif // defined(ENABLE_PRINT_PREVIEW)
|
|
|