summaryrefslogtreecommitdiffstats
path: root/ppapi
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-02 20:56:08 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-05-02 20:56:08 +0000
commited6218e3455d802d79654e7291f61fb76000a8b2 (patch)
tree521bb2bf5d76ab3c3e0cdb3b6bc1fcbf1d241548 /ppapi
parent9fc4dabfb2dd3f2f7e9da2af8ae9f41b469e68f9 (diff)
downloadchromium_src-ed6218e3455d802d79654e7291f61fb76000a8b2.zip
chromium_src-ed6218e3455d802d79654e7291f61fb76000a8b2.tar.gz
chromium_src-ed6218e3455d802d79654e7291f61fb76000a8b2.tar.bz2
Add a C++ wrapper for the InvokePrinting function
TEST=none BUG=none Review URL: https://chromiumcodereview.appspot.com/10253017 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@134990 0039d316-1c4b-4281-b951-d872f2087c98
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