Roll src/third_party/WebKit d10c917:a1123a1 (svn 198729:198730)
[chromium-blink-merge.git] / content / renderer / render_widget_fullscreen_pepper.h
blobe94f6137c8d3fecadd91b53c19abc7d74c3e68ef
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
3 // found in the LICENSE file.
5 #ifndef CONTENT_RENDERER_RENDER_WIDGET_FULLSCREEN_PEPPER_H_
6 #define CONTENT_RENDERER_RENDER_WIDGET_FULLSCREEN_PEPPER_H_
8 #include "base/memory/scoped_ptr.h"
9 #include "content/renderer/mouse_lock_dispatcher.h"
10 #include "content/renderer/pepper/fullscreen_container.h"
11 #include "content/renderer/render_widget_fullscreen.h"
12 #include "third_party/WebKit/public/web/WebWidget.h"
14 namespace blink {
15 class WebLayer;
18 namespace content {
19 class PepperPluginInstanceImpl;
21 // A RenderWidget that hosts a fullscreen pepper plugin. This provides a
22 // FullscreenContainer that the plugin instance can callback into to e.g.
23 // invalidate rects.
24 class RenderWidgetFullscreenPepper : public RenderWidgetFullscreen,
25 public FullscreenContainer {
26 public:
27 static RenderWidgetFullscreenPepper* Create(
28 int32 opener_id,
29 CompositorDependencies* compositor_deps,
30 PepperPluginInstanceImpl* plugin,
31 const GURL& active_url,
32 const blink::WebScreenInfo& screen_info);
34 // pepper::FullscreenContainer API.
35 void Invalidate() override;
36 void InvalidateRect(const blink::WebRect& rect) override;
37 void ScrollRect(int dx, int dy, const blink::WebRect& rect) override;
38 void Destroy() override;
39 void DidChangeCursor(const blink::WebCursorInfo& cursor) override;
40 void SetLayer(blink::WebLayer* layer) override;
42 // IPC::Listener implementation. This overrides the implementation
43 // in RenderWidgetFullscreen.
44 bool OnMessageReceived(const IPC::Message& msg) override;
46 // Could be NULL when this widget is closing.
47 PepperPluginInstanceImpl* plugin() const { return plugin_; }
49 MouseLockDispatcher* mouse_lock_dispatcher() const {
50 return mouse_lock_dispatcher_.get();
53 protected:
54 RenderWidgetFullscreenPepper(PepperPluginInstanceImpl* plugin,
55 const GURL& active_url,
56 const blink::WebScreenInfo& screen_info);
57 ~RenderWidgetFullscreenPepper() override;
59 // RenderWidget API.
60 void DidInitiatePaint() override;
61 void DidFlushPaint() override;
62 void Close() override;
63 void OnResize(const ViewMsg_Resize_Params& params) override;
65 // RenderWidgetFullscreen API.
66 blink::WebWidget* CreateWebWidget() override;
68 // RenderWidget overrides.
69 GURL GetURLForGraphicsContext3D() override;
70 void SetDeviceScaleFactor(float device_scale_factor) override;
72 private:
73 // URL that is responsible for this widget, passed to ggl::CreateViewContext.
74 GURL active_url_;
76 // The plugin instance this widget wraps.
77 PepperPluginInstanceImpl* plugin_;
79 blink::WebLayer* layer_;
81 scoped_ptr<MouseLockDispatcher> mouse_lock_dispatcher_;
83 DISALLOW_COPY_AND_ASSIGN(RenderWidgetFullscreenPepper);
86 } // namespace content
88 #endif // CONTENT_RENDERER_RENDER_WIDGET_FULLSCREEN_PEPPER_H_