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

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

Issue 2919593007: Always update the omnibox URL when cancelling via onbeforeunload (Closed)
Patch Set: Test tweaking Created 3 years, 7 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 ebbb7ef5eda8e71503f8068cf250c4761de7ec25..196fe6b7ced5933fd408f8027e91c19bfb4c1a65 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -4740,13 +4740,6 @@ std::unique_ptr<NavigationUIData> WebContentsImpl::GetNavigationUIData(
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;
@@ -5294,6 +5287,9 @@ void WebContentsImpl::OnDialogClosed(int render_process_id,
// 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();
}

Powered by Google App Engine
This is Rietveld 408576698