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

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: Created 8 years, 4 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 9639d2e26bfe224a2b7b8d9130b0872ba12da9c4..cae23ef52ad05b958d39555f678b74fe56542266 100644
--- a/content/renderer/render_view_impl.cc
+++ b/content/renderer/render_view_impl.cc
@@ -2981,6 +2981,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(
+ ViewMsg_Navigate_Type::RELOAD_ORIGINAL_REQUEST_URL ==
darin (slow to review) 2012/08/30 16:56:11 nit: we generally favor the "variable == constant"
+ params.navigation_type);
}
NavigationState* RenderViewImpl::CreateNavigationStateFromPending() {
@@ -3197,6 +3200,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