diff options
Diffstat (limited to 'chrome/browser/download/download_request_infobar_delegate.cc')
-rw-r--r-- | chrome/browser/download/download_request_infobar_delegate.cc | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/chrome/browser/download/download_request_infobar_delegate.cc b/chrome/browser/download/download_request_infobar_delegate.cc index 18184e4..b27ebb8 100644 --- a/chrome/browser/download/download_request_infobar_delegate.cc +++ b/chrome/browser/download/download_request_infobar_delegate.cc @@ -10,6 +10,19 @@ #include "ui/base/l10n/l10n_util.h" #include "ui/base/resource/resource_bundle.h" +DownloadRequestInfoBarDelegate::~DownloadRequestInfoBarDelegate() { + if (host_) + host_->Cancel(); +} + +// static +void DownloadRequestInfoBarDelegate::Create( + InfoBarService* infobar_service, + DownloadRequestLimiter::TabDownloadState* host) { + infobar_service->AddInfoBar(scoped_ptr<InfoBarDelegate>( + new DownloadRequestInfoBarDelegate(infobar_service, host))); +} + DownloadRequestInfoBarDelegate::DownloadRequestInfoBarDelegate( InfoBarService* infobar_service, DownloadRequestLimiter::TabDownloadState* host) @@ -17,11 +30,6 @@ DownloadRequestInfoBarDelegate::DownloadRequestInfoBarDelegate( host_(host) { } -DownloadRequestInfoBarDelegate::~DownloadRequestInfoBarDelegate() { - if (host_) - host_->Cancel(); -} - gfx::Image* DownloadRequestInfoBarDelegate::GetIcon() const { return &ResourceBundle::GetSharedInstance().GetNativeImageNamed( IDR_INFOBAR_MULTIPLE_DOWNLOADS); |