| 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_RENDER_WIDGET_FULLSCREEN_PEPPER_H_ | 5 #ifndef CONTENT_RENDERER_RENDER_WIDGET_FULLSCREEN_PEPPER_H_ |
| 6 #define CONTENT_RENDERER_RENDER_WIDGET_FULLSCREEN_PEPPER_H_ | 6 #define CONTENT_RENDERER_RENDER_WIDGET_FULLSCREEN_PEPPER_H_ |
| 7 | 7 |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "content/renderer/mouse_lock_dispatcher.h" | 9 #include "content/renderer/mouse_lock_dispatcher.h" |
| 10 #include "content/renderer/render_widget_fullscreen.h" | 10 #include "content/renderer/render_widget_fullscreen.h" |
| 11 #include "third_party/WebKit/public/web/WebWidget.h" | 11 #include "third_party/WebKit/public/web/WebWidget.h" |
| 12 #include "webkit/plugins/ppapi/fullscreen_container.h" | 12 #include "webkit/plugins/ppapi/fullscreen_container.h" |
| 13 | 13 |
| 14 namespace webkit { | 14 namespace webkit { |
| 15 namespace ppapi { | 15 namespace ppapi { |
| 16 | 16 |
| 17 class PluginInstance; | 17 class PluginInstanceImpl; |
| 18 | 18 |
| 19 } // namespace ppapi | 19 } // namespace ppapi |
| 20 } // namespace webkit | 20 } // namespace webkit |
| 21 | 21 |
| 22 namespace WebKit { | 22 namespace WebKit { |
| 23 class WebLayer; | 23 class WebLayer; |
| 24 } | 24 } |
| 25 | 25 |
| 26 namespace content { | 26 namespace content { |
| 27 | 27 |
| 28 // A RenderWidget that hosts a fullscreen pepper plugin. This provides a | 28 // A RenderWidget that hosts a fullscreen pepper plugin. This provides a |
| 29 // FullscreenContainer that the plugin instance can callback into to e.g. | 29 // FullscreenContainer that the plugin instance can callback into to e.g. |
| 30 // invalidate rects. | 30 // invalidate rects. |
| 31 class RenderWidgetFullscreenPepper : | 31 class RenderWidgetFullscreenPepper : |
| 32 public RenderWidgetFullscreen, | 32 public RenderWidgetFullscreen, |
| 33 public webkit::ppapi::FullscreenContainer { | 33 public webkit::ppapi::FullscreenContainer { |
| 34 public: | 34 public: |
| 35 static RenderWidgetFullscreenPepper* Create( | 35 static RenderWidgetFullscreenPepper* Create( |
| 36 int32 opener_id, | 36 int32 opener_id, |
| 37 webkit::ppapi::PluginInstance* plugin, | 37 webkit::ppapi::PluginInstanceImpl* plugin, |
| 38 const GURL& active_url, | 38 const GURL& active_url, |
| 39 const WebKit::WebScreenInfo& screen_info); | 39 const WebKit::WebScreenInfo& screen_info); |
| 40 | 40 |
| 41 // pepper::FullscreenContainer API. | 41 // pepper::FullscreenContainer API. |
| 42 virtual void Invalidate() OVERRIDE; | 42 virtual void Invalidate() OVERRIDE; |
| 43 virtual void InvalidateRect(const WebKit::WebRect& rect) OVERRIDE; | 43 virtual void InvalidateRect(const WebKit::WebRect& rect) OVERRIDE; |
| 44 virtual void ScrollRect(int dx, int dy, const WebKit::WebRect& rect) OVERRIDE; | 44 virtual void ScrollRect(int dx, int dy, const WebKit::WebRect& rect) OVERRIDE; |
| 45 virtual void Destroy() OVERRIDE; | 45 virtual void Destroy() OVERRIDE; |
| 46 virtual void DidChangeCursor(const WebKit::WebCursorInfo& cursor) OVERRIDE; | 46 virtual void DidChangeCursor(const WebKit::WebCursorInfo& cursor) OVERRIDE; |
| 47 virtual void SetLayer(WebKit::WebLayer* layer) OVERRIDE; | 47 virtual void SetLayer(WebKit::WebLayer* layer) OVERRIDE; |
| 48 | 48 |
| 49 // IPC::Listener implementation. This overrides the implementation | 49 // IPC::Listener implementation. This overrides the implementation |
| 50 // in RenderWidgetFullscreen. | 50 // in RenderWidgetFullscreen. |
| 51 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; | 51 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; |
| 52 | 52 |
| 53 // Could be NULL when this widget is closing. | 53 // Could be NULL when this widget is closing. |
| 54 webkit::ppapi::PluginInstance* plugin() const { return plugin_; } | 54 webkit::ppapi::PluginInstanceImpl* plugin() const { return plugin_; } |
| 55 | 55 |
| 56 MouseLockDispatcher* mouse_lock_dispatcher() const { | 56 MouseLockDispatcher* mouse_lock_dispatcher() const { |
| 57 return mouse_lock_dispatcher_.get(); | 57 return mouse_lock_dispatcher_.get(); |
| 58 } | 58 } |
| 59 | 59 |
| 60 bool is_compositing() const { return !!layer_; } | 60 bool is_compositing() const { return !!layer_; } |
| 61 | 61 |
| 62 protected: | 62 protected: |
| 63 RenderWidgetFullscreenPepper(webkit::ppapi::PluginInstance* plugin, | 63 RenderWidgetFullscreenPepper(webkit::ppapi::PluginInstanceImpl* plugin, |
| 64 const GURL& active_url, | 64 const GURL& active_url, |
| 65 const WebKit::WebScreenInfo& screen_info); | 65 const WebKit::WebScreenInfo& screen_info); |
| 66 virtual ~RenderWidgetFullscreenPepper(); | 66 virtual ~RenderWidgetFullscreenPepper(); |
| 67 | 67 |
| 68 // RenderWidget API. | 68 // RenderWidget API. |
| 69 virtual void WillInitiatePaint() OVERRIDE; | 69 virtual void WillInitiatePaint() OVERRIDE; |
| 70 virtual void DidInitiatePaint() OVERRIDE; | 70 virtual void DidInitiatePaint() OVERRIDE; |
| 71 virtual void DidFlushPaint() OVERRIDE; | 71 virtual void DidFlushPaint() OVERRIDE; |
| 72 virtual void Close() OVERRIDE; | 72 virtual void Close() OVERRIDE; |
| 73 virtual webkit::ppapi::PluginInstance* GetBitmapForOptimizedPluginPaint( | 73 virtual webkit::ppapi::PluginInstanceImpl* GetBitmapForOptimizedPluginPaint( |
| 74 const gfx::Rect& paint_bounds, | 74 const gfx::Rect& paint_bounds, |
| 75 TransportDIB** dib, | 75 TransportDIB** dib, |
| 76 gfx::Rect* location, | 76 gfx::Rect* location, |
| 77 gfx::Rect* clip, | 77 gfx::Rect* clip, |
| 78 float* scale_factor) OVERRIDE; | 78 float* scale_factor) OVERRIDE; |
| 79 virtual void OnResize(const ViewMsg_Resize_Params& params) OVERRIDE; | 79 virtual void OnResize(const ViewMsg_Resize_Params& params) OVERRIDE; |
| 80 | 80 |
| 81 // RenderWidgetFullscreen API. | 81 // RenderWidgetFullscreen API. |
| 82 virtual WebKit::WebWidget* CreateWebWidget() OVERRIDE; | 82 virtual WebKit::WebWidget* CreateWebWidget() OVERRIDE; |
| 83 | 83 |
| 84 // RenderWidget overrides. | 84 // RenderWidget overrides. |
| 85 virtual GURL GetURLForGraphicsContext3D() OVERRIDE; | 85 virtual GURL GetURLForGraphicsContext3D() OVERRIDE; |
| 86 virtual void SetDeviceScaleFactor(float device_scale_factor) OVERRIDE; | 86 virtual void SetDeviceScaleFactor(float device_scale_factor) OVERRIDE; |
| 87 | 87 |
| 88 private: | 88 private: |
| 89 // URL that is responsible for this widget, passed to ggl::CreateViewContext. | 89 // URL that is responsible for this widget, passed to ggl::CreateViewContext. |
| 90 GURL active_url_; | 90 GURL active_url_; |
| 91 | 91 |
| 92 // The plugin instance this widget wraps. | 92 // The plugin instance this widget wraps. |
| 93 webkit::ppapi::PluginInstance* plugin_; | 93 webkit::ppapi::PluginInstanceImpl* plugin_; |
| 94 | 94 |
| 95 WebKit::WebLayer* layer_; | 95 WebKit::WebLayer* layer_; |
| 96 | 96 |
| 97 scoped_ptr<MouseLockDispatcher> mouse_lock_dispatcher_; | 97 scoped_ptr<MouseLockDispatcher> mouse_lock_dispatcher_; |
| 98 | 98 |
| 99 DISALLOW_COPY_AND_ASSIGN(RenderWidgetFullscreenPepper); | 99 DISALLOW_COPY_AND_ASSIGN(RenderWidgetFullscreenPepper); |
| 100 }; | 100 }; |
| 101 | 101 |
| 102 } // namespace content | 102 } // namespace content |
| 103 | 103 |
| 104 #endif // CONTENT_RENDERER_RENDER_WIDGET_FULLSCREEN_PEPPER_H_ | 104 #endif // CONTENT_RENDERER_RENDER_WIDGET_FULLSCREEN_PEPPER_H_ |
| OLD | NEW |