From 263e86f88ffc1c8587a5d3141fbc5d6f0ca8519b Mon Sep 17 00:00:00 2001 From: wjmaclean Date: Mon, 20 Oct 2014 15:22:18 -0700 Subject: [PATCH] Force reset of RenderViewImpl zoom level. When navigation away from a page fails, the displayed error page uses the zoom level of the current page since the underlying RenderViewImpl is re-used without resetting its zoom level before displaying the error page. This CL forces the RenderViewImpl's zoom level to be reset to 0 whenever the url being navigated to is unkown to the RenderViewImpl. BUG=422464 Review URL: https://codereview.chromium.org/663203002 Cr-Commit-Position: refs/heads/master@{#300352} --- content/renderer/render_frame_impl.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc index 0ead242c285b..02ab8bbda538 100644 --- a/content/renderer/render_frame_impl.cc +++ b/content/renderer/render_frame_impl.cc @@ -3408,8 +3408,13 @@ void RenderFrameImpl::SendDidCommitProvisionalLoad(blink::WebFrame* frame) { // Reset the zoom levels for plugins. render_view_->webview()->setZoomLevel(0); } else { - if (host_zoom != render_view_->host_zoom_levels_.end()) + if (host_zoom != render_view_->host_zoom_levels_.end()) { render_view_->webview()->setZoomLevel(host_zoom->second); + } else { + // If the url was not found, we need to reset in case we are re-using + // an existing RenderViewImpl, e.g. to show a network error page. + render_view_->webview()->setZoomLevel(0); + } } if (host_zoom != render_view_->host_zoom_levels_.end()) { -- 2.11.4.GIT