OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/frame_host/navigation_controller_impl.h" | 5 #include "content/browser/frame_host/navigation_controller_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 1106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1117 // This is a back/forward navigation. The existing page for the ID is | 1117 // This is a back/forward navigation. The existing page for the ID is |
1118 // guaranteed to exist by ClassifyNavigation, and we just need to update it | 1118 // guaranteed to exist by ClassifyNavigation, and we just need to update it |
1119 // with new information from the renderer. | 1119 // with new information from the renderer. |
1120 int entry_index = GetEntryIndexWithPageID(rfh->GetSiteInstance(), | 1120 int entry_index = GetEntryIndexWithPageID(rfh->GetSiteInstance(), |
1121 params.page_id); | 1121 params.page_id); |
1122 DCHECK(entry_index >= 0 && | 1122 DCHECK(entry_index >= 0 && |
1123 entry_index < static_cast<int>(entries_.size())); | 1123 entry_index < static_cast<int>(entries_.size())); |
1124 NavigationEntryImpl* entry = entries_[entry_index].get(); | 1124 NavigationEntryImpl* entry = entries_[entry_index].get(); |
1125 | 1125 |
1126 // The URL may have changed due to redirects. | 1126 // The URL may have changed due to redirects. |
1127 if (params.url_is_unreachable) | |
1128 entry->set_page_type(PAGE_TYPE_ERROR); | |
Charlie Reis
2015/02/12 21:57:47
Seems reasonable to me. What about the other Rend
| |
1127 entry->SetURL(params.url); | 1129 entry->SetURL(params.url); |
1128 entry->SetReferrer(params.referrer); | 1130 entry->SetReferrer(params.referrer); |
1129 if (entry->update_virtual_url_with_url()) | 1131 if (entry->update_virtual_url_with_url()) |
1130 UpdateVirtualURLToURL(entry, params.url); | 1132 UpdateVirtualURLToURL(entry, params.url); |
1131 | 1133 |
1132 // The redirected to page should not inherit the favicon from the previous | 1134 // The redirected to page should not inherit the favicon from the previous |
1133 // page. | 1135 // page. |
1134 if (ui::PageTransitionIsRedirect(params.transition)) | 1136 if (ui::PageTransitionIsRedirect(params.transition)) |
1135 entry->GetFavicon() = FaviconStatus(); | 1137 entry->GetFavicon() = FaviconStatus(); |
1136 | 1138 |
(...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1787 } | 1789 } |
1788 } | 1790 } |
1789 } | 1791 } |
1790 | 1792 |
1791 void NavigationControllerImpl::SetGetTimestampCallbackForTest( | 1793 void NavigationControllerImpl::SetGetTimestampCallbackForTest( |
1792 const base::Callback<base::Time()>& get_timestamp_callback) { | 1794 const base::Callback<base::Time()>& get_timestamp_callback) { |
1793 get_timestamp_callback_ = get_timestamp_callback; | 1795 get_timestamp_callback_ = get_timestamp_callback; |
1794 } | 1796 } |
1795 | 1797 |
1796 } // namespace content | 1798 } // namespace content |
OLD | NEW |