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

Unified Diff: chrome/common/chrome_utility_printing_messages.h

Issue 2633573002: Add Postscript Printing (Closed)
Patch Set: Rebase Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: chrome/common/chrome_utility_printing_messages.h
diff --git a/chrome/common/chrome_utility_printing_messages.h b/chrome/common/chrome_utility_printing_messages.h
index f1a8ad7f0fa5f82b6e1a06609fe3aaa8e0772279..b184f3673a145adb1dd8105d5b538777dbaab7be 100644
--- a/chrome/common/chrome_utility_printing_messages.h
+++ b/chrome/common/chrome_utility_printing_messages.h
@@ -11,6 +11,7 @@
#include "build/build_config.h"
#include "components/printing/common/printing_param_traits_macros.h"
#include "ipc/ipc_message_macros.h"
+#include "ipc/ipc_param_traits.h"
#include "ipc/ipc_platform_file.h"
#include "printing/backend/print_backend.h"
#include "printing/features/features.h"
@@ -26,6 +27,23 @@
// Preview and Cloud Print messages.
#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
+#if defined(OS_WIN)
+IPC_ENUM_TRAITS_MAX_VALUE(
+ printing::PdfRenderSettings::Mode,
+ printing::PdfRenderSettings::Mode::POSTSCRIPT_LEVEL3)
+#else
+IPC_ENUM_TRAITS_MAX_VALUE(printing::PdfRenderSettings::Mode,
+ printing::PdfRenderSettings::Mode::NORMAL)
+#endif
+
+IPC_STRUCT_TRAITS_BEGIN(printing::PdfRenderSettings)
+ IPC_STRUCT_TRAITS_MEMBER(area)
+ IPC_STRUCT_TRAITS_MEMBER(offsets)
+ IPC_STRUCT_TRAITS_MEMBER(dpi)
+ IPC_STRUCT_TRAITS_MEMBER(autorotate)
+ IPC_STRUCT_TRAITS_MEMBER(mode)
+IPC_STRUCT_TRAITS_END()
+
IPC_STRUCT_TRAITS_BEGIN(printing::PrinterCapsAndDefaults)
IPC_STRUCT_TRAITS_MEMBER(printer_capabilities)
IPC_STRUCT_TRAITS_MEMBER(caps_mime_type)
@@ -69,7 +87,6 @@ IPC_STRUCT_TRAITS_END()
//------------------------------------------------------------------------------
// Utility process messages:
// These are messages from the browser to the utility process.
-
// Tell the utility process to render the given PDF into a PWGRaster.
IPC_MESSAGE_CONTROL4(ChromeUtilityMsg_RenderPDFPagesToPWGRaster,
IPC::PlatformFileForTransit /* Input PDF file */,
@@ -99,10 +116,9 @@ IPC_MESSAGE_CONTROL1(ChromeUtilityMsg_GetPrinterSemanticCapsAndDefaults,
// Tell the utility process to start rendering the given PDF into a metafile.
// Utility process would be alive until
// ChromeUtilityMsg_RenderPDFPagesToMetafiles_Stop message.
-IPC_MESSAGE_CONTROL3(ChromeUtilityMsg_RenderPDFPagesToMetafiles,
+IPC_MESSAGE_CONTROL2(ChromeUtilityMsg_RenderPDFPagesToMetafiles,
IPC::PlatformFileForTransit /* input_file */,
- printing::PdfRenderSettings /* settings */,
- bool /* print_text_with_gdi */)
+ printing::PdfRenderSettings /* settings */)
// Requests conversion of the next page.
IPC_MESSAGE_CONTROL2(ChromeUtilityMsg_RenderPDFPagesToMetafiles_GetPage,
@@ -111,7 +127,22 @@ IPC_MESSAGE_CONTROL2(ChromeUtilityMsg_RenderPDFPagesToMetafiles_GetPage,
// Requests utility process to stop conversion and exit.
IPC_MESSAGE_CONTROL0(ChromeUtilityMsg_RenderPDFPagesToMetafiles_Stop)
-#endif // ENABLE_PRINTING && OS_WIN
+
+// Tell the utility process to start rendering the given PDF into PS.
+// Utility process would be alive until
+// ChromeUtilityMsg_RenderPDFPagesToPostScript_Stop message.
+IPC_MESSAGE_CONTROL2(ChromeUtilityMsg_RenderPDFPagesToPostScript_Start,
+ IPC::PlatformFileForTransit /* input_file */,
+ printing::PdfRenderSettings /* settings */)
+
+// Requests conversion of the next page.
+IPC_MESSAGE_CONTROL2(ChromeUtilityMsg_RenderPDFPagesToPostScript_GetPage,
+ int /* page_number */,
+ IPC::PlatformFileForTransit /* output_file */)
+
+// Requests utility process to stop conversion and exit.
+IPC_MESSAGE_CONTROL0(ChromeUtilityMsg_RenderPDFPagesToPostScript_Stop)
+#endif // BUILDFLAG(ENABLE_PRINTING) && defined(OS_WIN)
//------------------------------------------------------------------------------
// Utility process host messages:
@@ -160,6 +191,15 @@ IPC_MESSAGE_CONTROL2(ChromeUtilityHostMsg_RenderPDFPagesToMetafiles_PageDone,
bool /* success */,
float /* scale_factor */)
+// Reply when the utility process loaded PDF. |page_count| is 0, if loading
+// failed.
+IPC_MESSAGE_CONTROL1(ChromeUtilityHostMsg_RenderPDFPagesToPostScript_PageCount,
+ int /* page_count */)
+
+// Reply when the utility process rendered the PDF page.
+IPC_MESSAGE_CONTROL1(ChromeUtilityHostMsg_RenderPDFPagesToPostScript_PageDone,
+ bool /* success */)
+
// Request that the given font characters be loaded by the browser so it's
// cached by the OS. Please see
// PdfToEmfUtilityProcessHostClient::OnPreCacheFontCharacters for details.

Powered by Google App Engine
This is Rietveld 408576698