blob: 7b702454896becedb5b9f3a1a194f844822491a4 [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
[email protected]912f3d6c2011-06-29 18:26:3611#include "base/memory/scoped_ptr.h"
[email protected]4c2e9352010-11-05 22:13:0212#include "ppapi/c/pp_instance.h"
13#include "ppapi/c/pp_resource.h"
14#include "ppapi/c/pp_var.h"
[email protected]4c2e9352010-11-05 22:13:0215#include "ppapi/proxy/interface_proxy.h"
[email protected]be0a84b2011-08-13 04:18:4416#include "ppapi/shared_impl/host_resource.h"
[email protected]912f3d6c2011-06-29 18:26:3617#include "ppapi/shared_impl/ppp_instance_combined.h"
[email protected]4c2e9352010-11-05 22:13:0218
[email protected]4c2e9352010-11-05 22:13:0219struct PP_Rect;
[email protected]4c2e9352010-11-05 22:13:0220
[email protected]4d2efd22011-08-18 21:58:0221namespace ppapi {
[email protected]4c2e9352010-11-05 22:13:0222namespace proxy {
23
24class SerializedVarReturnValue;
25
26class PPP_Instance_Proxy : public InterfaceProxy {
27 public:
[email protected]5c966022011-09-13 18:09:3728 PPP_Instance_Proxy(Dispatcher* dispatcher);
[email protected]4c2e9352010-11-05 22:13:0229 virtual ~PPP_Instance_Proxy();
30
[email protected]13a8f492011-07-20 19:55:3931 // Return the info for the 1.0 (latest, canonical) version of the interface.
32 static const Info* GetInfo1_0();
[email protected]912f3d6c2011-06-29 18:26:3633
[email protected]4d2efd22011-08-18 21:58:0234 PPP_Instance_Combined* ppp_instance_target() const {
[email protected]912f3d6c2011-06-29 18:26:3635 return combined_interface_.get();
[email protected]4c2e9352010-11-05 22:13:0236 }
37
38 // InterfaceProxy implementation.
[email protected]a95986a82010-12-24 06:19:2839 virtual bool OnMessageReceived(const IPC::Message& msg);
[email protected]4c2e9352010-11-05 22:13:0240
41 private:
42 // Message handlers.
43 void OnMsgDidCreate(PP_Instance instance,
44 const std::vector<std::string>& argn,
45 const std::vector<std::string>& argv,
[email protected]19d2b012010-11-08 16:32:1846 PP_Bool* result);
[email protected]4c2e9352010-11-05 22:13:0247 void OnMsgDidDestroy(PP_Instance instance);
48 void OnMsgDidChangeView(PP_Instance instance,
49 const PP_Rect& position,
[email protected]6a160e72011-05-04 20:23:4550 const PP_Rect& clip,
51 PP_Bool fullscreen);
[email protected]19d2b012010-11-08 16:32:1852 void OnMsgDidChangeFocus(PP_Instance instance, PP_Bool has_focus);
[email protected]4c2e9352010-11-05 22:13:0253 void OnMsgHandleDocumentLoad(PP_Instance instance,
[email protected]4d2efd22011-08-18 21:58:0254 const HostResource& url_loader,
[email protected]19d2b012010-11-08 16:32:1855 PP_Bool* result);
[email protected]4d2efd22011-08-18 21:58:0256 scoped_ptr<PPP_Instance_Combined> combined_interface_;
[email protected]4c2e9352010-11-05 22:13:0257};
58
59} // namespace proxy
[email protected]4d2efd22011-08-18 21:58:0260} // namespace ppapi
[email protected]4c2e9352010-11-05 22:13:0261
62#endif // PPAPI_PROXY_PPP_INSTANCE_PROXY_H_