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