| 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_PUBLIC_RENDERER_RENDERER_PPAPI_HOST_H_ | 5 #ifndef CONTENT_PUBLIC_RENDERER_RENDERER_PPAPI_HOST_H_ |
| 6 #define CONTENT_PUBLIC_RENDERER_RENDERER_PPAPI_HOST_H_ | 6 #define CONTENT_PUBLIC_RENDERER_RENDERER_PPAPI_HOST_H_ |
| 7 | 7 |
| 8 #include "base/memory/ref_counted.h" |
| 9 #include "content/common/content_export.h" |
| 8 #include "ppapi/c/pp_instance.h" | 10 #include "ppapi/c/pp_instance.h" |
| 9 | 11 |
| 12 class FilePath; |
| 13 |
| 14 namespace IPC { |
| 15 struct ChannelHandle; |
| 16 } |
| 17 |
| 10 namespace ppapi { | 18 namespace ppapi { |
| 19 class PpapiPermissions; |
| 11 namespace host { | 20 namespace host { |
| 12 class PpapiHost; | 21 class PpapiHost; |
| 13 } | 22 } |
| 14 } | 23 } |
| 15 | 24 |
| 16 namespace WebKit { | 25 namespace WebKit { |
| 17 class WebPluginContainer; | 26 class WebPluginContainer; |
| 18 } | 27 } |
| 19 | 28 |
| 29 namespace webkit { |
| 30 namespace ppapi { |
| 31 class PluginInstance; |
| 32 class PluginModule; |
| 33 } |
| 34 } |
| 35 |
| 20 namespace content { | 36 namespace content { |
| 21 | 37 |
| 22 class RenderView; | 38 class RenderView; |
| 23 | 39 |
| 24 // Interface that allows components in the embedder app to talk to the | 40 // Interface that allows components in the embedder app to talk to the |
| 25 // PpapiHost in the renderer process. | 41 // PpapiHost in the renderer process. |
| 26 // | 42 // |
| 27 // There will be one of these objects in the renderer per plugin module. | 43 // There will be one of these objects in the renderer per plugin module. |
| 28 class RendererPpapiHost { | 44 class RendererPpapiHost { |
| 29 public: | 45 public: |
| 46 // Creates a host and sets up an out-of-process proxy for an external plugin |
| 47 // module. |file_path| should identify the module. It is only used to report |
| 48 // failures to the renderer. |
| 49 // Returns a host if the external module is proxied successfully, otherwise |
| 50 // returns NULL. |
| 51 CONTENT_EXPORT static RendererPpapiHost* CreateExternalPluginModule( |
| 52 scoped_refptr<webkit::ppapi::PluginModule> plugin_module, |
| 53 webkit::ppapi::PluginInstance* plugin_instance, |
| 54 const FilePath& file_path, |
| 55 ppapi::PpapiPermissions permissions, |
| 56 const IPC::ChannelHandle& channel_handle, |
| 57 int plugin_child_id); |
| 58 |
| 30 // Returns the PpapiHost object. | 59 // Returns the PpapiHost object. |
| 31 virtual ppapi::host::PpapiHost* GetPpapiHost() = 0; | 60 virtual ppapi::host::PpapiHost* GetPpapiHost() = 0; |
| 32 | 61 |
| 33 // Returns true if the given PP_Instance is valid and belongs to the | 62 // Returns true if the given PP_Instance is valid and belongs to the |
| 34 // plugin associated with this host. | 63 // plugin associated with this host. |
| 35 virtual bool IsValidInstance(PP_Instance instance) const = 0; | 64 virtual bool IsValidInstance(PP_Instance instance) const = 0; |
| 36 | 65 |
| 37 // Returns the RenderView for the given plugin instance, or NULL if the | 66 // Returns the RenderView for the given plugin instance, or NULL if the |
| 38 // instance is invalid. | 67 // instance is invalid. |
| 39 virtual RenderView* GetRenderViewForInstance(PP_Instance instance) const = 0; | 68 virtual RenderView* GetRenderViewForInstance(PP_Instance instance) const = 0; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 51 virtual bool HasUserGesture(PP_Instance instance) const = 0; | 80 virtual bool HasUserGesture(PP_Instance instance) const = 0; |
| 52 | 81 |
| 53 protected: | 82 protected: |
| 54 virtual ~RendererPpapiHost() {} | 83 virtual ~RendererPpapiHost() {} |
| 55 }; | 84 }; |
| 56 | 85 |
| 57 } // namespace content | 86 } // namespace content |
| 58 | 87 |
| 59 #endif // CONTENT_PUBLIC_RENDERER_RENDERER_PPAPI_HOST_H_ | 88 #endif // CONTENT_PUBLIC_RENDERER_RENDERER_PPAPI_HOST_H_ |
| 60 | 89 |
| OLD | NEW |