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 "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
10 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" | 10 #include "content/common/gpu/client/webgraphicscontext3d_command_buffer_impl.h" |
(...skipping 19 matching lines...) Expand all Loading... |
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 content::PepperParentContextProvider, | 34 public content::PepperParentContextProvider, |
35 public WebGraphicsContext3DSwapBuffersClient { | 35 public WebGraphicsContext3DSwapBuffersClient { |
36 public: | 36 public: |
37 static RenderWidgetFullscreenPepper* Create( | 37 static RenderWidgetFullscreenPepper* Create( |
38 int32 opener_id, | 38 int32 opener_id, |
39 webkit::ppapi::PluginInstance* plugin, | 39 webkit::ppapi::PluginInstance* plugin, |
40 const GURL& active_url); | 40 const GURL& active_url, |
| 41 const WebKit::WebScreenInfo& screen_info); |
41 | 42 |
42 // WebGraphicscontext3DSwapBuffersClient implementation | 43 // WebGraphicscontext3DSwapBuffersClient implementation |
43 virtual void OnViewContextSwapBuffersPosted() OVERRIDE; | 44 virtual void OnViewContextSwapBuffersPosted() OVERRIDE; |
44 virtual void OnViewContextSwapBuffersComplete() OVERRIDE; | 45 virtual void OnViewContextSwapBuffersComplete() OVERRIDE; |
45 virtual void OnViewContextSwapBuffersAborted() OVERRIDE; | 46 virtual void OnViewContextSwapBuffersAborted() OVERRIDE; |
46 | 47 |
47 // pepper::FullscreenContainer API. | 48 // pepper::FullscreenContainer API. |
48 virtual void Invalidate() OVERRIDE; | 49 virtual void Invalidate() OVERRIDE; |
49 virtual void InvalidateRect(const WebKit::WebRect& rect) OVERRIDE; | 50 virtual void InvalidateRect(const WebKit::WebRect& rect) OVERRIDE; |
50 virtual void ScrollRect(int dx, int dy, const WebKit::WebRect& rect) OVERRIDE; | 51 virtual void ScrollRect(int dx, int dy, const WebKit::WebRect& rect) OVERRIDE; |
51 virtual void Destroy() OVERRIDE; | 52 virtual void Destroy() OVERRIDE; |
52 virtual void DidChangeCursor(const WebKit::WebCursorInfo& cursor) OVERRIDE; | 53 virtual void DidChangeCursor(const WebKit::WebCursorInfo& cursor) OVERRIDE; |
53 virtual webkit::ppapi::PluginDelegate::PlatformContext3D* | 54 virtual webkit::ppapi::PluginDelegate::PlatformContext3D* |
54 CreateContext3D() OVERRIDE; | 55 CreateContext3D() OVERRIDE; |
55 virtual MouseLockDispatcher* GetMouseLockDispatcher() OVERRIDE; | 56 virtual MouseLockDispatcher* GetMouseLockDispatcher() OVERRIDE; |
56 | 57 |
57 // IPC::Listener implementation. This overrides the implementation | 58 // IPC::Listener implementation. This overrides the implementation |
58 // in RenderWidgetFullscreen. | 59 // in RenderWidgetFullscreen. |
59 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; | 60 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; |
60 | 61 |
61 WebGraphicsContext3DCommandBufferImpl* context() const { return context_; } | 62 WebGraphicsContext3DCommandBufferImpl* context() const { return context_; } |
62 void SwapBuffers(); | 63 void SwapBuffers(); |
63 | 64 |
64 // Could be NULL when this widget is closing. | 65 // Could be NULL when this widget is closing. |
65 webkit::ppapi::PluginInstance* plugin() const { return plugin_; } | 66 webkit::ppapi::PluginInstance* plugin() const { return plugin_; } |
66 | 67 |
67 protected: | 68 protected: |
68 RenderWidgetFullscreenPepper(webkit::ppapi::PluginInstance* plugin, | 69 RenderWidgetFullscreenPepper(webkit::ppapi::PluginInstance* plugin, |
69 const GURL& active_url); | 70 const GURL& active_url, |
| 71 const WebKit::WebScreenInfo& screen_info); |
70 virtual ~RenderWidgetFullscreenPepper(); | 72 virtual ~RenderWidgetFullscreenPepper(); |
71 | 73 |
72 // RenderWidget API. | 74 // RenderWidget API. |
73 virtual void WillInitiatePaint() OVERRIDE; | 75 virtual void WillInitiatePaint() OVERRIDE; |
74 virtual void DidInitiatePaint() OVERRIDE; | 76 virtual void DidInitiatePaint() OVERRIDE; |
75 virtual void DidFlushPaint() OVERRIDE; | 77 virtual void DidFlushPaint() OVERRIDE; |
76 virtual void Close() OVERRIDE; | 78 virtual void Close() OVERRIDE; |
77 virtual webkit::ppapi::PluginInstance* GetBitmapForOptimizedPluginPaint( | 79 virtual webkit::ppapi::PluginInstance* GetBitmapForOptimizedPluginPaint( |
78 const gfx::Rect& paint_bounds, | 80 const gfx::Rect& paint_bounds, |
79 TransportDIB** dib, | 81 TransportDIB** dib, |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 unsigned int program_; | 118 unsigned int program_; |
117 | 119 |
118 base::WeakPtrFactory<RenderWidgetFullscreenPepper> weak_ptr_factory_; | 120 base::WeakPtrFactory<RenderWidgetFullscreenPepper> weak_ptr_factory_; |
119 | 121 |
120 scoped_ptr<MouseLockDispatcher> mouse_lock_dispatcher_; | 122 scoped_ptr<MouseLockDispatcher> mouse_lock_dispatcher_; |
121 | 123 |
122 DISALLOW_COPY_AND_ASSIGN(RenderWidgetFullscreenPepper); | 124 DISALLOW_COPY_AND_ASSIGN(RenderWidgetFullscreenPepper); |
123 }; | 125 }; |
124 | 126 |
125 #endif // CONTENT_RENDERER_RENDER_WIDGET_FULLSCREEN_PEPPER_H_ | 127 #endif // CONTENT_RENDERER_RENDER_WIDGET_FULLSCREEN_PEPPER_H_ |
OLD | NEW |