Chromium Code Reviews| Index: content/browser/frame_host/navigator_impl.cc |
| diff --git a/content/browser/frame_host/navigator_impl.cc b/content/browser/frame_host/navigator_impl.cc |
| index 64d242174b8d8586eb9678d4319e97f86b3d868e..6a06da47763076b0e23c0c459b9e2ce30440f051 100644 |
| --- a/content/browser/frame_host/navigator_impl.cc |
| +++ b/content/browser/frame_host/navigator_impl.cc |
| @@ -426,7 +426,14 @@ void NavigatorImpl::DidNavigate( |
| // calling RenderFrameHostManager::DidNavigateMainFrame, because that can |
| // change WebContents::GetRenderViewHost to return the new host, instead |
| // of the one that may have just been swapped out. |
| - if (delegate_->CanOverscrollContent()) |
| + NavigationEntry* current_entry = controller_->GetLastCommittedEntry(); |
| + int32 current_page_id = current_entry ? current_entry->GetPageID() : -1; |
|
nasko
2014/06/04 18:53:48
nit: it will be a bit more readable with an empty
mfomitchev
2014/06/04 19:26:20
Done.
|
| + // If page id didn't change, then this is not a navigation to a new |
| + // history entry or to the previous entry, and we don't need to take the |
| + // screenshot. |
|
nasko
2014/06/04 18:53:48
nit: For back/forward navigations we still want to
mfomitchev
2014/06/04 19:26:20
Reworded
|
| + bool page_id_changed = params.page_id > 0 && |
| + params.page_id != current_page_id; |
| + if (delegate_->CanOverscrollContent() && page_id_changed) |
| controller_->TakeScreenshot(); |
| // Run tasks that must execute just before the commit. |