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

Unified Diff: ppapi/proxy/ppb_instance_proxy.cc

Issue 10544085: Added PPB function to return default print settings (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 6 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
« no previous file with comments | « ppapi/proxy/ppb_instance_proxy.h ('k') | ppapi/tests/all_c_includes.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/ppb_instance_proxy.cc
diff --git a/ppapi/proxy/ppb_instance_proxy.cc b/ppapi/proxy/ppb_instance_proxy.cc
index ac6fc8f1d82b9e3d91f5c5fc1d353288810683eb..4cbb5ca8d968e112d2794bd5a5b82f2f925605d3 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,
@@ -458,6 +460,19 @@ void PPB_Instance_Proxy::UnlockMouse(PP_Instance instance) {
API_ID_PPB_INSTANCE, instance));
}
+PP_Bool PPB_Instance_Proxy::GetDefaultPrintSettings(
+ PP_Instance instance,
+ PP_PrintSettings_Dev* print_settings) {
+ if (!print_settings)
+ return PP_FALSE;
+
+ bool result;
+ dispatcher()->Send(new PpapiHostMsg_PPBPInstance_GetDefaultPrintSettings(
+ API_ID_PPB_INSTANCE, instance, print_settings, &result));
+
+ return PP_FromBool(result);
+}
+
void PPB_Instance_Proxy::SetTextInputType(PP_Instance instance,
PP_TextInput_Type type) {
dispatcher()->Send(new PpapiHostMsg_PPBInstance_SetTextInputType(
@@ -650,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,
« no previous file with comments | « ppapi/proxy/ppb_instance_proxy.h ('k') | ppapi/tests/all_c_includes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698