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. |