2014-07-01 00:30:29 +02:00
|
|
|
// Copyright (c) 2014 The Chromium Embedded Framework Authors.
|
|
|
|
// Portions copyright (c) 2012 The Chromium Authors. All rights reserved.
|
|
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
2015-11-17 19:20:13 +01:00
|
|
|
#ifndef CEF_LIBCEF_BROWSER_OSR_RENDER_WIDGET_HOST_VIEW_OSR_H_
|
|
|
|
#define CEF_LIBCEF_BROWSER_OSR_RENDER_WIDGET_HOST_VIEW_OSR_H_
|
2014-07-01 00:30:29 +02:00
|
|
|
#pragma once
|
|
|
|
|
2018-07-03 02:46:03 +02:00
|
|
|
#include <map>
|
2015-08-17 21:48:57 +02:00
|
|
|
#include <set>
|
2014-07-01 00:30:29 +02:00
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
#include "include/cef_base.h"
|
|
|
|
#include "include/cef_browser.h"
|
|
|
|
|
|
|
|
#include "base/memory/weak_ptr.h"
|
2016-01-06 20:20:54 +01:00
|
|
|
#include "build/build_config.h"
|
2017-09-06 23:40:58 +02:00
|
|
|
#include "components/viz/common/frame_sinks/begin_frame_source.h"
|
2018-02-15 01:12:09 +01:00
|
|
|
#include "components/viz/common/surfaces/parent_local_surface_id_allocator.h"
|
2016-04-27 22:38:52 +02:00
|
|
|
#include "content/browser/renderer_host/delegated_frame_host.h"
|
2018-06-16 00:19:14 +02:00
|
|
|
#include "content/browser/renderer_host/input/mouse_wheel_phase_handler.h"
|
2014-07-01 00:30:29 +02:00
|
|
|
#include "content/browser/renderer_host/render_widget_host_view_base.h"
|
|
|
|
#include "ui/compositor/compositor.h"
|
2018-07-03 02:46:03 +02:00
|
|
|
#include "ui/compositor/external_begin_frame_client.h"
|
|
|
|
#include "ui/gfx/geometry/rect.h"
|
2014-07-01 00:30:29 +02:00
|
|
|
|
2015-11-17 19:20:13 +01:00
|
|
|
#if defined(OS_LINUX)
|
|
|
|
#include "ui/base/x/x11_util.h"
|
|
|
|
#endif
|
|
|
|
|
2014-09-04 19:53:40 +02:00
|
|
|
#if defined(OS_MACOSX)
|
2016-04-27 22:38:52 +02:00
|
|
|
#include "content/browser/renderer_host/browser_compositor_view_mac.h"
|
2014-09-04 19:53:40 +02:00
|
|
|
#endif
|
|
|
|
|
2014-07-01 00:30:29 +02:00
|
|
|
#if defined(OS_WIN)
|
|
|
|
#include "ui/gfx/win/window_impl.h"
|
|
|
|
#endif
|
|
|
|
|
2018-09-04 11:43:21 +02:00
|
|
|
#if defined(USE_AURA)
|
|
|
|
#include "third_party/blink/public/platform/web_cursor_info.h"
|
|
|
|
#include "ui/base/cursor/cursor.h"
|
|
|
|
#endif
|
|
|
|
|
2014-07-01 00:30:29 +02:00
|
|
|
namespace content {
|
|
|
|
class RenderWidgetHost;
|
|
|
|
class RenderWidgetHostImpl;
|
2016-10-27 17:02:56 +02:00
|
|
|
class RenderWidgetHostViewGuest;
|
2014-07-01 00:30:29 +02:00
|
|
|
class BackingStore;
|
2018-09-14 11:18:10 +02:00
|
|
|
class CursorManager;
|
2017-07-27 01:19:27 +02:00
|
|
|
} // namespace content
|
2014-07-01 00:30:29 +02:00
|
|
|
|
2015-01-01 17:51:56 +01:00
|
|
|
class CefBeginFrameTimer;
|
2014-07-01 00:30:29 +02:00
|
|
|
class CefBrowserHostImpl;
|
2015-01-01 17:51:56 +01:00
|
|
|
class CefCopyFrameGenerator;
|
|
|
|
class CefSoftwareOutputDeviceOSR;
|
2014-07-01 00:30:29 +02:00
|
|
|
class CefWebContentsViewOSR;
|
|
|
|
|
|
|
|
#if defined(OS_MACOSX)
|
|
|
|
#ifdef __OBJC__
|
2014-09-04 19:53:40 +02:00
|
|
|
@class CALayer;
|
2014-07-01 00:30:29 +02:00
|
|
|
@class NSWindow;
|
|
|
|
#else
|
2014-09-04 19:53:40 +02:00
|
|
|
class CALayer;
|
2014-07-01 00:30:29 +02:00
|
|
|
class NSWindow;
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if defined(USE_X11)
|
|
|
|
class CefWindowX11;
|
|
|
|
#endif
|
|
|
|
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
// CefRenderWidgetHostViewOSR
|
|
|
|
//
|
|
|
|
// An object representing the "View" of a rendered web page. This object is
|
|
|
|
// responsible for sending paint events to the the CefRenderHandler
|
|
|
|
// when window rendering is disabled. It is the implementation of the
|
|
|
|
// RenderWidgetHostView that the cross-platform RenderWidgetHost object uses
|
|
|
|
// to display the data.
|
|
|
|
//
|
|
|
|
// Comment excerpted from render_widget_host.h:
|
|
|
|
//
|
|
|
|
// "The lifetime of the RenderWidgetHostView is tied to the render process.
|
|
|
|
// If the render process dies, the RenderWidgetHostView goes away and all
|
|
|
|
// references to it must become NULL."
|
|
|
|
//
|
|
|
|
// RenderWidgetHostView class hierarchy described in render_widget_host_view.h.
|
|
|
|
///////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2014-09-04 19:53:40 +02:00
|
|
|
#if defined(OS_MACOSX)
|
2016-07-21 23:21:32 +02:00
|
|
|
class MacHelper;
|
2014-09-04 19:53:40 +02:00
|
|
|
#endif
|
2016-06-21 00:59:23 +02:00
|
|
|
|
2017-05-17 11:29:28 +02:00
|
|
|
class CefRenderWidgetHostViewOSR : public content::RenderWidgetHostViewBase,
|
2018-07-03 02:46:03 +02:00
|
|
|
public ui::ExternalBeginFrameClient,
|
2017-05-17 11:29:28 +02:00
|
|
|
public ui::CompositorDelegate
|
2016-07-21 23:21:32 +02:00
|
|
|
#if !defined(OS_MACOSX)
|
2017-12-07 22:44:24 +01:00
|
|
|
,
|
2018-05-21 14:54:08 +02:00
|
|
|
public content::DelegatedFrameHostClient
|
2016-07-21 23:21:32 +02:00
|
|
|
#endif
|
|
|
|
{
|
2014-07-01 00:30:29 +02:00
|
|
|
public:
|
2017-04-20 21:28:17 +02:00
|
|
|
CefRenderWidgetHostViewOSR(SkColor background_color,
|
2018-07-03 02:46:03 +02:00
|
|
|
bool use_shared_texture,
|
|
|
|
bool use_external_begin_frame,
|
2015-11-17 19:20:13 +01:00
|
|
|
content::RenderWidgetHost* widget,
|
2017-03-03 23:37:23 +01:00
|
|
|
CefRenderWidgetHostViewOSR* parent_host_view,
|
|
|
|
bool is_guest_view_hack);
|
2014-11-12 20:25:15 +01:00
|
|
|
~CefRenderWidgetHostViewOSR() override;
|
2014-07-01 00:30:29 +02:00
|
|
|
|
|
|
|
// RenderWidgetHostView implementation.
|
2014-11-12 20:25:15 +01:00
|
|
|
void InitAsChild(gfx::NativeView parent_view) override;
|
|
|
|
void SetSize(const gfx::Size& size) override;
|
|
|
|
void SetBounds(const gfx::Rect& rect) override;
|
|
|
|
gfx::NativeView GetNativeView() const override;
|
|
|
|
gfx::NativeViewAccessible GetNativeViewAccessible() override;
|
|
|
|
void Focus() override;
|
|
|
|
bool HasFocus() const override;
|
2018-05-16 11:28:49 +02:00
|
|
|
uint32_t GetCaptureSequenceNumber() const override;
|
2014-11-12 20:25:15 +01:00
|
|
|
bool IsSurfaceAvailableForCopy() const override;
|
|
|
|
void Show() override;
|
|
|
|
void Hide() override;
|
|
|
|
bool IsShowing() override;
|
2018-05-16 11:28:49 +02:00
|
|
|
void EnsureSurfaceSynchronizedForLayoutTest() override;
|
2014-11-12 20:25:15 +01:00
|
|
|
gfx::Rect GetViewBounds() const override;
|
|
|
|
void SetBackgroundColor(SkColor color) override;
|
2018-05-21 14:54:08 +02:00
|
|
|
base::Optional<SkColor> GetBackgroundColor() const override;
|
|
|
|
void UpdateBackgroundColor() override;
|
2014-11-12 20:25:15 +01:00
|
|
|
bool LockMouse() override;
|
|
|
|
void UnlockMouse() override;
|
2018-04-19 17:44:42 +02:00
|
|
|
void TakeFallbackContentFrom(content::RenderWidgetHostView* view) override;
|
2014-07-01 00:30:29 +02:00
|
|
|
|
|
|
|
#if defined(OS_MACOSX)
|
2014-11-12 20:25:15 +01:00
|
|
|
void SetActive(bool active) override;
|
|
|
|
void ShowDefinitionForSelection() override;
|
|
|
|
void SpeakSelection() override;
|
2018-03-20 21:15:08 +01:00
|
|
|
bool ShouldContinueToPauseForFrame() override;
|
2014-07-01 00:30:29 +02:00
|
|
|
#endif // defined(OS_MACOSX)
|
|
|
|
|
|
|
|
// RenderWidgetHostViewBase implementation.
|
2017-04-20 21:28:17 +02:00
|
|
|
void DidCreateNewRendererCompositorFrameSink(
|
2017-09-06 23:40:58 +02:00
|
|
|
viz::mojom::CompositorFrameSinkClient* renderer_compositor_frame_sink)
|
2017-05-17 11:29:28 +02:00
|
|
|
override;
|
2017-12-07 22:44:24 +01:00
|
|
|
void SubmitCompositorFrame(
|
|
|
|
const viz::LocalSurfaceId& local_surface_id,
|
|
|
|
viz::CompositorFrame frame,
|
2018-06-01 21:16:26 +02:00
|
|
|
base::Optional<viz::HitTestRegionList> hit_test_region_list) override;
|
2015-10-09 17:23:12 +02:00
|
|
|
void ClearCompositorFrame() override;
|
2018-09-04 11:43:21 +02:00
|
|
|
void ResetFallbackToFirstNavigationSurface() override;
|
2014-11-12 20:25:15 +01:00
|
|
|
void InitAsPopup(content::RenderWidgetHostView* parent_host_view,
|
|
|
|
const gfx::Rect& pos) override;
|
|
|
|
void InitAsFullscreen(
|
|
|
|
content::RenderWidgetHostView* reference_host_view) override;
|
2017-02-10 23:44:11 +01:00
|
|
|
void InitAsGuest(content::RenderWidgetHostView* parent_host_view,
|
|
|
|
content::RenderWidgetHostViewGuest* guest_view) override;
|
2014-11-12 20:25:15 +01:00
|
|
|
void UpdateCursor(const content::WebCursor& cursor) override;
|
|
|
|
void SetIsLoading(bool is_loading) override;
|
|
|
|
void RenderProcessGone(base::TerminationStatus status,
|
|
|
|
int error_code) override;
|
|
|
|
void Destroy() override;
|
|
|
|
void SetTooltipText(const base::string16& tooltip_text) override;
|
2018-09-14 11:18:10 +02:00
|
|
|
content::CursorManager* GetCursorManager() override;
|
2015-10-09 17:23:12 +02:00
|
|
|
|
2018-04-19 17:44:42 +02:00
|
|
|
gfx::Size GetCompositorViewportPixelSize() const override;
|
2018-03-20 21:15:08 +01:00
|
|
|
void CopyFromSurface(
|
|
|
|
const gfx::Rect& src_rect,
|
|
|
|
const gfx::Size& output_size,
|
|
|
|
base::OnceCallback<void(const SkBitmap&)> callback) override;
|
|
|
|
void GetScreenInfo(content::ScreenInfo* results) const override;
|
2018-07-24 00:32:02 +02:00
|
|
|
void TransformPointToRootSurface(gfx::PointF* point) override;
|
2014-11-12 20:25:15 +01:00
|
|
|
gfx::Rect GetBoundsInRootWindow() override;
|
2018-07-25 22:55:11 +02:00
|
|
|
#if defined(OS_MACOSX)
|
|
|
|
viz::ScopedSurfaceIdAllocator DidUpdateVisualProperties(
|
|
|
|
const cc::RenderFrameMetadata& metadata) override;
|
|
|
|
#endif
|
2018-02-15 01:12:09 +01:00
|
|
|
viz::SurfaceId GetCurrentSurfaceId() const override;
|
2017-05-17 11:29:28 +02:00
|
|
|
content::BrowserAccessibilityManager* CreateBrowserAccessibilityManager(
|
|
|
|
content::BrowserAccessibilityDelegate* delegate,
|
|
|
|
bool for_root_frame) override;
|
2014-07-01 00:30:29 +02:00
|
|
|
|
2014-11-12 20:25:15 +01:00
|
|
|
void ImeCompositionRangeChanged(
|
2014-07-01 00:30:29 +02:00
|
|
|
const gfx::Range& range,
|
2014-11-12 20:25:15 +01:00
|
|
|
const std::vector<gfx::Rect>& character_bounds) override;
|
2014-07-01 00:30:29 +02:00
|
|
|
|
2016-08-31 13:25:56 +02:00
|
|
|
void SetNeedsBeginFrames(bool enabled) override;
|
2018-02-15 01:12:09 +01:00
|
|
|
void SetWantsAnimateOnlyBeginFrames() override;
|
2015-01-01 17:51:56 +01:00
|
|
|
|
2018-05-20 15:51:42 +02:00
|
|
|
bool TransformPointToLocalCoordSpaceLegacy(
|
|
|
|
const gfx::PointF& point,
|
|
|
|
const viz::SurfaceId& original_surface,
|
|
|
|
gfx::PointF* transformed_point) override;
|
2017-03-03 23:37:23 +01:00
|
|
|
bool TransformPointToCoordSpaceForView(
|
2017-12-07 22:44:24 +01:00
|
|
|
const gfx::PointF& point,
|
2017-03-03 23:37:23 +01:00
|
|
|
RenderWidgetHostViewBase* target_view,
|
2018-05-20 15:51:42 +02:00
|
|
|
gfx::PointF* transformed_point,
|
|
|
|
viz::EventSource source = viz::EventSource::ANY) override;
|
2018-03-20 21:15:08 +01:00
|
|
|
void DidNavigate() override;
|
2017-03-03 23:37:23 +01:00
|
|
|
|
2018-04-09 19:48:23 +02:00
|
|
|
void SelectionChanged(const base::string16& text,
|
|
|
|
size_t offset,
|
|
|
|
const gfx::Range& range) override;
|
|
|
|
|
2018-07-24 00:32:02 +02:00
|
|
|
const viz::LocalSurfaceId& GetLocalSurfaceId() const override;
|
|
|
|
const viz::FrameSinkId& GetFrameSinkId() const override;
|
2018-05-31 22:34:44 +02:00
|
|
|
|
2018-07-03 02:46:03 +02:00
|
|
|
// ui::ExternalBeginFrameClient implementation:
|
|
|
|
void OnDisplayDidFinishFrame(const viz::BeginFrameAck& ack) override;
|
|
|
|
void OnNeedsExternalBeginFrames(bool needs_begin_frames) override;
|
|
|
|
|
2015-01-01 17:51:56 +01:00
|
|
|
// ui::CompositorDelegate implementation.
|
2017-10-20 19:45:20 +02:00
|
|
|
std::unique_ptr<viz::SoftwareOutputDevice> CreateSoftwareOutputDevice(
|
2015-01-01 17:51:56 +01:00
|
|
|
ui::Compositor* compositor) override;
|
|
|
|
|
2016-07-21 23:21:32 +02:00
|
|
|
#if !defined(OS_MACOSX)
|
2014-09-04 19:53:40 +02:00
|
|
|
// DelegatedFrameHostClient implementation.
|
2015-02-04 19:10:14 +01:00
|
|
|
ui::Layer* DelegatedFrameHostGetLayer() const override;
|
|
|
|
bool DelegatedFrameHostIsVisible() const override;
|
2018-02-15 01:12:09 +01:00
|
|
|
SkColor DelegatedFrameHostGetGutterColor() const override;
|
2018-03-20 21:15:08 +01:00
|
|
|
void OnFirstSurfaceActivation(const viz::SurfaceInfo& surface_info) override;
|
2018-02-15 01:12:09 +01:00
|
|
|
void OnBeginFrame(base::TimeTicks frame_time) override;
|
2017-12-07 22:44:24 +01:00
|
|
|
void OnFrameTokenChanged(uint32_t frame_token) override;
|
2016-07-21 23:21:32 +02:00
|
|
|
#endif // !defined(OS_MACOSX)
|
2014-07-01 00:30:29 +02:00
|
|
|
|
|
|
|
bool InstallTransparency();
|
|
|
|
|
2018-05-17 10:58:21 +02:00
|
|
|
void SynchronizeVisualProperties();
|
2014-07-01 00:30:29 +02:00
|
|
|
void OnScreenInfoChanged();
|
|
|
|
void Invalidate(CefBrowserHost::PaintElementType type);
|
2018-07-03 02:46:03 +02:00
|
|
|
void SendExternalBeginFrame();
|
2014-07-01 00:30:29 +02:00
|
|
|
void SendKeyEvent(const content::NativeWebKeyboardEvent& event);
|
|
|
|
void SendMouseEvent(const blink::WebMouseEvent& event);
|
|
|
|
void SendMouseWheelEvent(const blink::WebMouseWheelEvent& event);
|
|
|
|
void SendFocusEvent(bool focus);
|
2015-05-13 17:43:50 +02:00
|
|
|
void UpdateFrameRate();
|
2014-07-01 00:30:29 +02:00
|
|
|
|
|
|
|
void HoldResize();
|
|
|
|
void ReleaseResize();
|
|
|
|
|
2015-01-01 17:51:56 +01:00
|
|
|
void OnPaint(const gfx::Rect& damage_rect,
|
|
|
|
int bitmap_width,
|
|
|
|
int bitmap_height,
|
|
|
|
void* bitmap_pixels);
|
|
|
|
|
2017-05-17 11:29:28 +02:00
|
|
|
bool IsPopupWidget() const { return popup_type_ != blink::kWebPopupTypeNone; }
|
2014-07-01 00:30:29 +02:00
|
|
|
|
2017-05-17 11:29:28 +02:00
|
|
|
void ImeSetComposition(const CefString& text,
|
|
|
|
const std::vector<CefCompositionUnderline>& underlines,
|
|
|
|
const CefRange& replacement_range,
|
|
|
|
const CefRange& selection_range);
|
2016-10-28 18:11:24 +02:00
|
|
|
void ImeCommitText(const CefString& text,
|
|
|
|
const CefRange& replacement_range,
|
|
|
|
int relative_cursor_pos);
|
|
|
|
void ImeFinishComposingText(bool keep_selection);
|
2018-05-21 14:54:08 +02:00
|
|
|
void ImeCancelComposition() override;
|
2014-07-01 00:30:29 +02:00
|
|
|
|
|
|
|
CefRefPtr<CefBrowserHostImpl> browser_impl() const { return browser_impl_; }
|
|
|
|
void set_browser_impl(CefRefPtr<CefBrowserHostImpl> browser) {
|
|
|
|
browser_impl_ = browser;
|
|
|
|
}
|
|
|
|
|
|
|
|
void set_popup_host_view(CefRenderWidgetHostViewOSR* popup_view) {
|
|
|
|
popup_host_view_ = popup_view;
|
|
|
|
}
|
2015-06-11 17:00:05 +02:00
|
|
|
void set_child_host_view(CefRenderWidgetHostViewOSR* popup_view) {
|
|
|
|
child_host_view_ = popup_view;
|
|
|
|
}
|
2014-07-01 00:30:29 +02:00
|
|
|
|
2016-07-06 21:34:09 +02:00
|
|
|
ui::Compositor* GetCompositor() const;
|
2017-05-17 11:29:28 +02:00
|
|
|
content::RenderWidgetHostImpl* render_widget_host() const {
|
|
|
|
return render_widget_host_;
|
|
|
|
}
|
2016-07-21 23:21:32 +02:00
|
|
|
ui::Layer* GetRootLayer() const;
|
2014-07-01 00:30:29 +02:00
|
|
|
|
2018-07-24 00:32:02 +02:00
|
|
|
#if defined(OS_MACOSX)
|
|
|
|
content::BrowserCompositorMac* browser_compositor() const {
|
|
|
|
return browser_compositor_.get();
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2018-07-03 02:46:03 +02:00
|
|
|
void OnPresentCompositorFrame(uint32_t presentation_token);
|
|
|
|
|
2014-07-01 00:30:29 +02:00
|
|
|
private:
|
2016-07-06 21:34:09 +02:00
|
|
|
content::DelegatedFrameHost* GetDelegatedFrameHost() const;
|
|
|
|
|
2014-07-01 00:30:29 +02:00
|
|
|
void SetFrameRate();
|
2015-01-01 17:51:56 +01:00
|
|
|
void SetDeviceScaleFactor();
|
2018-05-20 15:51:42 +02:00
|
|
|
void ResizeRootLayer(bool force);
|
2014-07-01 00:30:29 +02:00
|
|
|
|
2015-01-01 17:51:56 +01:00
|
|
|
// Called by CefBeginFrameTimer to send a BeginFrame request.
|
|
|
|
void OnBeginFrameTimerTick();
|
2017-05-17 11:29:28 +02:00
|
|
|
void SendBeginFrame(base::TimeTicks frame_time, base::TimeDelta vsync_period);
|
2014-07-01 00:30:29 +02:00
|
|
|
|
2015-08-17 21:48:57 +02:00
|
|
|
void CancelWidget();
|
2014-07-01 00:30:29 +02:00
|
|
|
|
2014-09-27 01:48:19 +02:00
|
|
|
void OnScrollOffsetChanged();
|
|
|
|
|
2017-02-10 23:44:11 +01:00
|
|
|
void AddGuestHostView(CefRenderWidgetHostViewOSR* guest_host);
|
|
|
|
void RemoveGuestHostView(CefRenderWidgetHostViewOSR* guest_host);
|
|
|
|
|
|
|
|
// Register a callback that will be executed when |guest_host_view| receives
|
|
|
|
// OnSwapCompositorFrame. The callback triggers repaint of the embedder view.
|
|
|
|
void RegisterGuestViewFrameSwappedCallback(
|
|
|
|
content::RenderWidgetHostViewGuest* guest_host_view);
|
|
|
|
|
2016-10-27 17:02:56 +02:00
|
|
|
void OnGuestViewFrameSwapped(
|
|
|
|
content::RenderWidgetHostViewGuest* guest_host_view);
|
|
|
|
|
|
|
|
void InvalidateInternal(const gfx::Rect& bounds_in_pixels);
|
|
|
|
|
2016-10-28 18:11:24 +02:00
|
|
|
void RequestImeCompositionUpdate(bool start_monitoring);
|
|
|
|
|
2017-07-27 01:19:27 +02:00
|
|
|
viz::FrameSinkId AllocateFrameSinkId(bool is_guest_view_hack);
|
2017-03-03 23:37:23 +01:00
|
|
|
|
2018-07-03 02:46:03 +02:00
|
|
|
void AddDamageRect(uint32_t presentation_token, const gfx::Rect& rect);
|
|
|
|
|
2017-04-20 21:28:17 +02:00
|
|
|
// Applies background color without notifying the RenderWidget about
|
|
|
|
// opaqueness changes.
|
|
|
|
void UpdateBackgroundColorFromRenderer(SkColor color);
|
|
|
|
|
2014-07-01 00:30:29 +02:00
|
|
|
#if defined(OS_MACOSX)
|
2018-07-25 22:55:11 +02:00
|
|
|
display::Display GetDisplay();
|
|
|
|
void OnDidUpdateVisualPropertiesComplete(
|
|
|
|
const cc::RenderFrameMetadata& metadata);
|
|
|
|
|
2016-07-21 23:21:32 +02:00
|
|
|
friend class MacHelper;
|
2018-04-19 17:44:42 +02:00
|
|
|
bool UpdateNSViewAndDisplay();
|
|
|
|
#endif // defined(OS_MACOSX)
|
|
|
|
|
2017-03-03 23:37:23 +01:00
|
|
|
void PlatformCreateCompositorWidget(bool is_guest_view_hack);
|
2018-05-31 22:34:44 +02:00
|
|
|
#if !defined(OS_MACOSX)
|
2016-08-17 17:29:38 +02:00
|
|
|
void PlatformResizeCompositorWidget(const gfx::Size& size);
|
2018-05-31 22:34:44 +02:00
|
|
|
#endif
|
2014-07-01 00:30:29 +02:00
|
|
|
void PlatformDestroyCompositorWidget();
|
|
|
|
|
2015-11-17 19:20:13 +01:00
|
|
|
#if defined(USE_AURA)
|
|
|
|
ui::PlatformCursor GetPlatformCursor(blink::WebCursorInfo::Type type);
|
|
|
|
#endif
|
|
|
|
|
2017-04-20 21:28:17 +02:00
|
|
|
// The background color of the web content.
|
|
|
|
SkColor background_color_;
|
2015-11-17 19:20:13 +01:00
|
|
|
|
2016-11-23 18:26:50 +01:00
|
|
|
int frame_rate_threshold_us_;
|
2015-01-01 17:51:56 +01:00
|
|
|
|
2016-07-06 21:34:09 +02:00
|
|
|
#if !defined(OS_MACOSX)
|
2016-04-27 22:38:52 +02:00
|
|
|
std::unique_ptr<ui::Compositor> compositor_;
|
2014-07-01 00:30:29 +02:00
|
|
|
gfx::AcceleratedWidget compositor_widget_;
|
2016-07-06 21:34:09 +02:00
|
|
|
std::unique_ptr<content::DelegatedFrameHost> delegated_frame_host_;
|
2016-04-27 22:38:52 +02:00
|
|
|
std::unique_ptr<ui::Layer> root_layer_;
|
2017-10-20 19:45:20 +02:00
|
|
|
viz::LocalSurfaceId local_surface_id_;
|
2018-02-15 01:12:09 +01:00
|
|
|
viz::ParentLocalSurfaceIdAllocator local_surface_id_allocator_;
|
2018-05-31 22:34:44 +02:00
|
|
|
#endif
|
2017-10-20 19:45:20 +02:00
|
|
|
|
2014-07-01 00:30:29 +02:00
|
|
|
#if defined(OS_WIN)
|
2016-04-27 22:38:52 +02:00
|
|
|
std::unique_ptr<gfx::WindowImpl> window_;
|
2014-07-01 00:30:29 +02:00
|
|
|
#elif defined(OS_MACOSX)
|
|
|
|
NSWindow* window_;
|
2014-09-04 19:53:40 +02:00
|
|
|
CALayer* background_layer_;
|
2016-04-27 22:38:52 +02:00
|
|
|
std::unique_ptr<content::BrowserCompositorMac> browser_compositor_;
|
2016-07-21 23:21:32 +02:00
|
|
|
MacHelper* mac_helper_;
|
2014-07-01 00:30:29 +02:00
|
|
|
#elif defined(USE_X11)
|
|
|
|
CefWindowX11* window_;
|
2016-04-27 22:38:52 +02:00
|
|
|
std::unique_ptr<ui::XScopedCursor> invisible_cursor_;
|
2014-07-01 00:30:29 +02:00
|
|
|
#endif
|
|
|
|
|
2018-09-14 11:18:10 +02:00
|
|
|
std::unique_ptr<content::CursorManager> cursor_manager_;
|
|
|
|
|
2015-01-01 17:51:56 +01:00
|
|
|
// Used to control the VSync rate in subprocesses when BeginFrame scheduling
|
|
|
|
// is enabled.
|
2016-04-27 22:38:52 +02:00
|
|
|
std::unique_ptr<CefBeginFrameTimer> begin_frame_timer_;
|
2015-01-01 17:51:56 +01:00
|
|
|
|
2017-01-23 18:36:54 +01:00
|
|
|
// Provides |source_id| for BeginFrameArgs that we create.
|
2017-09-06 23:40:58 +02:00
|
|
|
viz::StubBeginFrameSource begin_frame_source_;
|
|
|
|
uint64_t begin_frame_number_ = viz::BeginFrameArgs::kStartingFrameNumber;
|
2017-01-23 18:36:54 +01:00
|
|
|
|
2018-07-03 02:46:03 +02:00
|
|
|
bool sync_frame_rate_ = false;
|
|
|
|
bool external_begin_frame_enabled_ = false;
|
|
|
|
bool needs_external_begin_frames_ = false;
|
|
|
|
|
2015-01-01 17:51:56 +01:00
|
|
|
// Used for direct rendering from the compositor when GPU compositing is
|
|
|
|
// disabled. This object is owned by the compositor.
|
|
|
|
CefSoftwareOutputDeviceOSR* software_output_device_;
|
|
|
|
|
|
|
|
// Used for managing copy requests when GPU compositing is enabled.
|
2016-04-27 22:38:52 +02:00
|
|
|
std::unique_ptr<CefCopyFrameGenerator> copy_frame_generator_;
|
2014-07-01 00:30:29 +02:00
|
|
|
|
|
|
|
bool hold_resize_;
|
|
|
|
bool pending_resize_;
|
|
|
|
|
|
|
|
// The associated Model. While |this| is being Destroyed,
|
|
|
|
// |render_widget_host_| is NULL and the message loop is run one last time
|
|
|
|
// Message handlers must check for a NULL |render_widget_host_|.
|
|
|
|
content::RenderWidgetHostImpl* render_widget_host_;
|
2015-06-11 17:00:05 +02:00
|
|
|
|
|
|
|
bool has_parent_;
|
2014-07-01 00:30:29 +02:00
|
|
|
CefRenderWidgetHostViewOSR* parent_host_view_;
|
|
|
|
CefRenderWidgetHostViewOSR* popup_host_view_;
|
2015-06-11 17:00:05 +02:00
|
|
|
CefRenderWidgetHostViewOSR* child_host_view_;
|
2015-08-17 21:48:57 +02:00
|
|
|
std::set<CefRenderWidgetHostViewOSR*> guest_host_views_;
|
2014-07-01 00:30:29 +02:00
|
|
|
|
|
|
|
CefRefPtr<CefBrowserHostImpl> browser_impl_;
|
|
|
|
|
|
|
|
bool is_showing_;
|
|
|
|
bool is_destroyed_;
|
|
|
|
gfx::Rect popup_position_;
|
2018-07-03 02:46:03 +02:00
|
|
|
uint32_t presentation_token_ = 0;
|
|
|
|
base::Lock damage_rect_lock_;
|
|
|
|
std::map<uint32_t, gfx::Rect> damage_rects_;
|
2014-07-01 00:30:29 +02:00
|
|
|
|
2014-09-27 01:48:19 +02:00
|
|
|
// The last scroll offset of the view.
|
|
|
|
gfx::Vector2dF last_scroll_offset_;
|
|
|
|
bool is_scroll_offset_changed_pending_;
|
|
|
|
|
2018-06-16 00:19:14 +02:00
|
|
|
content::MouseWheelPhaseHandler mouse_wheel_phase_handler_;
|
|
|
|
|
2018-07-03 02:46:03 +02:00
|
|
|
std::unique_ptr<viz::mojom::CompositorFrameSinkClient>
|
|
|
|
renderer_compositor_frame_sink_;
|
2017-04-20 21:28:17 +02:00
|
|
|
|
2018-05-16 11:28:49 +02:00
|
|
|
// Latest capture sequence number which is incremented when the caller
|
|
|
|
// requests surfaces be synchronized via
|
|
|
|
// EnsureSurfaceSynchronizedForLayoutTest().
|
|
|
|
uint32_t latest_capture_sequence_number_ = 0u;
|
|
|
|
|
2014-07-01 00:30:29 +02:00
|
|
|
base::WeakPtrFactory<CefRenderWidgetHostViewOSR> weak_ptr_factory_;
|
|
|
|
|
|
|
|
DISALLOW_COPY_AND_ASSIGN(CefRenderWidgetHostViewOSR);
|
|
|
|
};
|
|
|
|
|
2015-11-17 19:20:13 +01:00
|
|
|
#endif // CEF_LIBCEF_BROWSER_OSR_RENDER_WIDGET_HOST_VIEW_OSR_H_
|