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

Unified Diff: content/browser/frame_host/navigator_impl.cc

Issue 316553007: Making sure we don't take a GestureNav screenshot unless the history position changes. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 7 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698