| 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 | 9 |
| 10 namespace ppapi { | 10 namespace ppapi { |
| 11 namespace host { | 11 namespace host { |
| 12 class PpapiHost; | 12 class PpapiHost; |
| 13 } | 13 } |
| 14 } | 14 } |
| 15 | 15 |
| 16 namespace WebKit { |
| 17 class WebPluginContainer; |
| 18 } |
| 19 |
| 16 namespace content { | 20 namespace content { |
| 17 | 21 |
| 18 class RenderView; | 22 class RenderView; |
| 19 | 23 |
| 20 // Interface that allows components in the embedder app to talk to the | 24 // Interface that allows components in the embedder app to talk to the |
| 21 // PpapiHost in the renderer process. | 25 // PpapiHost in the renderer process. |
| 22 // | 26 // |
| 23 // There will be one of these objects in the renderer per plugin module. | 27 // There will be one of these objects in the renderer per plugin module. |
| 24 class RendererPpapiHost { | 28 class RendererPpapiHost { |
| 25 public: | 29 public: |
| 26 // Returns the PpapiHost object. | 30 // Returns the PpapiHost object. |
| 27 virtual ppapi::host::PpapiHost* GetPpapiHost() = 0; | 31 virtual ppapi::host::PpapiHost* GetPpapiHost() = 0; |
| 28 | 32 |
| 29 // Returns true if the given PP_Instance is valid and belongs to the | 33 // Returns true if the given PP_Instance is valid and belongs to the |
| 30 // plugin associated with this host. | 34 // plugin associated with this host. |
| 31 virtual bool IsValidInstance(PP_Instance instance) const = 0; | 35 virtual bool IsValidInstance(PP_Instance instance) const = 0; |
| 32 | 36 |
| 33 // Returns the RenderView for the given plugin instance, or NULL if the | 37 // Returns the RenderView for the given plugin instance, or NULL if the |
| 34 // instance is invalid. | 38 // instance is invalid. |
| 35 virtual RenderView* GetRenderViewForInstance(PP_Instance instance) const = 0; | 39 virtual RenderView* GetRenderViewForInstance(PP_Instance instance) const = 0; |
| 36 | 40 |
| 41 // Returns the WebPluginContainer for the given plugin instance, or NULL if |
| 42 // the instance is invalid. |
| 43 virtual WebKit::WebPluginContainer* GetContainerForInstance( |
| 44 PP_Instance instance) const = 0; |
| 45 |
| 37 // Returns true if the given instance is considered to be currently | 46 // Returns true if the given instance is considered to be currently |
| 38 // processing a user gesture or the plugin module has the "override user | 47 // 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 | 48 // 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 | 49 // restricted by user gestures). Returns false if the instance is invalid or |
| 41 // if there is no current user gesture. | 50 // if there is no current user gesture. |
| 42 virtual bool HasUserGesture(PP_Instance instance) const = 0; | 51 virtual bool HasUserGesture(PP_Instance instance) const = 0; |
| 43 | 52 |
| 44 protected: | 53 protected: |
| 45 virtual ~RendererPpapiHost() {} | 54 virtual ~RendererPpapiHost() {} |
| 46 }; | 55 }; |
| 47 | 56 |
| 48 } // namespace content | 57 } // namespace content |
| 49 | 58 |
| 50 #endif // CONTENT_PUBLIC_RENDERER_RENDERER_PPAPI_HOST_H_ | 59 #endif // CONTENT_PUBLIC_RENDERER_RENDERER_PPAPI_HOST_H_ |
| 51 | 60 |
| OLD | NEW |