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

Unified Diff: ppapi/proxy/ppp_pdf_proxy.cc

Issue 375253002: [Chrome] Support NumCopies print preset (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 years, 1 month 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
« no previous file with comments | « ppapi/proxy/ppp_pdf_proxy.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/ppp_pdf_proxy.cc
diff --git a/ppapi/proxy/ppp_pdf_proxy.cc b/ppapi/proxy/ppp_pdf_proxy.cc
index 356b42f0ebdddd253889f2108a966bb5d57a2c62..4b16dd6b66a4d12d307edb09d191174db7e18f7b 100644
--- a/ppapi/proxy/ppp_pdf_proxy.cc
+++ b/ppapi/proxy/ppp_pdf_proxy.cc
@@ -25,9 +25,20 @@ void Transform(PP_Instance instance, PP_PrivatePageTransformType type) {
new PpapiMsg_PPPPdf_Rotate(API_ID_PPP_PDF, instance, clockwise));
}
+PP_Bool GetPrintPresetOptionsFromDocument(
+ PP_Instance instance,
+ PP_PdfPrintPresetOptions_Dev* options) {
+ PP_Bool ret = PP_FALSE;
+ HostDispatcher::GetForInstance(instance)
+ ->Send(new PpapiMsg_PPPPdf_PrintPresetOptions(
+ API_ID_PPP_PDF, instance, options, &ret));
+ return ret;
+}
+
const PPP_Pdf ppp_pdf_interface = {
&GetLinkAtPosition,
&Transform,
+ &GetPrintPresetOptionsFromDocument
};
#else
// The NaCl plugin doesn't need the host side interface - stub it out.
@@ -60,6 +71,8 @@ bool PPP_Pdf_Proxy::OnMessageReceived(const IPC::Message& msg) {
bool handled = true;
IPC_BEGIN_MESSAGE_MAP(PPP_Pdf_Proxy, msg)
IPC_MESSAGE_HANDLER(PpapiMsg_PPPPdf_Rotate, OnPluginMsgRotate)
+ IPC_MESSAGE_HANDLER(PpapiMsg_PPPPdf_PrintPresetOptions,
+ OnPluginMsgPrintPresetOptions)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
return handled;
@@ -73,5 +86,15 @@ void PPP_Pdf_Proxy::OnPluginMsgRotate(PP_Instance instance, bool clockwise) {
CallWhileUnlocked(ppp_pdf_->Transform, instance, type);
}
+void PPP_Pdf_Proxy::OnPluginMsgPrintPresetOptions(
+ PP_Instance instance,
+ PP_PdfPrintPresetOptions_Dev* options,
+ PP_Bool* result) {
+ if (ppp_pdf_) {
+ *result = CallWhileUnlocked(
+ ppp_pdf_->GetPrintPresetOptionsFromDocument, instance, options);
+ }
+}
+
} // namespace proxy
} // namespace ppapi
« no previous file with comments | « ppapi/proxy/ppp_pdf_proxy.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698