summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authoryuzo@chromium.org <yuzo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-19 04:24:20 +0000
committeryuzo@chromium.org <yuzo@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-19 04:24:20 +0000
commit19347f6ff573d2a7d22515ba2bbfb246e34af92b (patch)
treeec675b89d28ed1cc88d6903606c848e60bb54500 /chrome
parentdbb7a746cf9a19f7fa1d3a6d4775a6ba62f52989 (diff)
downloadchromium_src-19347f6ff573d2a7d22515ba2bbfb246e34af92b.zip
chromium_src-19347f6ff573d2a7d22515ba2bbfb246e34af92b.tar.gz
chromium_src-19347f6ff573d2a7d22515ba2bbfb246e34af92b.tar.bz2
Change URL back to the previous one if the typed URL causes file download.
This is the successor to http://codereview.chromium.org/115704 TESTED=manually TEST=Type any URL that causes download, e.g., ftp://ftp.vim.org/pub/vim/pc/gvim72.zip into the omnibox. Without this change the URL remains there. With this change, the URL is changed back to the original one. BUG=1904 Review URL: http://codereview.chromium.org/126266 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18790 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/tab_contents/tab_contents.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/chrome/browser/tab_contents/tab_contents.cc b/chrome/browser/tab_contents/tab_contents.cc
index 8ba705f..df84333 100644
--- a/chrome/browser/tab_contents/tab_contents.cc
+++ b/chrome/browser/tab_contents/tab_contents.cc
@@ -897,6 +897,13 @@ void TabContents::OnStartDownload(DownloadItem* download) {
if (tab_contents && tab_contents->delegate())
tab_contents->delegate()->OnStartDownload(download);
+
+ // Update the URL display.
+ // If the download is caused by typing in a downloadable URL, e.g.,
+ // http://example.com/somefile.zip, into the omnibox, the previous URL
+ // will reappear.
+ if (delegate())
+ delegate()->NavigationStateChanged(this, TabContents::INVALIDATE_URL);
}
void TabContents::WillClose(ConstrainedWindow* window) {