blob: b5aef5ceae014b27df63321b91eba251fbff2f01 [file] [log] [blame]
[email protected]29ed96a2012-02-04 18:12:161// Copyright (c) 2012 The Chromium Authors. All rights reserved.
[email protected]79c7bed2010-09-14 22:28:392// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
[email protected]2cff0052011-03-18 16:51:445#ifndef CONTENT_RENDERER_RENDER_WIDGET_FULLSCREEN_PEPPER_H_
6#define CONTENT_RENDERER_RENDER_WIDGET_FULLSCREEN_PEPPER_H_
[email protected]79c7bed2010-09-14 22:28:397
avi1023d012015-12-25 02:39:148#include <stdint.h>
9
dchengcedca5612016-04-09 01:40:1510#include <memory>
11
avi1023d012015-12-25 02:39:1412#include "base/macros.h"
[email protected]89054502012-06-03 10:29:2413#include "content/renderer/mouse_lock_dispatcher.h"
[email protected]20790a222013-07-25 02:23:0514#include "content/renderer/pepper/fullscreen_container.h"
nickf7b38222016-11-22 21:59:3515#include "content/renderer/render_widget.h"
[email protected]2255a9332013-06-17 05:12:3116#include "third_party/WebKit/public/web/WebWidget.h"
danakj870925d42016-05-03 20:07:3817#include "url/gurl.h"
[email protected]79c7bed2010-09-14 22:28:3918
[email protected]180ef242013-11-07 06:50:4619namespace blink {
[email protected]9f2bed62013-03-13 11:24:4620class WebLayer;
[email protected]ed7defa2013-03-12 21:29:5921}
22
[email protected]e9ff79c2012-10-19 21:31:2623namespace content {
nickf7b38222016-11-22 21:59:3524class CompositorDependencies;
[email protected]adab2332013-07-25 18:04:3225class PepperPluginInstanceImpl;
[email protected]e9ff79c2012-10-19 21:31:2626
[email protected]79c7bed2010-09-14 22:28:3927// A RenderWidget that hosts a fullscreen pepper plugin. This provides a
28// FullscreenContainer that the plugin instance can callback into to e.g.
29// invalidate rects.
nickf7b38222016-11-22 21:59:3530class RenderWidgetFullscreenPepper : public RenderWidget,
[email protected]adab2332013-07-25 18:04:3231 public FullscreenContainer {
[email protected]79c7bed2010-09-14 22:28:3932 public:
33 static RenderWidgetFullscreenPepper* Create(
nick8331f8ad2016-11-15 20:42:4534 int32_t routing_id,
nickf7b38222016-11-22 21:59:3535 const RenderWidget::ShowCallback& show_callback,
danakj6e3bf8012014-12-16 18:27:5336 CompositorDependencies* compositor_deps,
[email protected]adab2332013-07-25 18:04:3237 PepperPluginInstanceImpl* plugin,
[email protected]bee6eb72012-07-26 03:47:3238 const GURL& active_url,
Dave Tapuska1bdf1832017-07-07 18:07:1939 const ScreenInfo& screen_info,
40 mojom::WidgetRequest widget_request);
[email protected]79c7bed2010-09-14 22:28:3941
[email protected]92abcb832011-01-06 20:39:5642 // pepper::FullscreenContainer API.
dcheng6d18e402014-10-21 12:32:5243 void Invalidate() override;
44 void InvalidateRect(const blink::WebRect& rect) override;
45 void ScrollRect(int dx, int dy, const blink::WebRect& rect) override;
46 void Destroy() override;
danakj53eccbc2016-03-02 22:51:0747 void PepperDidChangeCursor(const blink::WebCursorInfo& cursor) override;
dcheng6d18e402014-10-21 12:32:5248 void SetLayer(blink::WebLayer* layer) override;
[email protected]89054502012-06-03 10:29:2449
nickf7b38222016-11-22 21:59:3550 // RenderWidget overrides.
dcheng6d18e402014-10-21 12:32:5251 bool OnMessageReceived(const IPC::Message& msg) override;
[email protected]79c7bed2010-09-14 22:28:3952
[email protected]a16eb07e2011-10-10 05:06:5353 // Could be NULL when this widget is closing.
[email protected]adab2332013-07-25 18:04:3254 PepperPluginInstanceImpl* plugin() const { return plugin_; }
[email protected]a16eb07e2011-10-10 05:06:5355
[email protected]f032afe52012-10-22 20:24:0156 MouseLockDispatcher* mouse_lock_dispatcher() const {
57 return mouse_lock_dispatcher_.get();
58 }
59
[email protected]79c7bed2010-09-14 22:28:3960 protected:
nick8331f8ad2016-11-15 20:42:4561 RenderWidgetFullscreenPepper(int32_t routing_id,
62 CompositorDependencies* compositor_deps,
dcheng35d31c112015-07-22 00:17:3663 PepperPluginInstanceImpl* plugin,
[email protected]bee6eb72012-07-26 03:47:3264 const GURL& active_url,
Dave Tapuska1bdf1832017-07-07 18:07:1965 const ScreenInfo& screen_info,
66 mojom::WidgetRequest widget_request);
dcheng6d18e402014-10-21 12:32:5267 ~RenderWidgetFullscreenPepper() override;
[email protected]79c7bed2010-09-14 22:28:3968
69 // RenderWidget API.
dcheng6d18e402014-10-21 12:32:5270 void DidInitiatePaint() override;
dcheng6d18e402014-10-21 12:32:5271 void Close() override;
fsamuel664e8b62016-01-20 19:54:0172 void OnResize(const ResizeParams& params) override;
[email protected]79c7bed2010-09-14 22:28:3973
[email protected]65225772011-05-12 21:10:2474 // RenderWidget overrides.
dcheng6d18e402014-10-21 12:32:5275 GURL GetURLForGraphicsContext3D() override;
oshima131114a2016-02-28 05:42:5776 void OnDeviceScaleFactorChanged() override;
[email protected]65225772011-05-12 21:10:2477
[email protected]79c7bed2010-09-14 22:28:3978 private:
[email protected]d91233b7e2011-03-29 20:33:5379 // URL that is responsible for this widget, passed to ggl::CreateViewContext.
80 GURL active_url_;
81
[email protected]79c7bed2010-09-14 22:28:3982 // The plugin instance this widget wraps.
[email protected]adab2332013-07-25 18:04:3283 PepperPluginInstanceImpl* plugin_;
[email protected]79c7bed2010-09-14 22:28:3984
[email protected]180ef242013-11-07 06:50:4685 blink::WebLayer* layer_;
[email protected]22f320a2011-08-30 01:17:0086
dchengcedca5612016-04-09 01:40:1587 std::unique_ptr<MouseLockDispatcher> mouse_lock_dispatcher_;
[email protected]89054502012-06-03 10:29:2488
[email protected]79c7bed2010-09-14 22:28:3989 DISALLOW_COPY_AND_ASSIGN(RenderWidgetFullscreenPepper);
90};
91
[email protected]e9ff79c2012-10-19 21:31:2692} // namespace content
93
[email protected]2cff0052011-03-18 16:51:4494#endif // CONTENT_RENDERER_RENDER_WIDGET_FULLSCREEN_PEPPER_H_