| 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);
|
| }
|
|
|
|
|