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

Side by Side Diff: content/browser/tab_contents/navigation_controller_impl.cc

Issue 9999010: Store original request URL in NavigationEntry (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Added to unit test Created 8 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/tab_contents/navigation_controller_impl.h" 5 #include "content/browser/tab_contents/navigation_controller_impl.h"
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/string_number_conversions.h" // Temporary 9 #include "base/string_number_conversions.h" // Temporary
10 #include "base/string_util.h" 10 #include "base/string_util.h"
(...skipping 856 matching lines...) Expand 10 before | Expand all | Expand 10 after
867 if (update_virtual_url) 867 if (update_virtual_url)
868 UpdateVirtualURLToURL(new_entry, params.url); 868 UpdateVirtualURLToURL(new_entry, params.url);
869 new_entry->SetReferrer(params.referrer); 869 new_entry->SetReferrer(params.referrer);
870 new_entry->SetPageID(params.page_id); 870 new_entry->SetPageID(params.page_id);
871 new_entry->SetTransitionType(params.transition); 871 new_entry->SetTransitionType(params.transition);
872 new_entry->set_site_instance( 872 new_entry->set_site_instance(
873 static_cast<SiteInstanceImpl*>(tab_contents_->GetSiteInstance())); 873 static_cast<SiteInstanceImpl*>(tab_contents_->GetSiteInstance()));
874 new_entry->SetHasPostData(params.is_post); 874 new_entry->SetHasPostData(params.is_post);
875 new_entry->SetPostID(params.post_id); 875 new_entry->SetPostID(params.post_id);
876 876
877 if (params.redirects.size() > 0)
878 new_entry->SetOriginalRequestURL(params.redirects[0]);
879 else
880 new_entry->SetOriginalRequestURL(GURL());
Charlie Reis 2012/04/10 01:37:28 Why not use the actual URL if there weren't any re
gone 2012/04/10 17:41:34 Changed to store the URL. I was hoping to save so
881
877 InsertOrReplaceEntry(new_entry, *did_replace_entry); 882 InsertOrReplaceEntry(new_entry, *did_replace_entry);
878 } 883 }
879 884
880 void NavigationControllerImpl::RendererDidNavigateToExistingPage( 885 void NavigationControllerImpl::RendererDidNavigateToExistingPage(
881 const ViewHostMsg_FrameNavigate_Params& params) { 886 const ViewHostMsg_FrameNavigate_Params& params) {
882 // We should only get here for main frame navigations. 887 // We should only get here for main frame navigations.
883 DCHECK(content::PageTransitionIsMainFrame(params.transition)); 888 DCHECK(content::PageTransitionIsMainFrame(params.transition));
884 889
885 // This is a back/forward navigation. The existing page for the ID is 890 // This is a back/forward navigation. The existing page for the ID is
886 // guaranteed to exist by ClassifyNavigation, and we just need to update it 891 // guaranteed to exist by ClassifyNavigation, and we just need to update it
(...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after
1432 for (int i = 0; i < max_index; i++) { 1437 for (int i = 0; i < max_index; i++) {
1433 // When cloning a tab, copy all entries except interstitial pages 1438 // When cloning a tab, copy all entries except interstitial pages
1434 if (source.entries_[i].get()->GetPageType() != 1439 if (source.entries_[i].get()->GetPageType() !=
1435 content::PAGE_TYPE_INTERSTITIAL) { 1440 content::PAGE_TYPE_INTERSTITIAL) {
1436 entries_.insert(entries_.begin() + insert_index++, 1441 entries_.insert(entries_.begin() + insert_index++,
1437 linked_ptr<NavigationEntryImpl>( 1442 linked_ptr<NavigationEntryImpl>(
1438 new NavigationEntryImpl(*source.entries_[i]))); 1443 new NavigationEntryImpl(*source.entries_[i])));
1439 } 1444 }
1440 } 1445 }
1441 } 1446 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698