| OLD | NEW |
| 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/web_contents/navigation_controller_impl.h" | 5 #include "content/browser/web_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 851 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 862 if (update_virtual_url) | 862 if (update_virtual_url) |
| 863 UpdateVirtualURLToURL(new_entry, params.url); | 863 UpdateVirtualURLToURL(new_entry, params.url); |
| 864 new_entry->SetReferrer(params.referrer); | 864 new_entry->SetReferrer(params.referrer); |
| 865 new_entry->SetPageID(params.page_id); | 865 new_entry->SetPageID(params.page_id); |
| 866 new_entry->SetTransitionType(params.transition); | 866 new_entry->SetTransitionType(params.transition); |
| 867 new_entry->set_site_instance( | 867 new_entry->set_site_instance( |
| 868 static_cast<SiteInstanceImpl*>(web_contents_->GetSiteInstance())); | 868 static_cast<SiteInstanceImpl*>(web_contents_->GetSiteInstance())); |
| 869 new_entry->SetHasPostData(params.is_post); | 869 new_entry->SetHasPostData(params.is_post); |
| 870 new_entry->SetPostID(params.post_id); | 870 new_entry->SetPostID(params.post_id); |
| 871 | 871 |
| 872 if (params.redirects.size() > 0) |
| 873 new_entry->SetOriginalRequestURL(params.redirects[0]); |
| 874 else |
| 875 new_entry->SetOriginalRequestURL(params.url); |
| 876 |
| 872 InsertOrReplaceEntry(new_entry, *did_replace_entry); | 877 InsertOrReplaceEntry(new_entry, *did_replace_entry); |
| 873 } | 878 } |
| 874 | 879 |
| 875 void NavigationControllerImpl::RendererDidNavigateToExistingPage( | 880 void NavigationControllerImpl::RendererDidNavigateToExistingPage( |
| 876 const ViewHostMsg_FrameNavigate_Params& params) { | 881 const ViewHostMsg_FrameNavigate_Params& params) { |
| 877 // We should only get here for main frame navigations. | 882 // We should only get here for main frame navigations. |
| 878 DCHECK(content::PageTransitionIsMainFrame(params.transition)); | 883 DCHECK(content::PageTransitionIsMainFrame(params.transition)); |
| 879 | 884 |
| 880 // This is a back/forward navigation. The existing page for the ID is | 885 // This is a back/forward navigation. The existing page for the ID is |
| 881 // guaranteed to exist by ClassifyNavigation, and we just need to update it | 886 // guaranteed to exist by ClassifyNavigation, and we just need to update it |
| (...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1427 for (int i = 0; i < max_index; i++) { | 1432 for (int i = 0; i < max_index; i++) { |
| 1428 // When cloning a tab, copy all entries except interstitial pages | 1433 // When cloning a tab, copy all entries except interstitial pages |
| 1429 if (source.entries_[i].get()->GetPageType() != | 1434 if (source.entries_[i].get()->GetPageType() != |
| 1430 content::PAGE_TYPE_INTERSTITIAL) { | 1435 content::PAGE_TYPE_INTERSTITIAL) { |
| 1431 entries_.insert(entries_.begin() + insert_index++, | 1436 entries_.insert(entries_.begin() + insert_index++, |
| 1432 linked_ptr<NavigationEntryImpl>( | 1437 linked_ptr<NavigationEntryImpl>( |
| 1433 new NavigationEntryImpl(*source.entries_[i]))); | 1438 new NavigationEntryImpl(*source.entries_[i]))); |
| 1434 } | 1439 } |
| 1435 } | 1440 } |
| 1436 } | 1441 } |
| OLD | NEW |