diff options
Diffstat (limited to 'ppapi/proxy/ppb_instance_proxy.cc')
-rw-r--r-- | ppapi/proxy/ppb_instance_proxy.cc | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/ppapi/proxy/ppb_instance_proxy.cc b/ppapi/proxy/ppb_instance_proxy.cc index a11d108..4cbb5ca 100644 --- a/ppapi/proxy/ppb_instance_proxy.cc +++ b/ppapi/proxy/ppb_instance_proxy.cc @@ -124,6 +124,8 @@ bool PPB_Instance_Proxy::OnMessageReceived(const IPC::Message& msg) { OnHostMsgLockMouse) IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_UnlockMouse, OnHostMsgUnlockMouse) + IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBPInstance_GetDefaultPrintSettings, + OnHostMsgGetDefaultPrintSettings) IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_SetCursor, OnHostMsgSetCursor) IPC_MESSAGE_HANDLER(PpapiHostMsg_PPBInstance_SetTextInputType, @@ -465,9 +467,8 @@ PP_Bool PPB_Instance_Proxy::GetDefaultPrintSettings( return PP_FALSE; bool result; - PluginGlobals::Get()->plugin_proxy_delegate()->SendToBrowser( - new PpapiHostMsg_PPBPInstance_GetDefaultPrintSettings( - API_ID_PPB_INSTANCE, print_settings, &result)); + dispatcher()->Send(new PpapiHostMsg_PPBPInstance_GetDefaultPrintSettings( + API_ID_PPB_INSTANCE, instance, print_settings, &result)); return PP_FromBool(result); } @@ -664,6 +665,29 @@ void PPB_Instance_Proxy::OnHostMsgUnlockMouse(PP_Instance instance) { enter.functions()->UnlockMouse(instance); } +void PPB_Instance_Proxy::OnHostMsgGetDefaultPrintSettings( + PP_Instance instance, + PP_PrintSettings_Dev* settings, + bool* result) { + // TODO(raymes): This just returns some generic settings. Actually hook this + // up to the browser to return the real defaults. + PP_PrintSettings_Dev default_settings = { + // |printable_area|: all of the sheet of paper. + { { 0, 0 }, { 612, 792 } }, + // |content_area|: 0.5" margins all around. + { { 36, 36 }, { 540, 720 } }, + // |paper_size|: 8.5" x 11" (US letter). + { 612, 792 }, + 300, // |dpi|. + PP_PRINTORIENTATION_NORMAL, // |orientation|. + PP_PRINTSCALINGOPTION_NONE, // |print_scaling_option|. + PP_FALSE, // |grayscale|. + PP_PRINTOUTPUTFORMAT_PDF // |format|. + }; + *settings = default_settings; + *result = true; +} + #if !defined(OS_NACL) void PPB_Instance_Proxy::OnHostMsgResolveRelativeToDocument( PP_Instance instance, |