| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| 11 | 11 |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "content/renderer/mouse_lock_dispatcher.h" | 13 #include "content/renderer/mouse_lock_dispatcher.h" |
| 14 #include "content/renderer/pepper/fullscreen_container.h" | 14 #include "content/renderer/pepper/fullscreen_container.h" |
| 15 #include "content/renderer/render_widget_fullscreen.h" | 15 #include "content/renderer/render_widget.h" |
| 16 #include "third_party/WebKit/public/web/WebWidget.h" | 16 #include "third_party/WebKit/public/web/WebWidget.h" |
| 17 #include "url/gurl.h" | 17 #include "url/gurl.h" |
| 18 | 18 |
| 19 namespace blink { | 19 namespace blink { |
| 20 class WebLayer; | 20 class WebLayer; |
| 21 } | 21 } |
| 22 | 22 |
| 23 namespace content { | 23 namespace content { |
| 24 class CompositorDependencies; |
| 24 class PepperPluginInstanceImpl; | 25 class PepperPluginInstanceImpl; |
| 25 | 26 |
| 26 // A RenderWidget that hosts a fullscreen pepper plugin. This provides a | 27 // A RenderWidget that hosts a fullscreen pepper plugin. This provides a |
| 27 // FullscreenContainer that the plugin instance can callback into to e.g. | 28 // FullscreenContainer that the plugin instance can callback into to e.g. |
| 28 // invalidate rects. | 29 // invalidate rects. |
| 29 class RenderWidgetFullscreenPepper : public RenderWidgetFullscreen, | 30 class RenderWidgetFullscreenPepper : public RenderWidget, |
| 30 public FullscreenContainer { | 31 public FullscreenContainer { |
| 31 public: | 32 public: |
| 32 static RenderWidgetFullscreenPepper* Create( | 33 static RenderWidgetFullscreenPepper* Create( |
| 33 int32_t routing_id, | 34 int32_t routing_id, |
| 34 int32_t opener_id, | 35 const RenderWidget::ShowCallback& show_callback, |
| 35 CompositorDependencies* compositor_deps, | 36 CompositorDependencies* compositor_deps, |
| 36 PepperPluginInstanceImpl* plugin, | 37 PepperPluginInstanceImpl* plugin, |
| 37 const GURL& active_url, | 38 const GURL& active_url, |
| 38 const ScreenInfo& screen_info); | 39 const ScreenInfo& screen_info); |
| 39 | 40 |
| 40 // pepper::FullscreenContainer API. | 41 // pepper::FullscreenContainer API. |
| 41 void Invalidate() override; | 42 void Invalidate() override; |
| 42 void InvalidateRect(const blink::WebRect& rect) override; | 43 void InvalidateRect(const blink::WebRect& rect) override; |
| 43 void ScrollRect(int dx, int dy, const blink::WebRect& rect) override; | 44 void ScrollRect(int dx, int dy, const blink::WebRect& rect) override; |
| 44 void Destroy() override; | 45 void Destroy() override; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 62 PepperPluginInstanceImpl* plugin, | 63 PepperPluginInstanceImpl* plugin, |
| 63 const GURL& active_url, | 64 const GURL& active_url, |
| 64 const ScreenInfo& screen_info); | 65 const ScreenInfo& screen_info); |
| 65 ~RenderWidgetFullscreenPepper() override; | 66 ~RenderWidgetFullscreenPepper() override; |
| 66 | 67 |
| 67 // RenderWidget API. | 68 // RenderWidget API. |
| 68 void DidInitiatePaint() override; | 69 void DidInitiatePaint() override; |
| 69 void Close() override; | 70 void Close() override; |
| 70 void OnResize(const ResizeParams& params) override; | 71 void OnResize(const ResizeParams& params) override; |
| 71 | 72 |
| 72 // RenderWidgetFullscreen API. | |
| 73 blink::WebWidget* CreateWebWidget() override; | |
| 74 | |
| 75 // RenderWidget overrides. | 73 // RenderWidget overrides. |
| 76 GURL GetURLForGraphicsContext3D() override; | 74 GURL GetURLForGraphicsContext3D() override; |
| 77 void OnDeviceScaleFactorChanged() override; | 75 void OnDeviceScaleFactorChanged() override; |
| 78 | 76 |
| 79 private: | 77 private: |
| 80 // URL that is responsible for this widget, passed to ggl::CreateViewContext. | 78 // URL that is responsible for this widget, passed to ggl::CreateViewContext. |
| 81 GURL active_url_; | 79 GURL active_url_; |
| 82 | 80 |
| 83 // The plugin instance this widget wraps. | 81 // The plugin instance this widget wraps. |
| 84 PepperPluginInstanceImpl* plugin_; | 82 PepperPluginInstanceImpl* plugin_; |
| 85 | 83 |
| 86 blink::WebLayer* layer_; | 84 blink::WebLayer* layer_; |
| 87 | 85 |
| 88 std::unique_ptr<MouseLockDispatcher> mouse_lock_dispatcher_; | 86 std::unique_ptr<MouseLockDispatcher> mouse_lock_dispatcher_; |
| 89 | 87 |
| 90 DISALLOW_COPY_AND_ASSIGN(RenderWidgetFullscreenPepper); | 88 DISALLOW_COPY_AND_ASSIGN(RenderWidgetFullscreenPepper); |
| 91 }; | 89 }; |
| 92 | 90 |
| 93 } // namespace content | 91 } // namespace content |
| 94 | 92 |
| 95 #endif // CONTENT_RENDERER_RENDER_WIDGET_FULLSCREEN_PEPPER_H_ | 93 #endif // CONTENT_RENDERER_RENDER_WIDGET_FULLSCREEN_PEPPER_H_ |
| OLD | NEW |