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

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
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..9cbef93bcf1792318c3706879fc0e09fad02b6af 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);
@@ -70,6 +75,17 @@ const PPP_Printing_Dev ppp_printing = {
} // namespace
+// static
+bool Printing_Dev::GetDefaultPrintSettings(
yzshen1 2012/06/12 23:14:34 Please keep method definitions in the same order a
raymes 2012/06/13 18:23:46 Done.
+ const InstanceHandle& instance_handle,
+ 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));
+}
+
Printing_Dev::Printing_Dev(Instance* instance)
: associated_instance_(instance) {
Module::Get()->AddPluginInterface(kPPPPrintingInterface, &ppp_printing);

Powered by Google App Engine
This is Rietveld 408576698