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

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

Issue 2919593007: Always update the omnibox URL when cancelling via onbeforeunload (Closed)
Patch Set: Merge remote-tracking branch 'origin/master' into spoof 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 d1bd4345c049a042e773cb495b60a0391c1c0eaa..f64e30a881e65f2b058fc46a408cd059fe6d930a 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -4813,13 +4813,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;
@@ -5370,6 +5363,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();
}
« 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