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/infobars/infobar_tab_helper.h" | |
7 #include "grit/generated_resources.h" | 8 #include "grit/generated_resources.h" |
8 #include "grit/theme_resources.h" | 9 #include "grit/theme_resources.h" |
9 #include "ui/base/l10n/l10n_util.h" | 10 #include "ui/base/l10n/l10n_util.h" |
10 #include "ui/base/resource/resource_bundle.h" | 11 #include "ui/base/resource/resource_bundle.h" |
11 | 12 |
12 DownloadRequestInfoBarDelegate::DownloadRequestInfoBarDelegate( | 13 DownloadRequestInfoBarDelegate::DownloadRequestInfoBarDelegate( |
13 InfoBarTabHelper* infobar_helper, | 14 InfoBarTabHelper* infobar_helper, |
14 DownloadRequestLimiter::TabDownloadState* host) | 15 DownloadRequestLimiter::TabDownloadState* host) |
15 : ConfirmInfoBarDelegate(infobar_helper), | 16 : ConfirmInfoBarDelegate(infobar_helper), |
erikwright (departed)
2012/08/16 17:25:38
The base class now takes a service, so the helper
Jói
2012/08/17 15:51:24
Done.
| |
16 host_(host) { | 17 host_(host) { |
17 } | 18 } |
18 | 19 |
19 DownloadRequestInfoBarDelegate::~DownloadRequestInfoBarDelegate() { | 20 DownloadRequestInfoBarDelegate::~DownloadRequestInfoBarDelegate() { |
20 if (host_) | 21 if (host_) |
21 host_->Cancel(); | 22 host_->Cancel(); |
22 } | 23 } |
23 | 24 |
24 gfx::Image* DownloadRequestInfoBarDelegate::GetIcon() const { | 25 gfx::Image* DownloadRequestInfoBarDelegate::GetIcon() const { |
25 return &ResourceBundle::GetSharedInstance().GetNativeImageNamed( | 26 return &ResourceBundle::GetSharedInstance().GetNativeImageNamed( |
(...skipping 11 matching lines...) Expand all Loading... | |
37 } | 38 } |
38 | 39 |
39 bool DownloadRequestInfoBarDelegate::Accept() { | 40 bool DownloadRequestInfoBarDelegate::Accept() { |
40 if (host_) { | 41 if (host_) { |
41 // Accept() call will nullify host_ if no further prompts are required. | 42 // Accept() call will nullify host_ if no further prompts are required. |
42 host_->Accept(); | 43 host_->Accept(); |
43 } | 44 } |
44 | 45 |
45 return !host_; | 46 return !host_; |
46 } | 47 } |
OLD | NEW |