Chromium Code Reviews| 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 |