summaryrefslogtreecommitdiffstats
path: root/ppapi
diff options
context:
space:
mode:
Diffstat (limited to 'ppapi')
-rw-r--r--ppapi/cpp/private/flash.cc20
-rw-r--r--ppapi/cpp/private/flash.h4
2 files changed, 15 insertions, 9 deletions
diff --git a/ppapi/cpp/private/flash.cc b/ppapi/cpp/private/flash.cc
index 968ecab..e61c8e4 100644
--- a/ppapi/cpp/private/flash.cc
+++ b/ppapi/cpp/private/flash.cc
@@ -18,6 +18,7 @@
#include "ppapi/cpp/url_request_info.h"
#include "ppapi/cpp/var.h"
#include "ppapi/c/private/ppb_flash.h"
+#include "ppapi/c/private/ppb_flash_print.h"
namespace pp {
@@ -39,6 +40,9 @@ template <> const char* interface_name<PPB_Flash_12_0>() {
return PPB_FLASH_INTERFACE_12_0;
}
+template <> const char* interface_name<PPB_Flash_Print_1_0>() {
+ return PPB_FLASH_PRINT_INTERFACE_1_0;
+}
// The combined Flash interface is all Flash v12.* interfaces. All v12
// interfaces just append one or more functions to the previous one, so we can
@@ -201,14 +205,6 @@ bool Flash::IsRectTopmost(const InstanceHandle& instance, const Rect& rect) {
}
// static
-int32_t Flash::InvokePrinting(const InstanceHandle& instance) {
- InitializeCombinedInterface();
- if (flash_12_combined_interface.InvokePrinting)
- return flash_12_combined_interface.InvokePrinting(instance.pp_instance());
- return PP_ERROR_NOTSUPPORTED;
-}
-
-// static
void Flash::UpdateActivity(const InstanceHandle& instance) {
InitializeCombinedInterface();
if (flash_12_combined_interface.UpdateActivity)
@@ -236,5 +232,13 @@ int32_t Flash::GetSettingInt(const InstanceHandle& instance,
return -1;
}
+// static
+void Flash::InvokePrinting(const InstanceHandle& instance) {
+ if (has_interface<PPB_Flash_Print_1_0>()) {
+ get_interface<PPB_Flash_Print_1_0>()->InvokePrinting(
+ instance.pp_instance());
+ }
+}
+
} // namespace flash
} // namespace pp
diff --git a/ppapi/cpp/private/flash.h b/ppapi/cpp/private/flash.h
index cb18316..0156036 100644
--- a/ppapi/cpp/private/flash.h
+++ b/ppapi/cpp/private/flash.h
@@ -56,11 +56,13 @@ class Flash {
static Var GetCommandLineArgs(Module* module);
static void PreloadFontWin(const void* logfontw);
static bool IsRectTopmost(const InstanceHandle& instance, const Rect& rect);
- static int32_t InvokePrinting(const InstanceHandle& instance);
static void UpdateActivity(const InstanceHandle& instance);
static Var GetDeviceID(const InstanceHandle& instance);
static int32_t GetSettingInt(const InstanceHandle& instance,
PP_FlashSetting setting);
+
+ // PPB_Flash_Print.
+ static void InvokePrinting(const InstanceHandle& instance);
};
} // namespace flash