diff options
author | thestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-10 20:39:40 +0000 |
---|---|---|
committer | thestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-06-10 20:39:40 +0000 |
commit | a8eaeca0c01a78730a83eca87b06fb6114a4d929 (patch) | |
tree | b4dfca2e769d82a0ff8a74a1e2a298707c12f184 /ppapi | |
parent | c56ce90795428e8792641b9ce8ed17bf74e4fac2 (diff) | |
download | chromium_src-a8eaeca0c01a78730a83eca87b06fb6114a4d929.zip chromium_src-a8eaeca0c01a78730a83eca87b06fb6114a4d929.tar.gz chromium_src-a8eaeca0c01a78730a83eca87b06fb6114a4d929.tar.bz2 |
PPAPI: Update the C++ PPP_Printing_Dev wrapper.
BUG=80696
TEST=none
Review URL: http://codereview.chromium.org/7051009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@88720 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi')
-rw-r--r-- | ppapi/cpp/dev/printing_dev.cc | 13 | ||||
-rw-r--r-- | ppapi/cpp/dev/printing_dev.h | 6 | ||||
-rw-r--r-- | ppapi/cpp/instance.cc | 1 |
3 files changed, 16 insertions, 4 deletions
diff --git a/ppapi/cpp/dev/printing_dev.cc b/ppapi/cpp/dev/printing_dev.cc index a5aa361..cf1d318 100644 --- a/ppapi/cpp/dev/printing_dev.cc +++ b/ppapi/cpp/dev/printing_dev.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -14,6 +14,15 @@ namespace { static const char kPPPPrintingInterface[] = PPP_PRINTING_DEV_INTERFACE; +#ifdef PPP_PRINTING_DEV_USE_0_4 +uint32_t QuerySupportedFormats(PP_Instance instance) { + void* object = + pp::Instance::GetPerInstanceObject(instance, kPPPPrintingInterface); + if (!object) + return 0; + return static_cast<Printing_Dev*>(object)->QuerySupportedPrintOutputFormats(); +} +#else PP_PrintOutputFormat_Dev* QuerySupportedFormats(PP_Instance instance, uint32_t* format_count) { void* object = @@ -23,6 +32,7 @@ PP_PrintOutputFormat_Dev* QuerySupportedFormats(PP_Instance instance, return static_cast<Printing_Dev*>(object)->QuerySupportedPrintOutputFormats( format_count); } +#endif int32_t Begin(PP_Instance instance, const struct PP_PrintSettings_Dev* print_settings) { @@ -71,4 +81,3 @@ Printing_Dev::~Printing_Dev() { } } // namespace pp - diff --git a/ppapi/cpp/dev/printing_dev.h b/ppapi/cpp/dev/printing_dev.h index ca34ba3..1a6f09e 100644 --- a/ppapi/cpp/dev/printing_dev.h +++ b/ppapi/cpp/dev/printing_dev.h @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -22,8 +22,12 @@ class Printing_Dev { // PPP_Printing_Dev functions exposed as virtual functions for you to // override. +#ifdef PPP_PRINTING_DEV_USE_0_4 + virtual uint32_t QuerySupportedPrintOutputFormats() = 0; +#else virtual PP_PrintOutputFormat_Dev* QuerySupportedPrintOutputFormats( uint32_t* format_count) = 0; +#endif virtual int32_t PrintBegin(const PP_PrintSettings_Dev& print_settings) = 0; virtual Resource PrintPages(const PP_PrintPageNumberRange_Dev* page_ranges, uint32_t page_range_count) = 0; diff --git a/ppapi/cpp/instance.cc b/ppapi/cpp/instance.cc index 985e9b7..9f78b01 100644 --- a/ppapi/cpp/instance.cc +++ b/ppapi/cpp/instance.cc @@ -4,7 +4,6 @@ #include "ppapi/cpp/instance.h" -#include "ppapi/c/dev/ppp_printing_dev.h" #include "ppapi/c/ppb_instance.h" #include "ppapi/c/ppb_messaging.h" #include "ppapi/cpp/common.h" |