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

Unified Diff: chrome/browser/ui/download/download_tab_helper.h

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 | « chrome/browser/ui/browser.cc ('k') | chrome/browser/ui/download/download_tab_helper.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/download/download_tab_helper.h
diff --git a/chrome/browser/ui/download/download_tab_helper.h b/chrome/browser/ui/download/download_tab_helper.h
index 24ab7fc75c5255437d9ca64c05d5aafc7bb22eed..ac559136eb7b74d2056acbd2bdd50d8c95cb87db 100644
--- a/chrome/browser/ui/download/download_tab_helper.h
+++ b/chrome/browser/ui/download/download_tab_helper.h
@@ -10,6 +10,8 @@
#include "chrome/browser/download/save_package.h"
#include "content/browser/tab_contents/tab_contents_observer.h"
+class DownloadItem;
+class DownloadTabHelperDelegate;
class TabContentsWrapper;
// Per-tab download controller. Handles dealing with various per-tab download
@@ -19,6 +21,9 @@ class DownloadTabHelper : public TabContentsObserver {
explicit DownloadTabHelper(TabContentsWrapper* tab_contents);
virtual ~DownloadTabHelper();
+ DownloadTabHelperDelegate* delegate() const { return delegate_; }
+ void set_delegate(DownloadTabHelperDelegate* d) { delegate_ = d; }
+
// Prepare for saving the current web page to disk.
void OnSavePage();
@@ -35,9 +40,17 @@ class DownloadTabHelper : public TabContentsObserver {
// Returns the SavePackage which manages the page saving job. May be NULL.
SavePackage* save_package() const { return save_package_.get(); }
+ // Notifies the delegate that a download is about to be started.
+ // This notification is fired before a local temporary file has been created.
+ bool CanDownload(int request_id);
+
+ // Notifies the delegate that a download started.
+ void OnStartDownload(DownloadItem* download);
+
private:
// TabContentsObserver overrides.
virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
+ virtual void DidGetUserGesture() OVERRIDE;
// SavePackage, lazily created.
scoped_refptr<SavePackage> save_package_;
@@ -45,6 +58,10 @@ class DownloadTabHelper : public TabContentsObserver {
// Owning TabContentsWrapper.
TabContentsWrapper* tab_contents_wrapper_;
+ // Delegate for notifying our owner (usually Browser) about stuff. Not owned
+ // by us.
+ DownloadTabHelperDelegate* delegate_;
+
DISALLOW_COPY_AND_ASSIGN(DownloadTabHelper);
};
« no previous file with comments | « chrome/browser/ui/browser.cc ('k') | chrome/browser/ui/download/download_tab_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698