summaryrefslogtreecommitdiffstats
path: root/ppapi/thunk
diff options
context:
space:
mode:
authorraymes@chromium.org <raymes@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-14 21:15:50 +0000
committerraymes@chromium.org <raymes@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-14 21:15:50 +0000
commit772a746250daaef9e464673d8a13359ed5f34ef3 (patch)
tree14b18be45ef79bca96f04523c14dcdfc4f1dc86c /ppapi/thunk
parent43e497fd5191b24542d9a0a5ac8760a572279f4f (diff)
downloadchromium_src-772a746250daaef9e464673d8a13359ed5f34ef3.zip
chromium_src-772a746250daaef9e464673d8a13359ed5f34ef3.tar.gz
chromium_src-772a746250daaef9e464673d8a13359ed5f34ef3.tar.bz2
This returns the default print settings for the default printer. Currently this just returns some generic values until it is hooked up to the chrome printing code.
BUG= TEST= Review URL: https://chromiumcodereview.appspot.com/10544085 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@142232 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/thunk')
-rw-r--r--ppapi/thunk/interfaces_ppb_public_dev.h2
-rw-r--r--ppapi/thunk/ppb_instance_api.h6
-rw-r--r--ppapi/thunk/ppb_printing_thunk.cc33
3 files changed, 41 insertions, 0 deletions
diff --git a/ppapi/thunk/interfaces_ppb_public_dev.h b/ppapi/thunk/interfaces_ppb_public_dev.h
index f23bb48..b606823 100644
--- a/ppapi/thunk/interfaces_ppb_public_dev.h
+++ b/ppapi/thunk/interfaces_ppb_public_dev.h
@@ -51,6 +51,8 @@ PROXIED_IFACE(NoAPIName, PPB_KEYBOARD_INPUT_EVENT_DEV_INTERFACE_0_1,
UNPROXIED_IFACE(PPB_LayerCompositor, PPB_LAYER_COMPOSITOR_DEV_INTERFACE_0_2,
PPB_LayerCompositor_Dev_0_2)
PROXIED_IFACE(NoAPIName, PPB_MEMORY_DEV_INTERFACE_0_1, PPB_Memory_Dev_0_1)
+PROXIED_IFACE(PPB_Instance, PPB_PRINTING_DEV_INTERFACE_0_6,
+ PPB_Printing_Dev_0_6)
PROXIED_IFACE(NoAPIName, PPB_RESOURCEARRAY_DEV_INTERFACE_0_1,
PPB_ResourceArray_Dev_0_1)
UNPROXIED_IFACE(PPB_Scrollbar, PPB_SCROLLBAR_DEV_INTERFACE_0_5,
diff --git a/ppapi/thunk/ppb_instance_api.h b/ppapi/thunk/ppb_instance_api.h
index c8cc230..97fd0b6 100644
--- a/ppapi/thunk/ppb_instance_api.h
+++ b/ppapi/thunk/ppb_instance_api.h
@@ -5,6 +5,7 @@
#ifndef PPAPI_THUNK_INSTANCE_API_H_
#define PPAPI_THUNK_INSTANCE_API_H_
+#include "ppapi/c/dev/pp_print_settings_dev.h"
#include "ppapi/c/dev/ppb_console_dev.h"
#include "ppapi/c/dev/ppb_text_input_dev.h"
#include "ppapi/c/dev/ppb_url_util_dev.h"
@@ -111,6 +112,11 @@ class PPB_Instance_API {
PP_CompletionCallback callback) = 0;
virtual void UnlockMouse(PP_Instance instance) = 0;
+ // Printing.
+ virtual PP_Bool GetDefaultPrintSettings(
+ PP_Instance instance,
+ PP_PrintSettings_Dev* print_settings) = 0;
+
// TextInput.
virtual void SetTextInputType(PP_Instance instance,
PP_TextInput_Type type) = 0;
diff --git a/ppapi/thunk/ppb_printing_thunk.cc b/ppapi/thunk/ppb_printing_thunk.cc
new file mode 100644
index 0000000..6602189
--- /dev/null
+++ b/ppapi/thunk/ppb_printing_thunk.cc
@@ -0,0 +1,33 @@
+// Copyright (c) 2012 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.
+
+#include "ppapi/c/dev/ppb_printing_dev.h"
+#include "ppapi/thunk/enter.h"
+#include "ppapi/thunk/thunk.h"
+
+namespace ppapi {
+namespace thunk {
+
+namespace {
+
+PP_Bool GetDefaultPrintSettings(PP_Instance instance,
+ PP_PrintSettings_Dev* print_settings) {
+ EnterInstance enter(instance);
+ if (enter.failed())
+ return PP_FALSE;
+ return enter.functions()->GetDefaultPrintSettings(instance, print_settings);
+}
+
+const PPB_Printing_Dev g_ppb_printing_dev_thunk = {
+ &GetDefaultPrintSettings,
+};
+
+} // namespace
+
+const PPB_Printing_Dev_0_6* GetPPB_Printing_Dev_0_6_Thunk() {
+ return &g_ppb_printing_dev_thunk;
+}
+
+} // namespace thunk
+} // namespace ppapi