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 8 #include <string> 9 #include <vector> 10 11 #include "ppapi/c/dev/ppp_printing_dev.h" 12 #include "ppapi/proxy/interface_proxy.h" 13 14 struct PP_PrintPageNumberRange_Dev; 15 16 namespace ppapi { 17 18 class HostResource; 19 20 namespace proxy { 21 22 class PPP_Printing_Proxy : public InterfaceProxy { 23 public: 24 PPP_Printing_Proxy(Dispatcher* dispatcher); 25 virtual ~PPP_Printing_Proxy(); 26 27 static const PPP_Printing_Dev* GetProxyInterface(); 28 29 // InterfaceProxy implementation. 30 virtual bool OnMessageReceived(const IPC::Message& msg); 31 32 private: 33 // Message handlers. 34 void OnPluginMsgQuerySupportedFormats(PP_Instance instance, uint32_t* result); 35 void OnPluginMsgBegin(PP_Instance instance, 36 const std::string& settings_string, 37 int32_t* result); 38 void OnPluginMsgPrintPages( 39 PP_Instance instance, 40 const std::vector<PP_PrintPageNumberRange_Dev>& pages, 41 HostResource* result); 42 void OnPluginMsgEnd(PP_Instance instance); 43 void OnPluginMsgIsScalingDisabled(PP_Instance instance, bool* result); 44 45 // When this proxy is in the plugin side, this value caches the interface 46 // pointer so we don't have to retrieve it from the dispatcher each time. 47 // In the host, this value is always NULL. 48 const PPP_Printing_Dev* ppp_printing_impl_; 49 50 DISALLOW_COPY_AND_ASSIGN(PPP_Printing_Proxy); 51 }; 52 53 } // namespace proxy 54 } // namespace ppapi 55 56 #endif // PPAPI_PROXY_PPP_PRINTING_PROXY_H_ 57 58