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

Unified Diff: chrome/browser/download/download_manager.cc

Issue 6973035: Move download stuff to download tab helper. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Oops, forgot to add tab watcher as delegate with CF. Created 9 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 | « no previous file | chrome/browser/download/download_request_limiter.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/download/download_manager.cc
diff --git a/chrome/browser/download/download_manager.cc b/chrome/browser/download/download_manager.cc
index fb9fb7b033c3cd2c04eb3451e860e5844c69f5a7..54d937b1e2b245948a3f2a7e1f6b62206c063b85 100644
--- a/chrome/browser/download/download_manager.cc
+++ b/chrome/browser/download/download_manager.cc
@@ -33,6 +33,8 @@
#include "chrome/browser/tab_contents/tab_util.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_list.h"
+#include "chrome/browser/ui/download/download_tab_helper.h"
+#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
#include "chrome/common/chrome_paths.h"
#include "content/browser/browser_thread.h"
#include "content/browser/renderer_host/render_process_host.h"
@@ -1069,20 +1071,23 @@ void DownloadManager::ShowDownloadInBrowser(
// get this start completion event. If it does, tell the origin TabContents
// to display its download shelf.
TabContents* contents = process_handle->GetTabContents();
+ TabContentsWrapper* wrapper = NULL;
+ if (contents)
+ wrapper = TabContentsWrapper::GetCurrentWrapperForContents(contents);
// If the contents no longer exists, we start the download in the last active
// browser. This is not ideal but better than fully hiding the download from
// the user.
- if (!contents) {
+ if (!wrapper) {
Browser* last_active = BrowserList::GetLastActive();
if (last_active)
- contents = last_active->GetSelectedTabContents();
+ wrapper = last_active->GetSelectedTabContentsWrapper();
}
- if (!contents)
+ if (!wrapper)
return;
- contents->OnStartDownload(download);
+ wrapper->download_tab_helper()->OnStartDownload(download);
}
// Clears the last download path, used to initialize "save as" dialogs.
« no previous file with comments | « no previous file | chrome/browser/download/download_request_limiter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698