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

Unified Diff: content/browser/frame_host/navigation_controller_impl.cc

Issue 917043004: Mark error pages as such on Ctrl-Shift-T reload. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments. Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/frame_host/navigation_controller_impl.cc
diff --git a/content/browser/frame_host/navigation_controller_impl.cc b/content/browser/frame_host/navigation_controller_impl.cc
index 5c3f046e78f3aa954f1d220fb08fdcc5a0222ccb..e35ec8911a6c25b5a95cf043de7dd009615314be 100644
--- a/content/browser/frame_host/navigation_controller_impl.cc
+++ b/content/browser/frame_host/navigation_controller_impl.cc
@@ -1050,10 +1050,6 @@ void NavigationControllerImpl::RendererDidNavigateToNewPage(
pending_entry_->site_instance() == rfh->GetSiteInstance())) {
new_entry = new NavigationEntryImpl(*pending_entry_);
- // Don't use the page type from the pending entry. Some interstitial page
- // may have set the type to interstitial. Once we commit, however, the page
- // type must always be normal.
- new_entry->set_page_type(PAGE_TYPE_NORMAL);
update_virtual_url = new_entry->update_virtual_url_with_url();
} else {
new_entry = new NavigationEntryImpl;
@@ -1074,8 +1070,11 @@ void NavigationControllerImpl::RendererDidNavigateToNewPage(
update_virtual_url = needs_update;
}
- if (params.url_is_unreachable)
- new_entry->set_page_type(PAGE_TYPE_ERROR);
+ // Don't use the page type from the pending entry. Some interstitial page
+ // may have set the type to interstitial. Once we commit, however, the page
+ // type must always be normal or error.
+ new_entry->set_page_type(params.url_is_unreachable ? PAGE_TYPE_ERROR
+ : PAGE_TYPE_NORMAL);
new_entry->SetURL(params.url);
if (update_virtual_url)
UpdateVirtualURLToURL(new_entry, params.url);
@@ -1126,6 +1125,8 @@ void NavigationControllerImpl::RendererDidNavigateToExistingPage(
NavigationEntryImpl* entry = entries_[entry_index].get();
// The URL may have changed due to redirects.
+ entry->set_page_type(params.url_is_unreachable ? PAGE_TYPE_ERROR
+ : PAGE_TYPE_NORMAL);
entry->SetURL(params.url);
entry->SetReferrer(params.referrer);
if (entry->update_virtual_url_with_url())
@@ -1178,6 +1179,8 @@ void NavigationControllerImpl::RendererDidNavigateToSamePage(
existing_entry->set_unique_id(pending_entry_->GetUniqueID());
// The URL may have changed due to redirects.
+ existing_entry->set_page_type(params.url_is_unreachable ? PAGE_TYPE_ERROR
+ : PAGE_TYPE_NORMAL);
if (existing_entry->update_virtual_url_with_url())
UpdateVirtualURLToURL(existing_entry, params.url);
existing_entry->SetURL(params.url);
@@ -1204,6 +1207,8 @@ void NavigationControllerImpl::RendererDidNavigateInPage(
// entry and it will be the same page as the new navigation (minus the
// reference fragments, of course). We'll update the URL of the existing
// entry without pruning the forward history.
+ existing_entry->set_page_type(params.url_is_unreachable ? PAGE_TYPE_ERROR
+ : PAGE_TYPE_NORMAL);
existing_entry->SetURL(params.url);
if (existing_entry->update_virtual_url_with_url())
UpdateVirtualURLToURL(existing_entry, params.url);

Powered by Google App Engine
This is Rietveld 408576698