Chromium Code Reviews| 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 "ppapi/c/pp_instance.h" | 8 #include "ppapi/c/pp_instance.h" |
| 9 #include "webkit/plugins/ppapi/plugin_delegate.h" | |
| 9 | 10 |
| 10 namespace ppapi { | 11 namespace ppapi { |
| 11 namespace host { | 12 namespace host { |
| 12 class PpapiHost; | 13 class PpapiHost; |
| 13 } | 14 } |
| 14 } | 15 } |
| 15 | 16 |
| 16 namespace content { | 17 namespace content { |
| 17 | 18 |
| 18 class RenderView; | 19 class RenderView; |
| 19 | 20 |
| 20 // Interface that allows components in the embedder app to talk to the | 21 // Interface that allows components in the embedder app to talk to the |
| 21 // PpapiHost in the renderer process. | 22 // PpapiHost in the renderer process. |
| 22 // | 23 // |
| 23 // There will be one of these objects in the renderer per plugin module. | 24 // There will be one of these objects in the renderer per plugin module. |
| 24 class RendererPpapiHost { | 25 class RendererPpapiHost { |
| 25 public: | 26 public: |
| 26 // Returns the PpapiHost object. | 27 // Returns the PpapiHost object. |
| 27 virtual ppapi::host::PpapiHost* GetPpapiHost() = 0; | 28 virtual ppapi::host::PpapiHost* GetPpapiHost() const = 0; |
|
brettw
2012/10/05 22:38:06
Did you particularly need this change? The reason
victorhsieh
2012/10/05 23:26:57
No, we can remove the const-ness up to RendererPpa
| |
| 28 | 29 |
| 29 // Returns true if the given PP_Instance is valid and belongs to the | 30 // Returns true if the given PP_Instance is valid and belongs to the |
| 30 // plugin associated with this host. | 31 // plugin associated with this host. |
| 31 virtual bool IsValidInstance(PP_Instance instance) const = 0; | 32 virtual bool IsValidInstance(PP_Instance instance) const = 0; |
| 32 | 33 |
| 33 // Returns the RenderView for the given plugin instance, or NULL if the | 34 // Returns the RenderView for the given plugin instance, or NULL if the |
| 34 // instance is invalid. | 35 // instance is invalid. |
| 35 virtual RenderView* GetRenderViewForInstance(PP_Instance instance) const = 0; | 36 virtual RenderView* GetRenderViewForInstance(PP_Instance instance) const = 0; |
| 36 | 37 |
| 38 // Returns the PlatformGraphics2D for the given plugin resource, or NULL if | |
| 39 // the resource is invalid. | |
| 40 virtual webkit::ppapi::PluginDelegate::PlatformGraphics2D* | |
| 41 GetPlatformGraphics2D(PP_Resource resource) const = 0; | |
| 42 | |
| 37 // Returns true if the given instance is considered to be currently | 43 // Returns true if the given instance is considered to be currently |
| 38 // processing a user gesture or the plugin module has the "override user | 44 // processing a user gesture or the plugin module has the "override user |
| 39 // gesture" flag set (in which case it can always do things normally | 45 // gesture" flag set (in which case it can always do things normally |
| 40 // restricted by user gestures). Returns false if the instance is invalid or | 46 // restricted by user gestures). Returns false if the instance is invalid or |
| 41 // if there is no current user gesture. | 47 // if there is no current user gesture. |
| 42 virtual bool HasUserGesture(PP_Instance instance) const = 0; | 48 virtual bool HasUserGesture(PP_Instance instance) const = 0; |
| 43 | 49 |
| 44 protected: | 50 protected: |
| 45 virtual ~RendererPpapiHost() {} | 51 virtual ~RendererPpapiHost() {} |
| 46 }; | 52 }; |
| 47 | 53 |
| 48 } // namespace content | 54 } // namespace content |
| 49 | 55 |
| 50 #endif // CONTENT_PUBLIC_RENDERER_RENDERER_PPAPI_HOST_H_ | 56 #endif // CONTENT_PUBLIC_RENDERER_RENDERER_PPAPI_HOST_H_ |
| 51 | |
| OLD | NEW |