[email protected] | 6a160e7 | 2011-05-04 20:23:45 | [diff] [blame^] | 1 | // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
[email protected] | 4c2e935 | 2010-11-05 22:13:02 | [diff] [blame] | 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_INSTANCE_PROXY_H_ |
| 6 | #define PPAPI_PROXY_PPP_INSTANCE_PROXY_H_ |
| 7 | |
| 8 | #include <string> |
| 9 | #include <vector> |
| 10 | |
| 11 | #include "ppapi/c/pp_instance.h" |
| 12 | #include "ppapi/c/pp_resource.h" |
| 13 | #include "ppapi/c/pp_var.h" |
[email protected] | f24448db | 2011-01-27 20:40:39 | [diff] [blame] | 14 | #include "ppapi/proxy/host_resource.h" |
[email protected] | 4c2e935 | 2010-11-05 22:13:02 | [diff] [blame] | 15 | #include "ppapi/proxy/interface_proxy.h" |
| 16 | |
| 17 | struct PP_InputEvent; |
| 18 | struct PP_Rect; |
| 19 | struct PPP_Instance; |
| 20 | |
| 21 | namespace pp { |
| 22 | namespace proxy { |
| 23 | |
| 24 | class SerializedVarReturnValue; |
| 25 | |
| 26 | class PPP_Instance_Proxy : public InterfaceProxy { |
| 27 | public: |
| 28 | PPP_Instance_Proxy(Dispatcher* dispatcher, const void* target_interface); |
| 29 | virtual ~PPP_Instance_Proxy(); |
| 30 | |
[email protected] | 465faa2 | 2011-02-08 16:31:46 | [diff] [blame] | 31 | static const Info* GetInfo(); |
| 32 | |
[email protected] | 4c2e935 | 2010-11-05 22:13:02 | [diff] [blame] | 33 | const PPP_Instance* ppp_instance_target() const { |
| 34 | return reinterpret_cast<const PPP_Instance*>(target_interface()); |
| 35 | } |
| 36 | |
| 37 | // InterfaceProxy implementation. |
[email protected] | a95986a8 | 2010-12-24 06:19:28 | [diff] [blame] | 38 | virtual bool OnMessageReceived(const IPC::Message& msg); |
[email protected] | 4c2e935 | 2010-11-05 22:13:02 | [diff] [blame] | 39 | |
| 40 | private: |
| 41 | // Message handlers. |
| 42 | void OnMsgDidCreate(PP_Instance instance, |
| 43 | const std::vector<std::string>& argn, |
| 44 | const std::vector<std::string>& argv, |
[email protected] | 19d2b01 | 2010-11-08 16:32:18 | [diff] [blame] | 45 | PP_Bool* result); |
[email protected] | 4c2e935 | 2010-11-05 22:13:02 | [diff] [blame] | 46 | void OnMsgDidDestroy(PP_Instance instance); |
| 47 | void OnMsgDidChangeView(PP_Instance instance, |
| 48 | const PP_Rect& position, |
[email protected] | 6a160e7 | 2011-05-04 20:23:45 | [diff] [blame^] | 49 | const PP_Rect& clip, |
| 50 | PP_Bool fullscreen); |
[email protected] | 19d2b01 | 2010-11-08 16:32:18 | [diff] [blame] | 51 | void OnMsgDidChangeFocus(PP_Instance instance, PP_Bool has_focus); |
[email protected] | 4c2e935 | 2010-11-05 22:13:02 | [diff] [blame] | 52 | void OnMsgHandleInputEvent(PP_Instance instance, |
| 53 | const PP_InputEvent& event, |
[email protected] | 19d2b01 | 2010-11-08 16:32:18 | [diff] [blame] | 54 | PP_Bool* result); |
[email protected] | 4c2e935 | 2010-11-05 22:13:02 | [diff] [blame] | 55 | void OnMsgHandleDocumentLoad(PP_Instance instance, |
[email protected] | f24448db | 2011-01-27 20:40:39 | [diff] [blame] | 56 | const HostResource& url_loader, |
[email protected] | 19d2b01 | 2010-11-08 16:32:18 | [diff] [blame] | 57 | PP_Bool* result); |
[email protected] | 4c2e935 | 2010-11-05 22:13:02 | [diff] [blame] | 58 | void OnMsgGetInstanceObject(PP_Instance instance, |
| 59 | SerializedVarReturnValue result); |
| 60 | }; |
| 61 | |
| 62 | } // namespace proxy |
| 63 | } // namespace pp |
| 64 | |
| 65 | #endif // PPAPI_PROXY_PPP_INSTANCE_PROXY_H_ |