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