| 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_android.h" | 5 #include "chrome/browser/download/download_request_infobar_delegate_android.h" |
| 6 | 6 |
| 7 #include "chrome/browser/infobars/infobar_service.h" | 7 #include "chrome/browser/infobars/infobar_service.h" |
| 8 #include "chrome/grit/generated_resources.h" | 8 #include "chrome/grit/generated_resources.h" |
| 9 #include "chrome/grit/theme_resources.h" | 9 #include "chrome/grit/theme_resources.h" |
| 10 #include "components/infobars/core/infobar.h" | 10 #include "components/infobars/core/infobar.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 DownloadRequestInfoBarDelegateAndroid::DownloadRequestInfoBarDelegateAndroid( | 53 DownloadRequestInfoBarDelegateAndroid::DownloadRequestInfoBarDelegateAndroid( |
| 54 base::WeakPtr<DownloadRequestLimiter::TabDownloadState> host) | 54 base::WeakPtr<DownloadRequestLimiter::TabDownloadState> host) |
| 55 : ConfirmInfoBarDelegate(), responded_(false), host_(host) {} | 55 : ConfirmInfoBarDelegate(), responded_(false), host_(host) {} |
| 56 | 56 |
| 57 infobars::InfoBarDelegate::InfoBarIdentifier | 57 infobars::InfoBarDelegate::InfoBarIdentifier |
| 58 DownloadRequestInfoBarDelegateAndroid::GetIdentifier() const { | 58 DownloadRequestInfoBarDelegateAndroid::GetIdentifier() const { |
| 59 return DOWNLOAD_REQUEST_INFOBAR_DELEGATE_ANDROID; | 59 return DOWNLOAD_REQUEST_INFOBAR_DELEGATE_ANDROID; |
| 60 } | 60 } |
| 61 | 61 |
| 62 int DownloadRequestInfoBarDelegateAndroid::GetIconId() const { | 62 int DownloadRequestInfoBarDelegateAndroid::GetIconId() const { |
| 63 return IDR_INFOBAR_MULTIPLE_DOWNLOADS; | 63 return IDR_ANDROID_INFOBAR_MULTIPLE_DOWNLOADS; |
| 64 } | 64 } |
| 65 | 65 |
| 66 base::string16 DownloadRequestInfoBarDelegateAndroid::GetMessageText() const { | 66 base::string16 DownloadRequestInfoBarDelegateAndroid::GetMessageText() const { |
| 67 return l10n_util::GetStringUTF16(IDS_MULTI_DOWNLOAD_WARNING); | 67 return l10n_util::GetStringUTF16(IDS_MULTI_DOWNLOAD_WARNING); |
| 68 } | 68 } |
| 69 | 69 |
| 70 base::string16 DownloadRequestInfoBarDelegateAndroid::GetButtonLabel( | 70 base::string16 DownloadRequestInfoBarDelegateAndroid::GetButtonLabel( |
| 71 InfoBarButton button) const { | 71 InfoBarButton button) const { |
| 72 return l10n_util::GetStringUTF16((button == BUTTON_OK) | 72 return l10n_util::GetStringUTF16((button == BUTTON_OK) |
| 73 ? IDS_MULTI_DOWNLOAD_WARNING_ALLOW | 73 ? IDS_MULTI_DOWNLOAD_WARNING_ALLOW |
| (...skipping 12 matching lines...) Expand all Loading... |
| 86 | 86 |
| 87 bool DownloadRequestInfoBarDelegateAndroid::Cancel() { | 87 bool DownloadRequestInfoBarDelegateAndroid::Cancel() { |
| 88 DCHECK(!responded_); | 88 DCHECK(!responded_); |
| 89 responded_ = true; | 89 responded_ = true; |
| 90 if (host_) { | 90 if (host_) { |
| 91 // This may invalidate |host_|. | 91 // This may invalidate |host_|. |
| 92 host_->Cancel(); | 92 host_->Cancel(); |
| 93 } | 93 } |
| 94 return !host_; | 94 return !host_; |
| 95 } | 95 } |
| OLD | NEW |