Commit 995c17f2 authored by Erik Chen's avatar Erik Chen Committed by Commit Bot

RenderViewImpl should directly call WebViewImpl::Resize

The redirect through MainFrameWidget was incorrect -- size is a WebViewImpl
property and should be directly set.

Bug: 995981
Change-Id: Ic57d7f890fefc4220de02d06d5b883ab9bb64398
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1774017Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
Commit-Queue: Erik Chen <erikchen@chromium.org>
Auto-Submit: Erik Chen <erikchen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#691729}
parent b3818ab2
......@@ -2016,17 +2016,7 @@ void RenderViewImpl::OnUpdatePageVisualProperties(
device_scale_factor_scaled_visual_viewport_size = gfx::ScaleToCeiledSize(
viewport_size, GetScreenInfo().device_scale_factor);
}
// TODO(wjmaclean): At present this makes use of the WebWidget part of
// WebViewImpl in order to be able to re-size the view
// without having to plumb through the browser-controls state. When
// WebViewImpl is no longer a WebWidget, then we'll need to plumb these
// values as well. At that time, presumably WebViewImpl::Resize() will
// also have migrated to the WebView API. https://crbug.com/419087
// Note: If WebViewImpl stops having any widget association when the
// main frame is remote, then this should be replaced with a direct call to
// webview()->ResizeVisualViewport().
webview()->MainFrameWidget()->Resize(
device_scale_factor_scaled_visual_viewport_size);
webview()->Resize(device_scale_factor_scaled_visual_viewport_size);
}
}
......
......@@ -310,6 +310,10 @@ class WebView {
float bottom_controls_height,
bool browser_controls_shrink_layout) = 0;
// Same as ResizeWithBrowserControls, but keeps the same BrowserControl
// settings.
virtual void Resize(const WebSize&) = 0;
// Auto-Resize -----------------------------------------------------------
// In auto-resize mode, the view is automatically adjusted to fit the html
......
......@@ -409,6 +409,7 @@ class CORE_EXPORT WebViewImpl final : public WebView,
// WebWidget overrides
void DidEnterFullscreen() override;
void DidExitFullscreen() override;
void Resize(const WebSize&) override;
private:
FRIEND_TEST_ALL_PREFIXES(WebFrameTest, DivScrollIntoEditableTest);
......@@ -431,7 +432,6 @@ class CORE_EXPORT WebViewImpl final : public WebView,
// WebWidget methods:
void SetAnimationHost(cc::AnimationHost*) override;
WebSize Size() override;
void Resize(const WebSize&) override;
void SetSuppressFrameRequestsWorkaroundFor704763Only(bool) override;
void BeginFrame(base::TimeTicks last_frame_time,
bool record_main_frame_metrics) override;
......
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