Commit 660e8283 authored by slangley's avatar slangley Committed by Commit bot

Move WebViewFrameWidget to use WebViewBase rather than WebViewImpl.

We WebViewFrameWidget keeps a RefPtr to WebViewImpl we need to make WebViewBase
ref counted. Removed the ref counted from WebViewImpl when moving it to
WebViewBase.

BUG=712963

Review-Url: https://codereview.chromium.org/2850113002
Cr-Commit-Position: refs/heads/master@{#468310}
parent 51b20818
......@@ -6,6 +6,7 @@
#define WebViewBase_h
#include "platform/transforms/TransformationMatrix.h"
#include "platform/wtf/RefCounted.h"
#include "public/platform/WebDisplayMode.h"
#include "public/platform/WebInputEventResult.h"
#include "public/web/WebElement.h"
......@@ -13,18 +14,24 @@
namespace blink {
class AnimationWorkletProxyClient;
class CompositorAnimationHost;
class CompositorWorkerProxyClient;
class CompositorAnimationTimeline;
class ContextMenuProvider;
class DevToolsEmulator;
class Frame;
class GraphicsLayer;
class HitTestResult;
class Page;
class PaintLayerCompositor;
class PagePopup;
class PagePopupClient;
class PageScaleConstraintsSet;
class WebInputEvent;
class WebInputMethodControllerImpl;
class WebKeyboardEvent;
class WebLayer;
class WebLocalFrameImpl;
class WebLayerTreeView;
class WebPagePopupImpl;
......@@ -38,8 +45,10 @@ struct WebRect;
//
// Once WebViewImpl is moved from web to core/exported then this class should be
// removed and clients can once again depend on WebViewImpl.
class WebViewBase : public WebView {
class WebViewBase : public WebView, public RefCounted<WebViewBase> {
public:
virtual ~WebViewBase() {}
virtual void SetBaseBackgroundColor(WebColor) = 0;
virtual void SetBaseBackgroundColorOverride(WebColor) = 0;
virtual void ClearBaseBackgroundColorOverride() = 0;
......@@ -146,6 +155,24 @@ class WebViewBase : public WebView {
virtual double LastFrameTimeMonotonic() const = 0;
static const WebInputEvent* CurrentInputEvent();
virtual void SetCompositorVisibility(bool) = 0;
using WebWidget::SetSuppressFrameRequestsWorkaroundFor704763Only;
using WebWidget::RecordWheelAndTouchScrollingCount;
using WebWidget::GetCompositionCharacterBounds;
// Returns the currently active WebInputMethodController which is the one
// corresponding to the focused frame. It will return nullptr if there is no
// focused frame, or if there is one but it belongs to a different local
// root.
virtual WebInputMethodControllerImpl* GetActiveWebInputMethodController()
const = 0;
virtual void ScheduleAnimationForWidget() = 0;
virtual CompositorWorkerProxyClient* CreateCompositorWorkerProxyClient() = 0;
virtual AnimationWorkletProxyClient* CreateAnimationWorkletProxyClient() = 0;
virtual void SetRootGraphicsLayer(GraphicsLayer*) = 0;
virtual void SetRootLayer(WebLayer*) = 0;
virtual CompositorAnimationHost* AnimationHost() const = 0;
virtual HitTestResult CoreHitTestResultAt(const WebPoint&) = 0;
};
}
......
......@@ -4,14 +4,15 @@
#include "web/WebViewFrameWidget.h"
#include "core/exported/WebViewBase.h"
#include "core/layout/HitTestResult.h"
#include "web/WebInputMethodControllerImpl.h"
#include "web/WebLocalFrameImpl.h"
#include "web/WebViewImpl.h"
namespace blink {
WebViewFrameWidget::WebViewFrameWidget(WebWidgetClient& client,
WebViewImpl& web_view,
WebViewBase& web_view,
WebLocalFrameImpl& main_frame)
: client_(&client), web_view_(&web_view), main_frame_(&main_frame) {
main_frame_->SetFrameWidget(this);
......
......@@ -14,7 +14,7 @@
namespace blink {
class WebViewImpl;
class WebViewBase;
class WebWidgetClient;
// Shim class to help normalize the widget interfaces in the Blink public API.
......@@ -28,7 +28,7 @@ class WebWidgetClient;
// and just forwards almost everything to it.
// After the embedder starts using a WebFrameWidget for the main frame,
// WebView will be updated to no longer inherit WebWidget. The eventual goal is
// to unfork the widget code duplicated in WebFrameWidgetImpl and WebViewImpl
// to unfork the widget code duplicated in WebFrameWidgetImpl and WebViewBase
// into one class.
// A more detailed writeup of this transition can be read at
// https://goo.gl/7yVrnb.
......@@ -37,7 +37,7 @@ class WebViewFrameWidget : public WebFrameWidgetBase {
public:
explicit WebViewFrameWidget(WebWidgetClient&,
WebViewImpl&,
WebViewBase&,
WebLocalFrameImpl&);
virtual ~WebViewFrameWidget();
......@@ -109,7 +109,7 @@ class WebViewFrameWidget : public WebFrameWidgetBase {
private:
WebWidgetClient* client_;
RefPtr<WebViewImpl> web_view_;
RefPtr<WebViewBase> web_view_;
Persistent<WebLocalFrameImpl> main_frame_;
};
......
......@@ -44,7 +44,6 @@
#include "platform/scheduler/child/web_scheduler.h"
#include "platform/wtf/Compiler.h"
#include "platform/wtf/HashSet.h"
#include "platform/wtf/RefCounted.h"
#include "platform/wtf/Vector.h"
#include "public/platform/WebDisplayMode.h"
#include "public/platform/WebFloatSize.h"
......@@ -98,7 +97,6 @@ class WebViewScheduler;
class WEB_EXPORT WebViewImpl final
: NON_EXPORTED_BASE(public WebViewBase),
public RefCounted<WebViewImpl>,
NON_EXPORTED_BASE(public WebGestureCurveTarget),
public PageWidgetEventHandler,
public WebScheduler::InterventionReporter,
......@@ -267,7 +265,7 @@ class WEB_EXPORT WebViewImpl final
float ClampPageScaleFactorToLimits(float) const override;
void ResetScaleStateImmediately() override;
HitTestResult CoreHitTestResultAt(const WebPoint&);
HitTestResult CoreHitTestResultAt(const WebPoint&) override;
void InvalidateRect(const IntRect&) override;
void SetBaseBackgroundColor(WebColor) override;
......@@ -462,7 +460,7 @@ class WEB_EXPORT WebViewImpl final
WebRect ComputeBlockBound(const WebPoint&, bool ignore_clipping);
WebLayerTreeView* LayerTreeView() const override { return layer_tree_view_; }
CompositorAnimationHost* AnimationHost() const {
CompositorAnimationHost* AnimationHost() const override {
return animation_host_.get();
}
......@@ -482,8 +480,8 @@ class WEB_EXPORT WebViewImpl final
void ForceNextWebGLContextCreationToFail() override;
void ForceNextDrawingBufferCreationToFail() override;
CompositorWorkerProxyClient* CreateCompositorWorkerProxyClient();
AnimationWorkletProxyClient* CreateAnimationWorkletProxyClient();
CompositorWorkerProxyClient* CreateCompositorWorkerProxyClient() override;
AnimationWorkletProxyClient* CreateAnimationWorkletProxyClient() override;
IntSize MainFrameSize() override;
WebDisplayMode DisplayMode() const override { return display_mode_; }
......@@ -529,10 +527,10 @@ class WEB_EXPORT WebViewImpl final
// Overrides the compositor visibility. See the description of
// m_overrideCompositorVisibility for more details.
void SetCompositorVisibility(bool);
void SetCompositorVisibility(bool) override;
// TODO(lfg): Remove once WebViewFrameWidget is deleted.
void ScheduleAnimationForWidget();
void ScheduleAnimationForWidget() override;
bool GetCompositionCharacterBounds(WebVector<WebRect>&) override;
void UpdateBaseBackgroundColor();
......@@ -594,8 +592,8 @@ class WEB_EXPORT WebViewImpl final
float DeviceScaleFactor() const;
void SetRootGraphicsLayer(GraphicsLayer*);
void SetRootLayer(WebLayer*);
void SetRootGraphicsLayer(GraphicsLayer*) override;
void SetRootLayer(WebLayer*) override;
void AttachCompositorAnimationTimeline(CompositorAnimationTimeline*);
void DetachCompositorAnimationTimeline(CompositorAnimationTimeline*);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment