blob: 7c208ca8f0535a0d1c33c164e80ae69612734157 [file] [log] [blame]
[email protected]6a160e72011-05-04 20:23:451// Copyright (c) 2011 The Chromium Authors. All rights reserved.
[email protected]4c2e9352010-11-05 22:13:022// 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]f24448db2011-01-27 20:40:3914#include "ppapi/proxy/host_resource.h"
[email protected]4c2e9352010-11-05 22:13:0215#include "ppapi/proxy/interface_proxy.h"
16
17struct PP_InputEvent;
18struct PP_Rect;
19struct PPP_Instance;
20
21namespace pp {
22namespace proxy {
23
24class SerializedVarReturnValue;
25
26class 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]465faa22011-02-08 16:31:4631 static const Info* GetInfo();
32
[email protected]4c2e9352010-11-05 22:13:0233 const PPP_Instance* ppp_instance_target() const {
34 return reinterpret_cast<const PPP_Instance*>(target_interface());
35 }
36
37 // InterfaceProxy implementation.
[email protected]a95986a82010-12-24 06:19:2838 virtual bool OnMessageReceived(const IPC::Message& msg);
[email protected]4c2e9352010-11-05 22:13:0239
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]19d2b012010-11-08 16:32:1845 PP_Bool* result);
[email protected]4c2e9352010-11-05 22:13:0246 void OnMsgDidDestroy(PP_Instance instance);
47 void OnMsgDidChangeView(PP_Instance instance,
48 const PP_Rect& position,
[email protected]6a160e72011-05-04 20:23:4549 const PP_Rect& clip,
50 PP_Bool fullscreen);
[email protected]19d2b012010-11-08 16:32:1851 void OnMsgDidChangeFocus(PP_Instance instance, PP_Bool has_focus);
[email protected]4c2e9352010-11-05 22:13:0252 void OnMsgHandleInputEvent(PP_Instance instance,
53 const PP_InputEvent& event,
[email protected]19d2b012010-11-08 16:32:1854 PP_Bool* result);
[email protected]4c2e9352010-11-05 22:13:0255 void OnMsgHandleDocumentLoad(PP_Instance instance,
[email protected]f24448db2011-01-27 20:40:3956 const HostResource& url_loader,
[email protected]19d2b012010-11-08 16:32:1857 PP_Bool* result);
[email protected]4c2e9352010-11-05 22:13:0258 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_