Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(74)

Unified Diff: ppapi/proxy/printing_resource.h

Issue 10826026: Add a printing resource (as a new style resource) to fetch the default print settings (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ppapi/proxy/ppb_instance_proxy.cc ('k') | ppapi/proxy/printing_resource.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/proxy/printing_resource.h
diff --git a/ppapi/proxy/printing_resource.h b/ppapi/proxy/printing_resource.h
new file mode 100644
index 0000000000000000000000000000000000000000..d99b4594cf5e3bd10b6b3788531bf7652d68e4b5
--- /dev/null
+++ b/ppapi/proxy/printing_resource.h
@@ -0,0 +1,52 @@
+// 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.
+
+#ifndef PPAPI_PROXY_PRINTING_RESOURCE_H_
+#define PPAPI_PROXY_PRINTING_RESOURCE_H_
+
+#include "ppapi/proxy/connection.h"
+#include "ppapi/proxy/plugin_resource.h"
+#include "ppapi/proxy/ppapi_proxy_export.h"
+#include "ppapi/shared_impl/tracked_callback.h"
+#include "ppapi/thunk/ppb_printing_api.h"
+
+namespace ppapi {
+namespace proxy {
+
+class PPAPI_PROXY_EXPORT PrintingResource
+ : public PluginResource,
+ public NON_EXPORTED_BASE(thunk::PPB_Printing_API) {
+ public:
+ PrintingResource(Connection connection,
+ PP_Instance instance);
+ virtual ~PrintingResource();
+
+ // Resource overrides.
+ virtual thunk::PPB_Printing_API* AsPPB_Printing_API() OVERRIDE;
+
+ // PPB_Printing_API.
+ virtual int32_t GetDefaultPrintSettings(
+ PP_PrintSettings_Dev* print_settings,
+ scoped_refptr<TrackedCallback> callback) OVERRIDE;
+
+ private:
+ // PluginResource override.
+ virtual void OnReplyReceived(const ResourceMessageReplyParams& params,
+ const IPC::Message& msg) OVERRIDE;
+
+ void OnPluginMsgGetDefaultPrintSettingsReply(
+ const ResourceMessageReplyParams& params,
+ const PP_PrintSettings_Dev& print_settings);
+
+ PP_PrintSettings_Dev* print_settings_;
+
+ scoped_refptr<TrackedCallback> callback_;
+
+ DISALLOW_COPY_AND_ASSIGN(PrintingResource);
+};
+
+} // namespace proxy
+} // namespace ppapi
+
+#endif // PPAPI_PROXY_PRINTING_RESOURCE_H_
« no previous file with comments | « ppapi/proxy/ppb_instance_proxy.cc ('k') | ppapi/proxy/printing_resource.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698