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

Unified Diff: chrome/browser/download/download_manager_delegate.h

Issue 7640021: Move some Chrome-specific code paths out of DownloadManager and into the delegate. Getting rid of... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 4 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/download/download_manager.cc ('k') | chrome/browser/download/download_manager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/download/download_manager_delegate.h
===================================================================
--- chrome/browser/download/download_manager_delegate.h (revision 96577)
+++ chrome/browser/download/download_manager_delegate.h (working copy)
@@ -9,7 +9,6 @@
#include "base/basictypes.h"
#include "base/memory/weak_ptr.h"
-class DownloadManager;
class FilePath;
class TabContents;
class SavePackage;
@@ -17,31 +16,37 @@
// Browser's download manager: manages all downloads and destination view.
class DownloadManagerDelegate {
public:
+ // Notifies the delegate that a download is starting. The delegate can return
+ // false to delay the start of the download, in which case it should call
+ // DownloadManager::RestartDownload when it's ready.
+ virtual bool ShouldStartDownload(int32 download_id) = 0;
+
+ // Asks the user for the path for a download. The delegate calls
+ // DownloadManager::FileSelected or DownloadManager::FileSelectionCanceled to
+ // give the answer.
+ virtual void ChooseDownloadPath(TabContents* tab_contents,
+ const FilePath& suggested_path,
+ void* data) = 0;
+
+ // Called when the download system wants to alert a TabContents that a
+ // download has started, but the TabConetnts has gone away. This lets an
+ // embedder return an alternative TabContents. The embedder can return NULL.
+ virtual TabContents* GetAlternativeTabContentsToNotifyForDownload() = 0;
+
+ // Tests if a file type should be opened automatically.
+ virtual bool ShouldOpenFileBasedOnExtension(const FilePath& path) = 0;
+
// Retrieve the directories to save html pages and downloads to.
virtual void GetSaveDir(TabContents* tab_contents,
FilePath* website_save_dir,
FilePath* download_save_dir) = 0;
- // Asks the user for the path to save a page. The embedder calls
+ // Asks the user for the path to save a page. The delegate calls
// SavePackage::OnPathPicked to give the answer.
virtual void ChooseSavePath(const base::WeakPtr<SavePackage>& save_package,
const FilePath& suggested_path,
bool can_save_as_complete) = 0;
- // Asks the user for the path for a download. The embedder calls
- // DownloadManager::FileSelected or DownloadManager::FileSelectionCanceled to
- // give the answer.
- virtual void ChooseDownloadPath(DownloadManager* download_manager,
- TabContents* tab_contents,
- const FilePath& suggested_path,
- void* data) = 0;
-
- // Called when the download system wants to alert a TabContents that a
- // download has started, but the TabContents has gone away. This lets an
- // embedder return an alternative TabContents. The embedder can return NULL.
- virtual TabContents* GetAlternativeTabContentsToNotifyForDownload(
- DownloadManager* download_manager) = 0;
-
protected:
DownloadManagerDelegate() {}
virtual ~DownloadManagerDelegate() {}
« no previous file with comments | « chrome/browser/download/download_manager.cc ('k') | chrome/browser/download/download_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698