blob: 85ae55cbddbecd4bfbf7ae0bb5ecdf2b6639b25f [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]e8f07ac2012-01-03 17:43:3622
[email protected]47cb253f2013-05-16 01:50:4023struct URLResponseInfoData;
[email protected]e8f07ac2012-01-03 17:43:3624struct ViewData;
25
[email protected]4c2e9352010-11-05 22:13:0226namespace proxy {
27
[email protected]4c2e9352010-11-05 22:13:0228class PPP_Instance_Proxy : public InterfaceProxy {
29 public:
[email protected]0a6d5f62011-11-11 08:04:0730 explicit PPP_Instance_Proxy(Dispatcher* dispatcher);
[email protected]4c2e9352010-11-05 22:13:0231 virtual ~PPP_Instance_Proxy();
32
[email protected]e8f07ac2012-01-03 17:43:3633 static const PPP_Instance* GetInstanceInterface();
[email protected]912f3d6c2011-06-29 18:26:3634
[email protected]4d2efd22011-08-18 21:58:0235 PPP_Instance_Combined* ppp_instance_target() const {
[email protected]912f3d6c2011-06-29 18:26:3636 return combined_interface_.get();
[email protected]4c2e9352010-11-05 22:13:0237 }
38
39 // InterfaceProxy implementation.
[email protected]a95986a82010-12-24 06:19:2840 virtual bool OnMessageReceived(const IPC::Message& msg);
[email protected]4c2e9352010-11-05 22:13:0241
42 private:
43 // Message handlers.
[email protected]e8f07ac2012-01-03 17:43:3644 void OnPluginMsgDidCreate(PP_Instance instance,
45 const std::vector<std::string>& argn,
46 const std::vector<std::string>& argv,
47 PP_Bool* result);
48 void OnPluginMsgDidDestroy(PP_Instance instance);
49 void OnPluginMsgDidChangeView(PP_Instance instance,
50 const ViewData& new_data,
51 PP_Bool flash_fullscreen);
52 void OnPluginMsgDidChangeFocus(PP_Instance instance, PP_Bool has_focus);
53 void OnPluginMsgHandleDocumentLoad(PP_Instance instance,
[email protected]47cb253f2013-05-16 01:50:4054 int pending_loader_host_id,
55 const URLResponseInfoData& data);
56
[email protected]4d2efd22011-08-18 21:58:0257 scoped_ptr<PPP_Instance_Combined> combined_interface_;
[email protected]4c2e9352010-11-05 22:13:0258};
59
60} // namespace proxy
[email protected]4d2efd22011-08-18 21:58:0261} // namespace ppapi
[email protected]4c2e9352010-11-05 22:13:0262
63#endif // PPAPI_PROXY_PPP_INSTANCE_PROXY_H_