summaryrefslogtreecommitdiffstats
path: root/ppapi
diff options
context:
space:
mode:
authorthestig <thestig@chromium.org>2015-03-05 13:06:02 -0800
committerCommit bot <commit-bot@chromium.org>2015-03-05 21:07:12 +0000
commitb335e7d621465955cf8b733660f82ffe0aab6de2 (patch)
treec1bb8f6fa3a2cc37147bf82b54d937e8e08ecb39 /ppapi
parentc285abaea4ed9dbe8c9dcc285d6d4acc8676cd2f (diff)
downloadchromium_src-b335e7d621465955cf8b733660f82ffe0aab6de2.zip
chromium_src-b335e7d621465955cf8b733660f82ffe0aab6de2.tar.gz
chromium_src-b335e7d621465955cf8b733660f82ffe0aab6de2.tar.bz2
Print Preview: Support the duplex preset in PDFs.
The preset from the PDF document gets plumbed all the way to print preview, but the ShortEdge setting is ignored at the end because print preview does not support it yet. BUG=169120 Review URL: https://codereview.chromium.org/974183003 Cr-Commit-Position: refs/heads/master@{#319324}
Diffstat (limited to 'ppapi')
-rw-r--r--ppapi/c/private/ppp_pdf.h14
-rw-r--r--ppapi/proxy/ppapi_messages.h3
2 files changed, 16 insertions, 1 deletions
diff --git a/ppapi/c/private/ppp_pdf.h b/ppapi/c/private/ppp_pdf.h
index d5dee37..c3678e4 100644
--- a/ppapi/c/private/ppp_pdf.h
+++ b/ppapi/c/private/ppp_pdf.h
@@ -21,6 +21,15 @@ typedef enum {
} PP_PrivatePageTransformType;
PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_PrivatePageTransformType, 4);
+typedef enum {
+ PP_PRIVATEDUPLEXMODE_NONE = 0,
+ PP_PRIVATEDUPLEXMODE_SIMPLEX = 1,
+ PP_PRIVATEDUPLEXMODE_SHORT_EDGE = 2,
+ PP_PRIVATEDUPLEXMODE_LONG_EDGE = 3,
+ PP_PRIVATEDUPLEXMODE_LAST = PP_PRIVATEDUPLEXMODE_LONG_EDGE
+} PP_PrivateDuplexMode_Dev;
+PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_PrivateDuplexMode_Dev, 4);
+
struct PP_PdfPrintPresetOptions_Dev {
// Returns whether scaling is disabled. Returns same information as the
// PPP_Printing_Dev's method IsScalingDiabled().
@@ -28,8 +37,11 @@ struct PP_PdfPrintPresetOptions_Dev {
// Number of copies to be printed.
int32_t copies;
+
+ // DuplexMode to be used for printing.
+ PP_PrivateDuplexMode_Dev duplex;
};
-PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_PdfPrintPresetOptions_Dev, 8);
+PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_PdfPrintPresetOptions_Dev, 12);
struct PPP_Pdf_1_1 {
// Returns an absolute URL if the position is over a link.
diff --git a/ppapi/proxy/ppapi_messages.h b/ppapi/proxy/ppapi_messages.h
index 643d8f9..9813407 100644
--- a/ppapi/proxy/ppapi_messages.h
+++ b/ppapi/proxy/ppapi_messages.h
@@ -113,6 +113,8 @@ IPC_ENUM_TRAITS_MAX_VALUE(PP_NetworkList_Type, PP_NETWORKLIST_TYPE_CELLULAR)
IPC_ENUM_TRAITS(PP_PrintOrientation_Dev)
IPC_ENUM_TRAITS(PP_PrintOutputFormat_Dev)
IPC_ENUM_TRAITS(PP_PrintScalingOption_Dev)
+IPC_ENUM_TRAITS_MAX_VALUE(PP_PrivateDuplexMode_Dev,
+ PP_PRIVATEDUPLEXMODE_LAST)
IPC_ENUM_TRAITS(PP_PrivateFontCharset)
IPC_ENUM_TRAITS(PP_ResourceImage)
IPC_ENUM_TRAITS(PP_ResourceString)
@@ -213,6 +215,7 @@ IPC_STRUCT_TRAITS_END()
IPC_STRUCT_TRAITS_BEGIN(PP_PdfPrintPresetOptions_Dev)
IPC_STRUCT_TRAITS_MEMBER(is_scaling_disabled)
IPC_STRUCT_TRAITS_MEMBER(copies)
+ IPC_STRUCT_TRAITS_MEMBER(duplex)
IPC_STRUCT_TRAITS_END()
IPC_STRUCT_TRAITS_BEGIN(PP_URLComponent_Dev)