| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef PPAPI_PROXY_PPP_INSTANCE_PROXY_H_ | 5 #ifndef PPAPI_PROXY_PPP_INSTANCE_PROXY_H_ |
| 6 #define PPAPI_PROXY_PPP_INSTANCE_PROXY_H_ | 6 #define PPAPI_PROXY_PPP_INSTANCE_PROXY_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 public: | 28 public: |
| 29 template <class PPP_Instance_Type> | 29 template <class PPP_Instance_Type> |
| 30 PPP_Instance_Proxy(Dispatcher* dispatcher, | 30 PPP_Instance_Proxy(Dispatcher* dispatcher, |
| 31 const PPP_Instance_Type* target_interface) | 31 const PPP_Instance_Type* target_interface) |
| 32 : InterfaceProxy(dispatcher, static_cast<const void*>(target_interface)), | 32 : InterfaceProxy(dispatcher, static_cast<const void*>(target_interface)), |
| 33 combined_interface_( | 33 combined_interface_( |
| 34 new ::ppapi::PPP_Instance_Combined(*target_interface)) { | 34 new ::ppapi::PPP_Instance_Combined(*target_interface)) { |
| 35 } | 35 } |
| 36 virtual ~PPP_Instance_Proxy(); | 36 virtual ~PPP_Instance_Proxy(); |
| 37 | 37 |
| 38 // Return the info for the 0.4 version of the interface. | |
| 39 static const Info* GetInfo0_4(); | |
| 40 | |
| 41 // Return the info for the 0.5 (latest, canonical) version of the interface. | 38 // Return the info for the 0.5 (latest, canonical) version of the interface. |
| 42 static const Info* GetInfo0_5(); | 39 static const Info* GetInfo0_5(); |
| 43 | 40 |
| 44 ::ppapi::PPP_Instance_Combined* ppp_instance_target() const { | 41 ::ppapi::PPP_Instance_Combined* ppp_instance_target() const { |
| 45 return combined_interface_.get(); | 42 return combined_interface_.get(); |
| 46 } | 43 } |
| 47 | 44 |
| 48 // InterfaceProxy implementation. | 45 // InterfaceProxy implementation. |
| 49 virtual bool OnMessageReceived(const IPC::Message& msg); | 46 virtual bool OnMessageReceived(const IPC::Message& msg); |
| 50 | 47 |
| 51 private: | 48 private: |
| 52 // Message handlers. | 49 // Message handlers. |
| 53 void OnMsgDidCreate(PP_Instance instance, | 50 void OnMsgDidCreate(PP_Instance instance, |
| 54 const std::vector<std::string>& argn, | 51 const std::vector<std::string>& argn, |
| 55 const std::vector<std::string>& argv, | 52 const std::vector<std::string>& argv, |
| 56 PP_Bool* result); | 53 PP_Bool* result); |
| 57 void OnMsgDidDestroy(PP_Instance instance); | 54 void OnMsgDidDestroy(PP_Instance instance); |
| 58 void OnMsgDidChangeView(PP_Instance instance, | 55 void OnMsgDidChangeView(PP_Instance instance, |
| 59 const PP_Rect& position, | 56 const PP_Rect& position, |
| 60 const PP_Rect& clip, | 57 const PP_Rect& clip, |
| 61 PP_Bool fullscreen); | 58 PP_Bool fullscreen); |
| 62 void OnMsgDidChangeFocus(PP_Instance instance, PP_Bool has_focus); | 59 void OnMsgDidChangeFocus(PP_Instance instance, PP_Bool has_focus); |
| 63 void OnMsgHandleInputEvent(PP_Instance instance, | 60 void OnMsgHandleInputEvent(PP_Instance instance, |
| 64 const PP_InputEvent& event, | 61 const PP_InputEvent& event, |
| 65 PP_Bool* result); | 62 PP_Bool* result); |
| 66 void OnMsgHandleDocumentLoad(PP_Instance instance, | 63 void OnMsgHandleDocumentLoad(PP_Instance instance, |
| 67 const HostResource& url_loader, | 64 const HostResource& url_loader, |
| 68 PP_Bool* result); | 65 PP_Bool* result); |
| 69 void OnMsgGetInstanceObject(PP_Instance instance, | |
| 70 SerializedVarReturnValue result); | |
| 71 scoped_ptr< ::ppapi::PPP_Instance_Combined> combined_interface_; | 66 scoped_ptr< ::ppapi::PPP_Instance_Combined> combined_interface_; |
| 72 }; | 67 }; |
| 73 | 68 |
| 74 } // namespace proxy | 69 } // namespace proxy |
| 75 } // namespace pp | 70 } // namespace pp |
| 76 | 71 |
| 77 #endif // PPAPI_PROXY_PPP_INSTANCE_PROXY_H_ | 72 #endif // PPAPI_PROXY_PPP_INSTANCE_PROXY_H_ |
| OLD | NEW |