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

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

Issue 115704: Change URL back to the previous one if the typed URL causes file download.... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 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
« no previous file with comments | « chrome/browser/tab_contents/tab_contents.h ('k') | chrome/browser/tab_contents/tab_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/tab_contents/tab_contents.cc
===================================================================
--- chrome/browser/tab_contents/tab_contents.cc (revision 16844)
+++ chrome/browser/tab_contents/tab_contents.cc (working copy)
@@ -1853,6 +1853,14 @@
Details<LoadFromMemoryCacheDetails>(&details));
}
+void TabContents::MarkAsDownload() {
+ NavigationEntry* pending_entry = controller_.pending_entry();
+ if (pending_entry) {
+ pending_entry->set_page_type(NavigationEntry::DOWNLOAD_PAGE);
+ }
+}
+
+
void TabContents::DidFailProvisionalLoadWithError(
RenderViewHost* render_view_host,
bool is_main_frame,
@@ -1888,9 +1896,15 @@
// pending entry if the URLs match, otherwise the user initiated a navigate
// before the page loaded so that the discard would discard the wrong entry.
NavigationEntry* pending_entry = controller_.pending_entry();
+ bool is_downloading = pending_entry ?
+ pending_entry->page_type() == NavigationEntry::DOWNLOAD_PAGE : false;
if (pending_entry && pending_entry->url() == url)
controller_.DiscardNonCommittedEntries();
+ if (delegate() && is_downloading) {
+ delegate()->NavigationStateChanged(this, TabContents::INVALIDATE_URL);
+ }
+
render_manager_.RendererAbortedProvisionalLoad(render_view_host);
}
« no previous file with comments | « chrome/browser/tab_contents/tab_contents.h ('k') | chrome/browser/tab_contents/tab_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698