[email protected] | 3890cfff | 2012-02-29 07:54:18 | [diff] [blame] | 1 | // 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 | |
avi | e029c413 | 2015-12-23 06:45:22 | [diff] [blame] | 8 | #include <stdint.h> |
| 9 | |
[email protected] | c47317e | 2012-06-20 22:35:31 | [diff] [blame] | 10 | #include <string> |
[email protected] | 3890cfff | 2012-02-29 07:54:18 | [diff] [blame] | 11 | #include <vector> |
| 12 | |
avi | e029c413 | 2015-12-23 06:45:22 | [diff] [blame] | 13 | #include "base/macros.h" |
[email protected] | 3890cfff | 2012-02-29 07:54:18 | [diff] [blame] | 14 | #include "ppapi/c/dev/ppp_printing_dev.h" |
| 15 | #include "ppapi/proxy/interface_proxy.h" |
| 16 | |
| 17 | struct PP_PrintPageNumberRange_Dev; |
| 18 | |
| 19 | namespace ppapi { |
| 20 | |
| 21 | class HostResource; |
| 22 | |
| 23 | namespace proxy { |
| 24 | |
| 25 | class PPP_Printing_Proxy : public InterfaceProxy { |
| 26 | public: |
Lei Zhang | 94f57fe3 | 2017-08-30 23:58:24 | [diff] [blame] | 27 | explicit PPP_Printing_Proxy(Dispatcher* dispatcher); |
| 28 | ~PPP_Printing_Proxy() override; |
[email protected] | 3890cfff | 2012-02-29 07:54:18 | [diff] [blame] | 29 | |
| 30 | static const PPP_Printing_Dev* GetProxyInterface(); |
| 31 | |
| 32 | // InterfaceProxy implementation. |
Lei Zhang | 94f57fe3 | 2017-08-30 23:58:24 | [diff] [blame] | 33 | bool OnMessageReceived(const IPC::Message& msg) override; |
[email protected] | 3890cfff | 2012-02-29 07:54:18 | [diff] [blame] | 34 | |
| 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 | |