diff options
author | avi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-16 18:36:46 +0000 |
---|---|---|
committer | avi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-16 18:36:46 +0000 |
commit | 487053c8c4adbf66a005566e2b1719c515bc08cc (patch) | |
tree | 737e6d1acc82a175df9b416429e6ecd428537152 /chrome/browser/external_tab_container_win.cc | |
parent | aab6a33baa61a3680f4cea67a63e6d4bd824c402 (diff) | |
download | chromium_src-487053c8c4adbf66a005566e2b1719c515bc08cc.zip chromium_src-487053c8c4adbf66a005566e2b1719c515bc08cc.tar.gz chromium_src-487053c8c4adbf66a005566e2b1719c515bc08cc.tar.bz2 |
Move download stuff to download tab helper.
BUG=71097
TEST=zero visible change in how the download system works
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=85486
Review URL: http://codereview.chromium.org/6973035
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85504 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/external_tab_container_win.cc')
-rw-r--r-- | chrome/browser/external_tab_container_win.cc | 49 |
1 files changed, 29 insertions, 20 deletions
diff --git a/chrome/browser/external_tab_container_win.cc b/chrome/browser/external_tab_container_win.cc index b3787d7..1ba4ee1 100644 --- a/chrome/browser/external_tab_container_win.cc +++ b/chrome/browser/external_tab_container_win.cc @@ -159,6 +159,7 @@ bool ExternalTabContainer::Init(Profile* profile, } tab_contents_->tab_contents()->set_delegate(this); + tab_contents_->download_tab_helper()->set_delegate(this); tab_contents_->tab_contents()-> GetMutableRendererPrefs()->browser_handles_top_level_requests = @@ -539,26 +540,6 @@ bool ExternalTabContainer::TakeFocus(bool reverse) { return true; } -bool ExternalTabContainer::CanDownload(int request_id) { - if (load_requests_via_automation_) { - if (automation_) { - // In case the host needs to show UI that needs to take the focus. - ::AllowSetForegroundWindow(ASFW_ANY); - - BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, - NewRunnableMethod(automation_resource_message_filter_.get(), - &AutomationResourceMessageFilter::SendDownloadRequestToHost, - 0, tab_handle_, request_id)); - } - } else { - DLOG(WARNING) << "Downloads are only supported with host browser network " - "stack enabled."; - } - - // Never allow downloads. - return false; -} - void ExternalTabContainer::ShowPageInfo(Profile* profile, const GURL& url, const NavigationEntry::SSLStatus& ssl, @@ -784,6 +765,34 @@ void ExternalTabContainer::Observe(NotificationType type, } //////////////////////////////////////////////////////////////////////////////// +// ExternalTabContainer, DownloadTabHelperDelegate overrides: + +bool ExternalTabContainer::CanDownload(int request_id) { + if (load_requests_via_automation_) { + if (automation_) { + // In case the host needs to show UI that needs to take the focus. + ::AllowSetForegroundWindow(ASFW_ANY); + + BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, + NewRunnableMethod(automation_resource_message_filter_.get(), + &AutomationResourceMessageFilter::SendDownloadRequestToHost, + 0, tab_handle_, request_id)); + } + } else { + DLOG(WARNING) << "Downloads are only supported with host browser network " + "stack enabled."; + } + + // Never allow downloads. + return false; +} + +void ExternalTabContainer::OnStartDownload(DownloadItem* download, + TabContentsWrapper* tab) { +} + + +//////////////////////////////////////////////////////////////////////////////// // ExternalTabContainer, views::WidgetWin overrides: LRESULT ExternalTabContainer::OnCreate(LPCREATESTRUCT create_struct) { |