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

Unified Diff: ppapi/cpp/dev/printing_dev.cc

Issue 10795051: Implement asynchronous interface/plumbing for GetDefaultPrintSettings. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 5 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 8c307251fbac70261bd2fa8089976449852f8966..a49a26c7c69f2cfc78f3b1b2ac14edd9bfb7b00d 100644
--- a/ppapi/cpp/dev/printing_dev.cc
+++ b/ppapi/cpp/dev/printing_dev.cc
@@ -5,6 +5,7 @@
#include "ppapi/cpp/dev/printing_dev.h"
#include "ppapi/c/dev/ppb_printing_dev.h"
+#include "ppapi/cpp/completion_callback.h"
#include "ppapi/cpp/instance.h"
#include "ppapi/cpp/instance_handle.h"
#include "ppapi/cpp/module.h"
@@ -16,6 +17,10 @@ namespace {
static const char kPPPPrintingInterface[] = PPP_PRINTING_DEV_INTERFACE;
+template <> const char* interface_name<PPB_Printing_Dev_0_7>() {
+ return PPB_PRINTING_DEV_INTERFACE_0_7;
+}
+
template <> const char* interface_name<PPB_Printing_Dev_0_6>() {
return PPB_PRINTING_DEV_INTERFACE_0_6;
}
@@ -88,7 +93,8 @@ Printing_Dev::~Printing_Dev() {
// static
bool Printing_Dev::IsAvailable() {
- return has_interface<PPB_Printing_Dev_0_6>();
+ return has_interface<PPB_Printing_Dev_0_7>() ||
+ has_interface<PPB_Printing_Dev_0_6>();
}
bool Printing_Dev::GetDefaultPrintSettings(
@@ -100,4 +106,14 @@ bool Printing_Dev::GetDefaultPrintSettings(
associated_instance_.pp_instance(), print_settings));
}
+int32_t Printing_Dev::GetDefaultPrintSettings(
+ PP_PrintSettings_Dev* print_settings,
+ const CompletionCallback& callback) const {
+ if (!has_interface<PPB_Printing_Dev_0_7>())
+ return PP_ERROR_NOTSUPPORTED;
+ return get_interface<PPB_Printing_Dev_0_7>()->GetDefaultPrintSettings(
+ associated_instance_.pp_instance(), print_settings,
+ callback.pp_completion_callback());
dmichael (off chromium) 2012/07/23 18:20:09 You might want to check with Trung about this. If
raymes 2012/07/24 00:37:08 Good call. I updated the CL with your suggestion a
+}
+
} // namespace pp

Powered by Google App Engine
This is Rietveld 408576698