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" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/platform_file.h" | 9 #include "base/platform_file.h" |
10 #include "content/common/content_export.h" | 10 #include "content/common/content_export.h" |
11 #include "ipc/ipc_platform_file.h" | 11 #include "ipc/ipc_platform_file.h" |
12 #include "ppapi/c/pp_instance.h" | 12 #include "ppapi/c/pp_instance.h" |
| 13 #include "webkit/plugins/ppapi/plugin_delegate.h" |
13 | 14 |
14 class FilePath; | 15 class FilePath; |
15 | 16 |
16 namespace gfx { | 17 namespace gfx { |
17 class Point; | 18 class Point; |
18 } | 19 } |
19 | 20 |
20 namespace IPC { | 21 namespace IPC { |
21 struct ChannelHandle; | 22 struct ChannelHandle; |
22 } | 23 } |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 | 83 |
83 // Returns the RenderView for the given plugin instance, or NULL if the | 84 // Returns the RenderView for the given plugin instance, or NULL if the |
84 // instance is invalid. | 85 // instance is invalid. |
85 virtual RenderView* GetRenderViewForInstance(PP_Instance instance) const = 0; | 86 virtual RenderView* GetRenderViewForInstance(PP_Instance instance) const = 0; |
86 | 87 |
87 // Returns the WebPluginContainer for the given plugin instance, or NULL if | 88 // Returns the WebPluginContainer for the given plugin instance, or NULL if |
88 // the instance is invalid. | 89 // the instance is invalid. |
89 virtual WebKit::WebPluginContainer* GetContainerForInstance( | 90 virtual WebKit::WebPluginContainer* GetContainerForInstance( |
90 PP_Instance instance) const = 0; | 91 PP_Instance instance) const = 0; |
91 | 92 |
| 93 // Returns the PlatformGraphics2D for the given plugin resource, or NULL if |
| 94 // the resource is invalid. |
| 95 virtual webkit::ppapi::PluginDelegate::PlatformGraphics2D* |
| 96 GetPlatformGraphics2D(PP_Resource resource) = 0; |
| 97 |
92 // Returns true if the given instance is considered to be currently | 98 // Returns true if the given instance is considered to be currently |
93 // processing a user gesture or the plugin module has the "override user | 99 // processing a user gesture or the plugin module has the "override user |
94 // gesture" flag set (in which case it can always do things normally | 100 // gesture" flag set (in which case it can always do things normally |
95 // restricted by user gestures). Returns false if the instance is invalid or | 101 // restricted by user gestures). Returns false if the instance is invalid or |
96 // if there is no current user gesture. | 102 // if there is no current user gesture. |
97 virtual bool HasUserGesture(PP_Instance instance) const = 0; | 103 virtual bool HasUserGesture(PP_Instance instance) const = 0; |
98 | 104 |
99 // Returns the routing ID for the render widget containing the given | 105 // Returns the routing ID for the render widget containing the given |
100 // instance. This will take into account the current Flash fullscreen state, | 106 // instance. This will take into account the current Flash fullscreen state, |
101 // so if there is a Flash fullscreen instance active, this will return the | 107 // so if there is a Flash fullscreen instance active, this will return the |
(...skipping 10 matching lines...) Expand all Loading... |
112 // Shares a file handle (HANDLE / file descriptor) with the remote side. It | 118 // Shares a file handle (HANDLE / file descriptor) with the remote side. It |
113 // returns a handle that should be sent in exactly one IPC message. Upon | 119 // returns a handle that should be sent in exactly one IPC message. Upon |
114 // receipt, the remote side then owns that handle. Note: if sending the | 120 // receipt, the remote side then owns that handle. Note: if sending the |
115 // message fails, the returned handle is properly closed by the IPC system. If | 121 // message fails, the returned handle is properly closed by the IPC system. If |
116 // |should_close_source| is set to true, the original handle is closed by this | 122 // |should_close_source| is set to true, the original handle is closed by this |
117 // operation and should not be used again. | 123 // operation and should not be used again. |
118 virtual IPC::PlatformFileForTransit ShareHandleWithRemote( | 124 virtual IPC::PlatformFileForTransit ShareHandleWithRemote( |
119 base::PlatformFile handle, | 125 base::PlatformFile handle, |
120 bool should_close_source) = 0; | 126 bool should_close_source) = 0; |
121 | 127 |
| 128 // Returns true if the plugin is running in process. |
| 129 virtual bool IsRunningInProcess() const = 0; |
| 130 |
122 protected: | 131 protected: |
123 virtual ~RendererPpapiHost() {} | 132 virtual ~RendererPpapiHost() {} |
124 }; | 133 }; |
125 | 134 |
126 } // namespace content | 135 } // namespace content |
127 | 136 |
128 #endif // CONTENT_PUBLIC_RENDERER_RENDERER_PPAPI_HOST_H_ | 137 #endif // CONTENT_PUBLIC_RENDERER_RENDERER_PPAPI_HOST_H_ |
129 | |
OLD | NEW |