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

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

Issue 147145: Fix: Certain redirections remove sites from the history... (Closed) Base URL: svn://chrome-svn.corp.google.com/chrome/trunk/src/
Patch Set: '' Created 11 years, 6 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 | « chrome/browser/tab_contents/navigation_controller.h ('k') | chrome/browser/tab_contents/tab_contents.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/tab_contents/navigation_controller.cc
===================================================================
--- chrome/browser/tab_contents/navigation_controller.cc (revision 19705)
+++ chrome/browser/tab_contents/navigation_controller.cc (working copy)
@@ -465,7 +465,7 @@
details->type = ClassifyNavigation(params);
switch (details->type) {
case NavigationType::NEW_PAGE:
- RendererDidNavigateToNewPage(params);
+ RendererDidNavigateToNewPage(params, &(details->did_replace_entry));
break;
case NavigationType::EXISTING_PAGE:
RendererDidNavigateToExistingPage(params);
@@ -474,7 +474,7 @@
RendererDidNavigateToSamePage(params);
break;
case NavigationType::IN_PAGE:
- RendererDidNavigateInPage(params);
+ RendererDidNavigateInPage(params, &(details->did_replace_entry));
break;
case NavigationType::NEW_SUBFRAME:
RendererDidNavigateNewSubframe(params);
@@ -617,7 +617,7 @@
}
void NavigationController::RendererDidNavigateToNewPage(
- const ViewHostMsg_FrameNavigate_Params& params) {
+ const ViewHostMsg_FrameNavigate_Params& params, bool* did_replace_entry) {
NavigationEntry* new_entry;
if (pending_entry_) {
// TODO(brettw) this assumes that the pending entry is appropriate for the
@@ -648,8 +648,9 @@
// replaced with the new entry to avoid unwanted redirections in navigating
// backward/forward.
// Otherwise, just insert the new entry.
- InsertOrReplaceEntry(new_entry,
- IsRedirect(params) && IsLikelyAutoNavigation(base::TimeTicks::Now()));
+ *did_replace_entry = IsRedirect(params) &&
+ IsLikelyAutoNavigation(base::TimeTicks::Now());
+ InsertOrReplaceEntry(new_entry, *did_replace_entry);
}
void NavigationController::RendererDidNavigateToExistingPage(
@@ -707,7 +708,7 @@
}
void NavigationController::RendererDidNavigateInPage(
- const ViewHostMsg_FrameNavigate_Params& params) {
+ const ViewHostMsg_FrameNavigate_Params& params, bool* did_replace_entry) {
DCHECK(PageTransition::IsMainFrame(params.transition)) <<
"WebKit should only tell us about in-page navs for the main frame.";
// We're guaranteed to have an entry for this one.
@@ -721,8 +722,9 @@
NavigationEntry* new_entry = new NavigationEntry(*existing_entry);
new_entry->set_page_id(params.page_id);
new_entry->set_url(params.url);
- InsertOrReplaceEntry(new_entry,
- IsRedirect(params) && IsLikelyAutoNavigation(base::TimeTicks::Now()));
+ *did_replace_entry = IsRedirect(params) &&
+ IsLikelyAutoNavigation(base::TimeTicks::Now());
+ InsertOrReplaceEntry(new_entry, *did_replace_entry);
}
void NavigationController::RendererDidNavigateNewSubframe(
« no previous file with comments | « chrome/browser/tab_contents/navigation_controller.h ('k') | chrome/browser/tab_contents/tab_contents.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698