diff options
author | tommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-07 02:35:04 +0000 |
---|---|---|
committer | tommi@chromium.org <tommi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-07 02:35:04 +0000 |
commit | fc6fb7fbf9aca6b58f8c99a08a6c376b95bbc1a3 (patch) | |
tree | ca9186ed7ddbeb19604b495430d9c9814df57471 /chrome/browser/tab_contents | |
parent | cfc076ec466fc48e91c309448c4e5be3467b42c7 (diff) | |
download | chromium_src-fc6fb7fbf9aca6b58f8c99a08a6c376b95bbc1a3.zip chromium_src-fc6fb7fbf9aca6b58f8c99a08a6c376b95bbc1a3.tar.gz chromium_src-fc6fb7fbf9aca6b58f8c99a08a6c376b95bbc1a3.tar.bz2 |
Basic wiring to enable downloads for CF's host browser network stack. A notable change here is that url automation job id's no longer exist and instead a request id is used. There's a 1 to 1 relation between a job and a request so this is more convenient.
Review URL: http://codereview.chromium.org/355036
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31363 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/tab_contents')
-rw-r--r-- | chrome/browser/tab_contents/tab_contents.cc | 7 | ||||
-rw-r--r-- | chrome/browser/tab_contents/tab_contents.h | 4 | ||||
-rw-r--r-- | chrome/browser/tab_contents/tab_contents_delegate.h | 4 |
3 files changed, 15 insertions, 0 deletions
diff --git a/chrome/browser/tab_contents/tab_contents.cc b/chrome/browser/tab_contents/tab_contents.cc index 4e45553..0d2ba96 100644 --- a/chrome/browser/tab_contents/tab_contents.cc +++ b/chrome/browser/tab_contents/tab_contents.cc @@ -1034,6 +1034,13 @@ void TabContents::ToolbarSizeChanged(bool is_animating) { d->ToolbarSizeChanged(this, is_animating); } +bool TabContents::CanDownload(int request_id) { + TabContentsDelegate* d = delegate(); + if (d) + return d->CanDownload(request_id); + return true; +} + void TabContents::OnStartDownload(DownloadItem* download) { DCHECK(download); diff --git a/chrome/browser/tab_contents/tab_contents.h b/chrome/browser/tab_contents/tab_contents.h index ad5de2f..ee25ef3 100644 --- a/chrome/browser/tab_contents/tab_contents.h +++ b/chrome/browser/tab_contents/tab_contents.h @@ -435,6 +435,10 @@ class TabContents : public PageNavigator, // Returns whether the extension shelf should be visible. virtual bool IsExtensionShelfAlwaysVisible(); + // 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); diff --git a/chrome/browser/tab_contents/tab_contents_delegate.h b/chrome/browser/tab_contents/tab_contents_delegate.h index 5f084ed..f5fdfcf 100644 --- a/chrome/browser/tab_contents/tab_contents_delegate.h +++ b/chrome/browser/tab_contents/tab_contents_delegate.h @@ -186,6 +186,10 @@ class TabContentsDelegate { return 0; } + virtual bool CanDownload(int request_id) { + return true; + } + virtual void OnStartDownload(DownloadItem* download) { } |