Commit 53ebffc1 authored by Gyuyoung Kim's avatar Gyuyoung Kim Committed by Chromium LUCI CQ

Convert AwViewMsg_SetInitialPageScale to Mojo

This CL migrates AwViewMsg_SetInitialPageScale to
LocalMainFrame interface.

Bug: 1157124
Change-Id: I2750606e2dfa56d2b0fa2e710510d23333f17304
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2583668
Commit-Queue: Gyuyoung Kim <gyuyoung@igalia.com>
Reviewed-by: default avatarDave Tapuska <dtapuska@chromium.org>
Reviewed-by: default avatarBo <boliu@chromium.org>
Reviewed-by: default avatarKinuko Yasuda <kinuko@chromium.org>
Cr-Commit-Position: refs/heads/master@{#836409}
parent d942113a
......@@ -88,8 +88,8 @@ void AwRenderViewHostExt::ResetScrollAndScaleState() {
void AwRenderViewHostExt::SetInitialPageScale(double page_scale_factor) {
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
web_contents()->GetMainFrame()->Send(new AwViewMsg_SetInitialPageScale(
web_contents()->GetMainFrame()->GetRoutingID(), page_scale_factor));
if (local_main_frame_remote_)
local_main_frame_remote_->SetInitialPageScale(page_scale_factor);
}
void AwRenderViewHostExt::SetBackgroundColor(SkColor c) {
......
......@@ -81,6 +81,10 @@ interface LocalMainFrame {
// Sets the base background color for this view.
SetBackgroundColor(skia.mojom.SkColor color);
// Sets the initial page scale. This overrides initial scale set by
// the meta viewport tag.
SetInitialPageScale(double page_scale_factor);
// Sets the zoom factor for text only. Used in layout modes other than
// Text Autosizing.
SetTextZoomFactor(float zoom_factor);
......
......@@ -20,11 +20,6 @@
// RenderView messages
// These are messages sent from the browser to the renderer process.
// Sets the initial page scale. This overrides initial scale set by
// the meta viewport tag.
IPC_MESSAGE_ROUTED1(AwViewMsg_SetInitialPageScale,
double /* page_scale_factor */)
// Tells blink to smooth scroll to the specified location within |duration_ms|.
IPC_MESSAGE_ROUTED3(AwViewMsg_SmoothScroll,
int /* target_x */,
......
......@@ -240,7 +240,6 @@ void AwRenderFrameExt::DidCommitProvisionalLoad(
bool AwRenderFrameExt::OnMessageReceived(const IPC::Message& message) {
bool handled = true;
IPC_BEGIN_MESSAGE_MAP(AwRenderFrameExt, message)
IPC_MESSAGE_HANDLER(AwViewMsg_SetInitialPageScale, OnSetInitialPageScale)
IPC_MESSAGE_HANDLER(AwViewMsg_SmoothScroll, OnSmoothScroll)
IPC_MESSAGE_UNHANDLED(handled = false)
IPC_END_MESSAGE_MAP()
......@@ -298,20 +297,20 @@ void AwRenderFrameExt::HitTest(const gfx::PointF& touch_center,
GetFrameHost()->UpdateHitTestData(std::move(data));
}
void AwRenderFrameExt::OnSetInitialPageScale(double page_scale_factor) {
void AwRenderFrameExt::SetBackgroundColor(SkColor c) {
blink::WebView* webview = GetWebView();
if (!webview)
return;
webview->SetInitialPageScaleOverride(page_scale_factor);
webview->SetBaseBackgroundColor(c);
}
void AwRenderFrameExt::SetBackgroundColor(SkColor c) {
void AwRenderFrameExt::SetInitialPageScale(double page_scale_factor) {
blink::WebView* webview = GetWebView();
if (!webview)
return;
webview->SetBaseBackgroundColor(c);
webview->SetInitialPageScaleOverride(page_scale_factor);
}
void AwRenderFrameExt::SetTextZoomFactor(float zoom_factor) {
......
......@@ -48,12 +48,11 @@ class AwRenderFrameExt : public content::RenderFrameObserver,
void FocusedElementChanged(const blink::WebElement& element) override;
void OnDestruct() override;
void OnSetInitialPageScale(double page_scale_factor);
void OnSmoothScroll(int target_x, int target_y, base::TimeDelta duration);
// mojom::LocalMainFrame overrides:
void SetBackgroundColor(SkColor c) override;
void SetInitialPageScale(double page_scale_factor) override;
void SetTextZoomFactor(float zoom_factor) override;
void HitTest(const gfx::PointF& touch_center,
const gfx::SizeF& touch_area) 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