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/bind.h" | 7 #include "base/bind.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/string_number_conversions.h" // Temporary | 10 #include "base/string_number_conversions.h" // Temporary |
(...skipping 975 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
986 | 986 |
987 // This is a back/forward navigation. The existing page for the ID is | 987 // This is a back/forward navigation. The existing page for the ID is |
988 // guaranteed to exist by ClassifyNavigation, and we just need to update it | 988 // guaranteed to exist by ClassifyNavigation, and we just need to update it |
989 // with new information from the renderer. | 989 // with new information from the renderer. |
990 int entry_index = GetEntryIndexWithPageID(web_contents_->GetSiteInstance(), | 990 int entry_index = GetEntryIndexWithPageID(web_contents_->GetSiteInstance(), |
991 params.page_id); | 991 params.page_id); |
992 DCHECK(entry_index >= 0 && | 992 DCHECK(entry_index >= 0 && |
993 entry_index < static_cast<int>(entries_.size())); | 993 entry_index < static_cast<int>(entries_.size())); |
994 NavigationEntryImpl* entry = entries_[entry_index].get(); | 994 NavigationEntryImpl* entry = entries_[entry_index].get(); |
995 | 995 |
996 // The URL may have changed due to redirects. The site instance will normally | 996 // The URL may have changed due to redirects. |
997 // be the same except during session restore, when no site instance will be | |
998 // assigned. | |
999 entry->SetURL(params.url); | 997 entry->SetURL(params.url); |
1000 if (entry->update_virtual_url_with_url()) | 998 if (entry->update_virtual_url_with_url()) |
1001 UpdateVirtualURLToURL(entry, params.url); | 999 UpdateVirtualURLToURL(entry, params.url); |
| 1000 |
| 1001 // The redirected to page should not inherit the favicon from the previous |
| 1002 // page. |
| 1003 if (PageTransitionIsRedirect(params.transition)) |
| 1004 entry->GetFavicon() = content::FaviconStatus(); |
| 1005 |
| 1006 // The site instance will normally be the same except during session restore, |
| 1007 // when no site instance will be assigned. |
1002 DCHECK(entry->site_instance() == NULL || | 1008 DCHECK(entry->site_instance() == NULL || |
1003 entry->site_instance() == web_contents_->GetSiteInstance()); | 1009 entry->site_instance() == web_contents_->GetSiteInstance()); |
1004 entry->set_site_instance( | 1010 entry->set_site_instance( |
1005 static_cast<SiteInstanceImpl*>(web_contents_->GetSiteInstance())); | 1011 static_cast<SiteInstanceImpl*>(web_contents_->GetSiteInstance())); |
1006 | 1012 |
1007 entry->SetHasPostData(params.is_post); | 1013 entry->SetHasPostData(params.is_post); |
1008 entry->SetPostID(params.post_id); | 1014 entry->SetPostID(params.post_id); |
1009 | 1015 |
1010 // The entry we found in the list might be pending if the user hit | 1016 // The entry we found in the list might be pending if the user hit |
1011 // back/forward/reload. This load should commit it (since it's already in the | 1017 // back/forward/reload. This load should commit it (since it's already in the |
(...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1603 } | 1609 } |
1604 } | 1610 } |
1605 } | 1611 } |
1606 | 1612 |
1607 void NavigationControllerImpl::SetGetTimestampCallbackForTest( | 1613 void NavigationControllerImpl::SetGetTimestampCallbackForTest( |
1608 const base::Callback<base::Time()>& get_timestamp_callback) { | 1614 const base::Callback<base::Time()>& get_timestamp_callback) { |
1609 get_timestamp_callback_ = get_timestamp_callback; | 1615 get_timestamp_callback_ = get_timestamp_callback; |
1610 } | 1616 } |
1611 | 1617 |
1612 } // namespace content | 1618 } // namespace content |
OLD | NEW |