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

Unified Diff: content/browser/web_contents/web_contents_impl.cc

Issue 2952483002: Revert of Always update the omnibox URL when cancelling via onbeforeunload (Closed)
Patch Set: Created 3 years, 6 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/web_contents/web_contents_impl.cc
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index f64e30a881e65f2b058fc46a408cd059fe6d930a..d1bd4345c049a042e773cb495b60a0391c1c0eaa 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -4813,6 +4813,13 @@
return GetContentClient()->browser()->GetNavigationUIData(navigation_handle);
}
+void WebContentsImpl::DidCancelLoading() {
+ controller_.DiscardNonCommittedEntries();
+
+ // Update the URL display.
+ NotifyNavigationStateChanged(INVALIDATE_TYPE_URL);
+}
+
void WebContentsImpl::DidAccessInitialDocument() {
has_accessed_initial_document_ = true;
@@ -5363,9 +5370,6 @@
// meantime. Do not reset the navigation state in that case.
if (rfh && rfh == rfh->frame_tree_node()->current_frame_host()) {
rfh->frame_tree_node()->BeforeUnloadCanceled();
-
- // Remove the entry for the navigation that's being cancelled, and notify
- // the WebContentsDelegate that the visible URL has changed.
controller_.DiscardNonCommittedEntries();
}
« no previous file with comments | « content/browser/web_contents/web_contents_impl.h ('k') | content/browser/web_contents/web_contents_impl_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698