diff options
author | yuzo@chromium.org <yuzo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-01 04:51:47 +0000 |
---|---|---|
committer | yuzo@chromium.org <yuzo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-01 04:51:47 +0000 |
commit | befd8d82ec47c02d6b17d9fa7b6c1f3bb703150f (patch) | |
tree | cdcbb4ced140ad2db3018c3fa74e14d5f1540d59 /chrome/browser/tab_contents/navigation_controller.cc | |
parent | feab536198e21e8f4777c3c8035a6ca6479f6912 (diff) | |
download | chromium_src-befd8d82ec47c02d6b17d9fa7b6c1f3bb703150f.zip chromium_src-befd8d82ec47c02d6b17d9fa7b6c1f3bb703150f.tar.gz chromium_src-befd8d82ec47c02d6b17d9fa7b6c1f3bb703150f.tar.bz2 |
Fix: Certain redirections remove sites from the history
Currently, PageTransition::CHAIN_END flag is removed from a History database
entry for a redirect source, even when the redirect is user initiated.
This change prevents the flag removal for user-initiated redirects.
TEST=Open http://www.google.com/ig and click on tabs multiple times. Without
this change, only the last tab clicked appears in the History page (CTRL+H).
With this change, all the tabs should appear.
TESTED=gcl try, manually
BUG=11355
Review URL: http://codereview.chromium.org/147145
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19708 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/tab_contents/navigation_controller.cc')
-rw-r--r-- | chrome/browser/tab_contents/navigation_controller.cc | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/chrome/browser/tab_contents/navigation_controller.cc b/chrome/browser/tab_contents/navigation_controller.cc index ef27e74..139ddb5 100644 --- a/chrome/browser/tab_contents/navigation_controller.cc +++ b/chrome/browser/tab_contents/navigation_controller.cc @@ -465,7 +465,7 @@ bool NavigationController::RendererDidNavigate( 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 @@ bool NavigationController::RendererDidNavigate( 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 @@ bool NavigationController::IsLikelyAutoNavigation(base::TimeTicks now) { } 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 @@ void NavigationController::RendererDidNavigateToNewPage( // 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::RendererDidNavigateToSamePage( } 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 @@ void NavigationController::RendererDidNavigateInPage( 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( |