OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CONTENT_RENDERER_PEPPER_RENDERER_PPAPI_HOST_IMPL_H_ | 5 #ifndef CONTENT_RENDERER_PEPPER_RENDERER_PPAPI_HOST_IMPL_H_ |
6 #define CONTENT_RENDERER_PEPPER_RENDERER_PPAPI_HOST_IMPL_H_ | 6 #define CONTENT_RENDERER_PEPPER_RENDERER_PPAPI_HOST_IMPL_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "content/public/renderer/renderer_ppapi_host.h" | 10 #include "content/public/renderer/renderer_ppapi_host.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 // Creates the in-process resource creation API wrapper for the given | 66 // Creates the in-process resource creation API wrapper for the given |
67 // plugin instance. This object will reference the host impl, so the | 67 // plugin instance. This object will reference the host impl, so the |
68 // host impl should outlive the returned pointer. Since the resource | 68 // host impl should outlive the returned pointer. Since the resource |
69 // creation object is associated with the instance, this will generally | 69 // creation object is associated with the instance, this will generally |
70 // happen automatically. | 70 // happen automatically. |
71 scoped_ptr<ppapi::thunk::ResourceCreationAPI> | 71 scoped_ptr<ppapi::thunk::ResourceCreationAPI> |
72 CreateInProcessResourceCreationAPI(PepperPluginInstanceImpl* instance); | 72 CreateInProcessResourceCreationAPI(PepperPluginInstanceImpl* instance); |
73 | 73 |
74 PepperPluginInstanceImpl* GetPluginInstanceImpl(PP_Instance instance) const; | 74 PepperPluginInstanceImpl* GetPluginInstanceImpl(PP_Instance instance) const; |
75 | 75 |
| 76 bool IsExternalPluginHost() const; |
| 77 |
76 // RendererPpapiHost implementation. | 78 // RendererPpapiHost implementation. |
77 virtual ppapi::host::PpapiHost* GetPpapiHost() OVERRIDE; | 79 virtual ppapi::host::PpapiHost* GetPpapiHost() OVERRIDE; |
78 virtual bool IsValidInstance(PP_Instance instance) const OVERRIDE; | 80 virtual bool IsValidInstance(PP_Instance instance) const OVERRIDE; |
79 virtual PepperPluginInstance* GetPluginInstance(PP_Instance instance) const | 81 virtual PepperPluginInstance* GetPluginInstance(PP_Instance instance) const |
80 OVERRIDE; | 82 OVERRIDE; |
81 virtual RenderFrame* GetRenderFrameForInstance(PP_Instance instance) const | 83 virtual RenderFrame* GetRenderFrameForInstance(PP_Instance instance) const |
82 OVERRIDE; | 84 OVERRIDE; |
83 virtual RenderView* GetRenderViewForInstance(PP_Instance instance) const | 85 virtual RenderView* GetRenderViewForInstance(PP_Instance instance) const |
84 OVERRIDE; | 86 OVERRIDE; |
85 virtual blink::WebPluginContainer* GetContainerForInstance( | 87 virtual blink::WebPluginContainer* GetContainerForInstance( |
86 PP_Instance instance) const OVERRIDE; | 88 PP_Instance instance) const OVERRIDE; |
87 virtual base::ProcessId GetPluginPID() const OVERRIDE; | 89 virtual base::ProcessId GetPluginPID() const OVERRIDE; |
88 virtual bool HasUserGesture(PP_Instance instance) const OVERRIDE; | 90 virtual bool HasUserGesture(PP_Instance instance) const OVERRIDE; |
89 virtual int GetRoutingIDForWidget(PP_Instance instance) const OVERRIDE; | 91 virtual int GetRoutingIDForWidget(PP_Instance instance) const OVERRIDE; |
90 virtual gfx::Point PluginPointToRenderFrame(PP_Instance instance, | 92 virtual gfx::Point PluginPointToRenderFrame(PP_Instance instance, |
91 const gfx::Point& pt) const | 93 const gfx::Point& pt) const |
92 OVERRIDE; | 94 OVERRIDE; |
93 virtual IPC::PlatformFileForTransit ShareHandleWithRemote( | 95 virtual IPC::PlatformFileForTransit ShareHandleWithRemote( |
94 base::PlatformFile handle, | 96 base::PlatformFile handle, |
95 bool should_close_source) OVERRIDE; | 97 bool should_close_source) OVERRIDE; |
96 virtual bool IsRunningInProcess() const OVERRIDE; | 98 virtual bool IsRunningInProcess() const OVERRIDE; |
| 99 virtual std::string GetPluginName() const OVERRIDE; |
| 100 virtual void SetToExternalPluginHost() OVERRIDE; |
97 virtual void CreateBrowserResourceHosts( | 101 virtual void CreateBrowserResourceHosts( |
98 PP_Instance instance, | 102 PP_Instance instance, |
99 const std::vector<IPC::Message>& nested_msgs, | 103 const std::vector<IPC::Message>& nested_msgs, |
100 const base::Callback<void(const std::vector<int>&)>& callback) const | 104 const base::Callback<void(const std::vector<int>&)>& callback) const |
101 OVERRIDE; | 105 OVERRIDE; |
102 virtual GURL GetDocumentURL(PP_Instance instance) const OVERRIDE; | 106 virtual GURL GetDocumentURL(PP_Instance instance) const OVERRIDE; |
103 | 107 |
104 private: | 108 private: |
105 RendererPpapiHostImpl(PluginModule* module, | 109 RendererPpapiHostImpl(PluginModule* module, |
106 ppapi::proxy::HostDispatcher* dispatcher, | 110 ppapi::proxy::HostDispatcher* dispatcher, |
(...skipping 16 matching lines...) Expand all Loading... |
123 ppapi::proxy::HostDispatcher* dispatcher_; | 127 ppapi::proxy::HostDispatcher* dispatcher_; |
124 | 128 |
125 scoped_ptr<ppapi::host::PpapiHost> ppapi_host_; | 129 scoped_ptr<ppapi::host::PpapiHost> ppapi_host_; |
126 | 130 |
127 // Null when running out-of-process. | 131 // Null when running out-of-process. |
128 scoped_ptr<PepperInProcessRouter> in_process_router_; | 132 scoped_ptr<PepperInProcessRouter> in_process_router_; |
129 | 133 |
130 // Whether the plugin is running in process. | 134 // Whether the plugin is running in process. |
131 bool is_running_in_process_; | 135 bool is_running_in_process_; |
132 | 136 |
| 137 // Whether this is a host for external plugins. |
| 138 bool is_external_plugin_host_; |
| 139 |
133 DISALLOW_COPY_AND_ASSIGN(RendererPpapiHostImpl); | 140 DISALLOW_COPY_AND_ASSIGN(RendererPpapiHostImpl); |
134 }; | 141 }; |
135 | 142 |
136 } // namespace content | 143 } // namespace content |
137 | 144 |
138 #endif // CONTENT_RENDERER_PEPPER_RENDERER_PPAPI_HOST_IMPL_H_ | 145 #endif // CONTENT_RENDERER_PEPPER_RENDERER_PPAPI_HOST_IMPL_H_ |
OLD | NEW |