Commit 781907a9 authored by Dave Tapuska's avatar Dave Tapuska Committed by Commit Bot

Move SetDisplayMode on UpdateVisualProperties into blink.

SetDisplayMode was only overridden by frame widgets, move the
implementation into WebFrameWidgetBase.

BUG=1097816

Change-Id: I1a097cdd20bbabb589adbfcbc51f3516bb0c79e5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2314978
Commit-Queue: Dave Tapuska <dtapuska@chromium.org>
Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/master@{#792908}
parent d267683e
......@@ -547,13 +547,6 @@ void RenderWidget::UpdateVisualProperties(
visual_properties.screen_info.color_space);
}
// TODO(danakj): In order to synchronize updates between local roots, the
// display mode should be propagated to RenderFrameProxies and down through
// their RenderWidgetHosts to child RenderWidgets via the VisualProperties
// waterfall, instead of coming to each RenderWidget independently.
// https://developer.mozilla.org/en-US/docs/Web/CSS/@media/display-mode
GetWebWidget()->SetDisplayMode(visual_properties.display_mode);
if (delegate()) {
if (size_ != visual_properties.new_size) {
// Only hide popups when the size changes. Eg https://crbug.com/761908.
......
......@@ -167,10 +167,6 @@ class WebWidget {
// Returns the state of focus for the WebWidget.
virtual bool HasFocus() { return false; }
// Sets the display mode, which comes from the top-level browsing context and
// is applied to all widgets.
virtual void SetDisplayMode(mojom::DisplayMode) {}
// Sets the root widget's window segments.
virtual void SetWindowSegments(WebVector<WebRect> window_segments) {}
......
......@@ -573,6 +573,15 @@ bool WebFrameWidgetBase::ShouldAckSyntheticInputImmediately() {
void WebFrameWidgetBase::UpdateVisualProperties(
const VisualProperties& visual_properties) {
SetZoomLevel(visual_properties.zoom_level);
// TODO(danakj): In order to synchronize updates between local roots, the
// display mode should be propagated to RenderFrameProxies and down through
// their RenderWidgetHosts to child WebFrameWidgetBase via the
// VisualProperties waterfall, instead of coming to each WebFrameWidgetBase
// independently.
// https://developer.mozilla.org/en-US/docs/Web/CSS/@media/display-mode
SetDisplayMode(visual_properties.display_mode);
Client()->UpdateVisualProperties(visual_properties);
}
......
......@@ -273,7 +273,6 @@ class CORE_EXPORT WebFrameWidgetBase
void DidNotAcquirePointerLock() override;
void DidLosePointerLock() override;
void SetCompositorVisible(bool visible) override;
void SetDisplayMode(mojom::blink::DisplayMode) override;
void SetWindowSegments(WebVector<WebRect> window_segments) override;
void SetCursor(const ui::Cursor& cursor) override;
bool HandlingInputEvent() override;
......@@ -380,6 +379,10 @@ class CORE_EXPORT WebFrameWidgetBase
GetStringAtPointCallback callback) override;
#endif
// Sets the display mode, which comes from the top-level browsing context and
// is applied to all widgets.
void SetDisplayMode(mojom::blink::DisplayMode);
base::Optional<gfx::Point> GetAndResetContextMenuLocation();
// Called when the FrameView for this Widget's local root is created.
......
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