Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(854)

Side by Side Diff: chrome/browser/download/download_request_infobar_delegate_android.cc

Issue 1520543004: Add method for identifying different InfoBars (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nit again Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 "components/infobars/core/infobar.h" 9 #include "components/infobars/core/infobar.h"
10 #include "grit/theme_resources.h" 10 #include "grit/theme_resources.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 // static 47 // static
48 void DownloadRequestInfoBarDelegateAndroid::SetCallbackForTesting( 48 void DownloadRequestInfoBarDelegateAndroid::SetCallbackForTesting(
49 FakeCreateCallback* callback) { 49 FakeCreateCallback* callback) {
50 DownloadRequestInfoBarDelegateAndroid::callback_ = callback; 50 DownloadRequestInfoBarDelegateAndroid::callback_ = callback;
51 } 51 }
52 52
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
58 DownloadRequestInfoBarDelegateAndroid::GetIdentifier() const {
59 return DOWNLOAD_REQUEST_INFOBAR_DELEGATE_ANDROID;
60 }
61
57 int DownloadRequestInfoBarDelegateAndroid::GetIconId() const { 62 int DownloadRequestInfoBarDelegateAndroid::GetIconId() const {
58 return IDR_INFOBAR_MULTIPLE_DOWNLOADS; 63 return IDR_INFOBAR_MULTIPLE_DOWNLOADS;
59 } 64 }
60 65
61 base::string16 DownloadRequestInfoBarDelegateAndroid::GetMessageText() const { 66 base::string16 DownloadRequestInfoBarDelegateAndroid::GetMessageText() const {
62 return l10n_util::GetStringUTF16(IDS_MULTI_DOWNLOAD_WARNING); 67 return l10n_util::GetStringUTF16(IDS_MULTI_DOWNLOAD_WARNING);
63 } 68 }
64 69
65 base::string16 DownloadRequestInfoBarDelegateAndroid::GetButtonLabel( 70 base::string16 DownloadRequestInfoBarDelegateAndroid::GetButtonLabel(
66 InfoBarButton button) const { 71 InfoBarButton button) const {
(...skipping 14 matching lines...) Expand all
81 86
82 bool DownloadRequestInfoBarDelegateAndroid::Cancel() { 87 bool DownloadRequestInfoBarDelegateAndroid::Cancel() {
83 DCHECK(!responded_); 88 DCHECK(!responded_);
84 responded_ = true; 89 responded_ = true;
85 if (host_) { 90 if (host_) {
86 // This may invalidate |host_|. 91 // This may invalidate |host_|.
87 host_->Cancel(); 92 host_->Cancel();
88 } 93 }
89 return !host_; 94 return !host_;
90 } 95 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698