Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2753)

Unified Diff: content/renderer/render_view_impl.cc

Issue 10889019: Reset scale & scroll state after reloading with overridden URL (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase, nit fix Created 8 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/public/renderer/document_state.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_view_impl.cc
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
index 6330cb2358999b5a0984759804b04936ce17ba73..8219b4f6415c77f7e3ea0ffbf0030df28febf250 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -3036,6 +3036,9 @@ void RenderViewImpl::PopulateDocumentStateFromPending(
document_state->set_referrer_policy(params.referrer.policy);
document_state->set_is_overriding_user_agent(params.is_overriding_user_agent);
+ document_state->set_must_reset_scroll_and_scale_state(
+ params.navigation_type ==
+ ViewMsg_Navigate_Type::RELOAD_ORIGINAL_REQUEST_URL);
}
NavigationState* RenderViewImpl::CreateNavigationStateFromPending() {
@@ -3248,6 +3251,11 @@ void RenderViewImpl::didCommitProvisionalLoad(WebFrame* frame,
if (document_state->commit_load_time().is_null())
document_state->set_commit_load_time(Time::Now());
+ if (document_state->must_reset_scroll_and_scale_state()) {
+ webview()->resetScrollAndScaleState();
+ document_state->set_must_reset_scroll_and_scale_state(false);
+ }
+
if (is_new_navigation) {
// When we perform a new navigation, we need to update the last committed
// session history entry with state for the page we are leaving.
« no previous file with comments | « content/public/renderer/document_state.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698