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

Unified Diff: content/browser/tab_contents/navigation_controller.cc

Issue 6801052: Fix classification of a history.back() that interrupts a pending navigation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix test comment. Created 9 years, 8 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 | content/browser/tab_contents/navigation_controller_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/tab_contents/navigation_controller.cc
diff --git a/content/browser/tab_contents/navigation_controller.cc b/content/browser/tab_contents/navigation_controller.cc
index c5c4e25c2e3d3d30c5e4d1d4fa7330c94f23dafa..acefc38c0085e5c6cb3471bfc6a56e3d435b0132 100644
--- a/content/browser/tab_contents/navigation_controller.cc
+++ b/content/browser/tab_contents/navigation_controller.cc
@@ -641,14 +641,15 @@ NavigationType::Type NavigationController::ClassifyNavigation(
// Anything below here we know is a main frame navigation.
if (pending_entry_ &&
existing_entry != pending_entry_ &&
- pending_entry_->page_id() == -1) {
+ pending_entry_->page_id() == -1 &&
+ existing_entry == GetLastCommittedEntry()) {
// In this case, we have a pending entry for a URL but WebCore didn't do a
// new navigation. This happens when you press enter in the URL bar to
// reload. We will create a pending entry, but WebKit will convert it to
// a reload since it's the same page and not create a new entry for it
// (the user doesn't want to have a new back/forward entry when they do
- // this). In this case, we want to just ignore the pending entry and go
- // back to where we were (the "existing entry").
+ // this). If this matches the last committed entry, we want to just ignore
+ // the pending entry and go back to where we were (the "existing entry").
return NavigationType::SAME_PAGE;
}
« no previous file with comments | « no previous file | content/browser/tab_contents/navigation_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698