blob: 6f212bbb78e9af1541e5621fab963491cd932616 [file] [log] [blame]
[email protected]3890cfff2012-02-29 07:54:181// Copyright (c) 2012 The Chromium Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#ifndef PPAPI_PROXY_PPP_PRINTING_PROXY_H_
6#define PPAPI_PROXY_PPP_PRINTING_PROXY_H_
7
avie029c4132015-12-23 06:45:228#include <stdint.h>
9
[email protected]c47317e2012-06-20 22:35:3110#include <string>
[email protected]3890cfff2012-02-29 07:54:1811#include <vector>
12
avie029c4132015-12-23 06:45:2213#include "base/macros.h"
[email protected]3890cfff2012-02-29 07:54:1814#include "ppapi/c/dev/ppp_printing_dev.h"
15#include "ppapi/proxy/interface_proxy.h"
16
17struct PP_PrintPageNumberRange_Dev;
18
19namespace ppapi {
20
21class HostResource;
22
23namespace proxy {
24
25class PPP_Printing_Proxy : public InterfaceProxy {
26 public:
Lei Zhang94f57fe32017-08-30 23:58:2427 explicit PPP_Printing_Proxy(Dispatcher* dispatcher);
28 ~PPP_Printing_Proxy() override;
[email protected]3890cfff2012-02-29 07:54:1829
30 static const PPP_Printing_Dev* GetProxyInterface();
31
32 // InterfaceProxy implementation.
Lei Zhang94f57fe32017-08-30 23:58:2433 bool OnMessageReceived(const IPC::Message& msg) override;
[email protected]3890cfff2012-02-29 07:54:1834
35 private:
36 // Message handlers.
37 void OnPluginMsgQuerySupportedFormats(PP_Instance instance, uint32_t* result);
38 void OnPluginMsgBegin(PP_Instance instance,
39 const std::string& settings_string,
40 int32_t* result);
41 void OnPluginMsgPrintPages(
42 PP_Instance instance,
43 const std::vector<PP_PrintPageNumberRange_Dev>& pages,
44 HostResource* result);
45 void OnPluginMsgEnd(PP_Instance instance);
46 void OnPluginMsgIsScalingDisabled(PP_Instance instance, bool* result);
47
48 // When this proxy is in the plugin side, this value caches the interface
49 // pointer so we don't have to retrieve it from the dispatcher each time.
50 // In the host, this value is always NULL.
51 const PPP_Printing_Dev* ppp_printing_impl_;
52
53 DISALLOW_COPY_AND_ASSIGN(PPP_Printing_Proxy);
54};
55
56} // namespace proxy
57} // namespace ppapi
58
59#endif // PPAPI_PROXY_PPP_PRINTING_PROXY_H_
60