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

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

Issue 2415173002: Fix regression where navigating to debug URLs didn't update the omnibox. (Closed)
Patch Set: remove redundant check Created 4 years, 2 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
« no previous file with comments | « chrome/browser/crash_recovery_browsertest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/frame_host/navigator_impl.cc
diff --git a/content/browser/frame_host/navigator_impl.cc b/content/browser/frame_host/navigator_impl.cc
index 531e06b0cf9d13b5130d4d88ba3b0ddf23d68725..3892b89d293dc69669b1f98098f00622667a0bba 100644
--- a/content/browser/frame_host/navigator_impl.cc
+++ b/content/browser/frame_host/navigator_impl.cc
@@ -423,10 +423,10 @@ bool NavigatorImpl::NavigateToEntry(
CHECK_EQ(controller_->GetPendingEntry(), &entry);
if (controller_->GetPendingEntryIndex() == -1 &&
- IsRendererDebugURL(dest_url)) {
+ dest_url.SchemeIs(url::kJavaScriptScheme)) {
// If the pending entry index is -1 (which means a new navigation rather
- // than a history one), and the user typed in a debug URL, don't add it to
- // the session history.
+ // than a history one), and the user typed in a javascript: URL, don't add
+ // it to the session history.
//
// This is a hack. What we really want is to avoid adding to the history any
// URL that doesn't generate content, and what would be great would be if we
@@ -988,7 +988,12 @@ void NavigatorImpl::FailedNavigation(FrameTreeNode* frame_tree_node,
NavigationRequest* navigation_request = frame_tree_node->navigation_request();
DCHECK(navigation_request);
- DiscardPendingEntryIfNeeded(navigation_request->navigation_handle());
+ // With PlzNavigate, debug URLs will give a failed navigation because the
+ // WebUI backend won't find a handler for them. They will be processed in the
+ // renderer, however do not discard the pending entry so that the URL bar
+ // shows them correctly.
+ if (!IsRendererDebugURL(navigation_request->navigation_handle()->GetURL()))
+ DiscardPendingEntryIfNeeded(navigation_request->navigation_handle());
// If the request was canceled by the user do not show an error page.
if (error_code == net::ERR_ABORTED) {
« no previous file with comments | « chrome/browser/crash_recovery_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698