| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/download/download_request_infobar_delegate.h" | 5 #include "chrome/browser/download/download_request_infobar_delegate.h" |
| 6 | 6 |
| 7 #include "chrome/browser/api/infobars/infobar_tab_service.h" | 7 #include "chrome/browser/api/infobars/infobar_service.h" |
| 8 #include "grit/generated_resources.h" | 8 #include "grit/generated_resources.h" |
| 9 #include "grit/theme_resources.h" | 9 #include "grit/theme_resources.h" |
| 10 #include "ui/base/l10n/l10n_util.h" | 10 #include "ui/base/l10n/l10n_util.h" |
| 11 #include "ui/base/resource/resource_bundle.h" | 11 #include "ui/base/resource/resource_bundle.h" |
| 12 | 12 |
| 13 DownloadRequestInfoBarDelegate::DownloadRequestInfoBarDelegate( | 13 DownloadRequestInfoBarDelegate::DownloadRequestInfoBarDelegate( |
| 14 InfoBarTabService* infobar_service, | 14 InfoBarService* infobar_service, |
| 15 DownloadRequestLimiter::TabDownloadState* host) | 15 DownloadRequestLimiter::TabDownloadState* host) |
| 16 : ConfirmInfoBarDelegate(infobar_service), | 16 : ConfirmInfoBarDelegate(infobar_service), |
| 17 host_(host) { | 17 host_(host) { |
| 18 } | 18 } |
| 19 | 19 |
| 20 DownloadRequestInfoBarDelegate::~DownloadRequestInfoBarDelegate() { | 20 DownloadRequestInfoBarDelegate::~DownloadRequestInfoBarDelegate() { |
| 21 if (host_) | 21 if (host_) |
| 22 host_->Cancel(); | 22 host_->Cancel(); |
| 23 } | 23 } |
| 24 | 24 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 38 } | 38 } |
| 39 | 39 |
| 40 bool DownloadRequestInfoBarDelegate::Accept() { | 40 bool DownloadRequestInfoBarDelegate::Accept() { |
| 41 if (host_) { | 41 if (host_) { |
| 42 // Accept() call will nullify host_ if no further prompts are required. | 42 // Accept() call will nullify host_ if no further prompts are required. |
| 43 host_->Accept(); | 43 host_->Accept(); |
| 44 } | 44 } |
| 45 | 45 |
| 46 return !host_; | 46 return !host_; |
| 47 } | 47 } |
| OLD | NEW |