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 |