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

Unified Diff: content/browser/tab_contents/tab_contents.cc

Issue 6904039: Update the URL if the user cancels a beforeunload handler. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add missing file. Created 9 years, 8 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 | « content/browser/tab_contents/tab_contents.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/tab_contents/tab_contents.cc
diff --git a/content/browser/tab_contents/tab_contents.cc b/content/browser/tab_contents/tab_contents.cc
index 7c113a3dc38f4d4badf33291c9ce7a5acf1ef569..5d2dbba48d68ae95335e69ad6b91333f3af62763 100644
--- a/content/browser/tab_contents/tab_contents.cc
+++ b/content/browser/tab_contents/tab_contents.cc
@@ -1232,9 +1232,7 @@ void TabContents::OnDidFailProvisionalLoadWithError(
// before the page loaded so that the discard would discard the wrong entry.
NavigationEntry* pending_entry = controller_.pending_entry();
if (pending_entry && pending_entry->url() == validated_url) {
- controller_.DiscardNonCommittedEntries();
- // Update the URL display.
- NotifyNavigationStateChanged(TabContents::INVALIDATE_URL);
+ DidCancelLoading();
}
render_manager_.RendererAbortedProvisionalLoad(render_view_host());
@@ -1980,6 +1978,13 @@ void TabContents::DidStopLoading() {
FOR_EACH_OBSERVER(TabContentsObserver, observers_, DidStopLoading());
}
+void TabContents::DidCancelLoading() {
+ controller_.DiscardNonCommittedEntries();
+
+ // Update the URL display.
+ NotifyNavigationStateChanged(TabContents::INVALIDATE_URL);
+}
+
void TabContents::DidChangeLoadProgress(double progress) {
if (delegate())
delegate()->LoadProgressChanged(progress);
« no previous file with comments | « content/browser/tab_contents/tab_contents.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698