OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 CHROME_RENDERER_RENDER_WIDGET_FULLSCREEN_PEPPER_H_ | 5 #ifndef CHROME_RENDERER_RENDER_WIDGET_FULLSCREEN_PEPPER_H_ |
6 #define CHROME_RENDERER_RENDER_WIDGET_FULLSCREEN_PEPPER_H_ | 6 #define CHROME_RENDERER_RENDER_WIDGET_FULLSCREEN_PEPPER_H_ |
7 | 7 |
8 #include "chrome/renderer/render_widget_fullscreen.h" | 8 #include "chrome/renderer/render_widget_fullscreen.h" |
9 #include "third_party/WebKit/WebKit/chromium/public/WebWidget.h" | 9 #include "third_party/WebKit/WebKit/chromium/public/WebWidget.h" |
10 | 10 |
11 namespace pepper { | 11 namespace webkit { |
| 12 namespace plugins { |
| 13 namespace ppapi { |
| 14 |
12 class PluginInstance; | 15 class PluginInstance; |
13 class FullscreenContainer; | 16 class FullscreenContainer; |
14 } | 17 |
| 18 } // namespace ppapi |
| 19 } // namespace plugins |
| 20 } // namespace webkit |
15 | 21 |
16 // A RenderWidget that hosts a fullscreen pepper plugin. This provides a | 22 // A RenderWidget that hosts a fullscreen pepper plugin. This provides a |
17 // FullscreenContainer that the plugin instance can callback into to e.g. | 23 // FullscreenContainer that the plugin instance can callback into to e.g. |
18 // invalidate rects. | 24 // invalidate rects. |
19 class RenderWidgetFullscreenPepper : public RenderWidgetFullscreen { | 25 class RenderWidgetFullscreenPepper : public RenderWidgetFullscreen { |
20 public: | 26 public: |
21 static RenderWidgetFullscreenPepper* Create( | 27 static RenderWidgetFullscreenPepper* Create( |
22 int32 opener_id, | 28 int32 opener_id, |
23 RenderThreadBase* render_thread, | 29 RenderThreadBase* render_thread, |
24 pepper::PluginInstance* plugin); | 30 webkit::plugins::ppapi::PluginInstance* plugin); |
25 | 31 |
26 // Asks the browser to close this view, which will tear off the window and | 32 // Asks the browser to close this view, which will tear off the window and |
27 // close this widget. | 33 // close this widget. |
28 void SendClose(); | 34 void SendClose(); |
29 | 35 |
30 // Invalidate the whole widget to force a redraw. | 36 // Invalidate the whole widget to force a redraw. |
31 void GenerateFullRepaint(); | 37 void GenerateFullRepaint(); |
32 | 38 |
33 pepper::FullscreenContainer* container() const { return container_.get(); } | 39 webkit::plugins::ppapi::FullscreenContainer* container() const { |
| 40 return container_.get(); |
| 41 } |
34 | 42 |
35 protected: | 43 protected: |
36 RenderWidgetFullscreenPepper(RenderThreadBase* render_thread, | 44 RenderWidgetFullscreenPepper(RenderThreadBase* render_thread, |
37 pepper::PluginInstance* plugin); | 45 webkit::plugins::ppapi::PluginInstance* plugin); |
38 virtual ~RenderWidgetFullscreenPepper(); | 46 virtual ~RenderWidgetFullscreenPepper(); |
39 | 47 |
40 // RenderWidget API. | 48 // RenderWidget API. |
41 virtual void DidInitiatePaint(); | 49 virtual void DidInitiatePaint(); |
42 virtual void DidFlushPaint(); | 50 virtual void DidFlushPaint(); |
43 virtual void Close(); | 51 virtual void Close(); |
44 virtual bool GetBitmapForOptimizedPluginPaint( | 52 virtual bool GetBitmapForOptimizedPluginPaint( |
45 const gfx::Rect& paint_bounds, | 53 const gfx::Rect& paint_bounds, |
46 TransportDIB** dib, | 54 TransportDIB** dib, |
47 gfx::Rect* location, | 55 gfx::Rect* location, |
48 gfx::Rect* clip); | 56 gfx::Rect* clip); |
49 | 57 |
50 // RenderWidgetFullscreen API. | 58 // RenderWidgetFullscreen API. |
51 virtual WebKit::WebWidget* CreateWebWidget(); | 59 virtual WebKit::WebWidget* CreateWebWidget(); |
52 | 60 |
53 private: | 61 private: |
54 // The plugin instance this widget wraps. | 62 // The plugin instance this widget wraps. |
55 pepper::PluginInstance* plugin_; | 63 webkit::plugins::ppapi::PluginInstance* plugin_; |
56 | 64 |
57 // The FullscreenContainer that the plugin instance can callback into. | 65 // The FullscreenContainer that the plugin instance can callback into. |
58 scoped_ptr<pepper::FullscreenContainer> container_; | 66 scoped_ptr<webkit::plugins::ppapi::FullscreenContainer> container_; |
59 | 67 |
60 DISALLOW_COPY_AND_ASSIGN(RenderWidgetFullscreenPepper); | 68 DISALLOW_COPY_AND_ASSIGN(RenderWidgetFullscreenPepper); |
61 }; | 69 }; |
62 | 70 |
63 #endif // CHROME_RENDERER_RENDER_WIDGET_FULLSCREEN_PEPPER_H_ | 71 #endif // CHROME_RENDERER_RENDER_WIDGET_FULLSCREEN_PEPPER_H_ |
OLD | NEW |