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

Unified Diff: ppapi/cpp/dev/printing_dev.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/cpp/dev/printing_dev.h ('k') | ppapi/ppapi_shared.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/cpp/dev/printing_dev.cc
diff --git a/ppapi/cpp/dev/printing_dev.cc b/ppapi/cpp/dev/printing_dev.cc
index 72affff56a1f27872d40e7033793799fc8290b3e..257270f06877401a8288f9ea11d0889993da83d8 100644
--- a/ppapi/cpp/dev/printing_dev.cc
+++ b/ppapi/cpp/dev/printing_dev.cc
@@ -4,6 +4,7 @@
#include "ppapi/cpp/dev/printing_dev.h"
+#include "ppapi/c/dev/ppb_printing_dev.h"
#include "ppapi/cpp/instance.h"
#include "ppapi/cpp/instance_handle.h"
#include "ppapi/cpp/module.h"
@@ -15,6 +16,10 @@ namespace {
static const char kPPPPrintingInterface[] = PPP_PRINTING_DEV_INTERFACE;
+template <> const char* interface_name<PPB_Printing_Dev_0_6>() {
+ return PPB_PRINTING_DEV_INTERFACE_0_6;
+}
+
uint32_t QuerySupportedFormats(PP_Instance instance) {
void* object =
Instance::GetPerInstanceObject(instance, kPPPPrintingInterface);
@@ -81,4 +86,14 @@ Printing_Dev::~Printing_Dev() {
kPPPPrintingInterface, this);
}
+bool Printing_Dev::GetDefaultPrintSettings(
+ const InstanceHandle& instance_handle,
yzshen1 2012/06/14 05:01:38 Can we use associated_instance_?
raymes 2012/06/14 17:30:49 Done.
+ PP_PrintSettings_Dev* print_settings) {
+ if (!has_interface<PPB_Printing_Dev_0_6>())
+ return PP_FALSE;
+ return PP_ToBool(
+ get_interface<PPB_Printing_Dev_0_6>()->GetDefaultPrintSettings(
+ instance_handle.pp_instance(), print_settings));
+}
+
} // namespace pp
« no previous file with comments | « ppapi/cpp/dev/printing_dev.h ('k') | ppapi/ppapi_shared.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698