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

Unified Diff: components/infobars/core/simple_alert_infobar_delegate.cc

Issue 1520543004: Add method for identifying different InfoBars (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Missed a spot. Created 5 years 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 side-by-side diff with in-line comments
Download patch
Index: components/infobars/core/simple_alert_infobar_delegate.cc
diff --git a/components/infobars/core/simple_alert_infobar_delegate.cc b/components/infobars/core/simple_alert_infobar_delegate.cc
index ce84d8fbd97d2e07416a5f87b1304c2eb6b90dcf..51c98e9cf6dbc20618074ff713c7ff7d49d88101 100644
--- a/components/infobars/core/simple_alert_infobar_delegate.cc
+++ b/components/infobars/core/simple_alert_infobar_delegate.cc
@@ -11,21 +11,24 @@
// static
void SimpleAlertInfoBarDelegate::Create(
infobars::InfoBarManager* infobar_manager,
+ infobars::InfoBarDelegate::InfoBarIdentifier infobar_identifier,
int icon_id,
gfx::VectorIconId vector_icon_id,
const base::string16& message,
bool auto_expire) {
infobar_manager->AddInfoBar(infobar_manager->CreateConfirmInfoBar(
scoped_ptr<ConfirmInfoBarDelegate>(new SimpleAlertInfoBarDelegate(
- icon_id, vector_icon_id, message, auto_expire))));
+ infobar_identifier, icon_id, vector_icon_id, message, auto_expire))));
}
SimpleAlertInfoBarDelegate::SimpleAlertInfoBarDelegate(
+ infobars::InfoBarDelegate::InfoBarIdentifier infobar_identifier,
int icon_id,
gfx::VectorIconId vector_icon_id,
const base::string16& message,
bool auto_expire)
: ConfirmInfoBarDelegate(),
+ infobar_identifier_(infobar_identifier),
Peter Kasting 2015/12/30 01:52:57 I realized while reviewing this that we could avoi
gone 2015/12/30 07:29:03 Huh, that would have definitely made sense for thi
icon_id_(icon_id),
vector_icon_id_(vector_icon_id),
message_(message),
@@ -34,6 +37,11 @@ SimpleAlertInfoBarDelegate::SimpleAlertInfoBarDelegate(
SimpleAlertInfoBarDelegate::~SimpleAlertInfoBarDelegate() {
}
+infobars::InfoBarDelegate::InfoBarIdentifier
+SimpleAlertInfoBarDelegate::GetIdentifier() const {
+ return infobar_identifier_;
+}
+
int SimpleAlertInfoBarDelegate::GetIconId() const {
return icon_id_;
}

Powered by Google App Engine
This is Rietveld 408576698