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

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

Issue 1520543004: Add method for identifying different InfoBars (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nit again 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.h
diff --git a/components/infobars/core/simple_alert_infobar_delegate.h b/components/infobars/core/simple_alert_infobar_delegate.h
index 23d7c375a7049d80efd53a255055107d540f2f72..2e47f9aed3f8eaf19ffae052ff03c52e507aa44d 100644
--- a/components/infobars/core/simple_alert_infobar_delegate.h
+++ b/components/infobars/core/simple_alert_infobar_delegate.h
@@ -20,26 +20,33 @@ class SimpleAlertInfoBarDelegate : public ConfirmInfoBarDelegate {
// Creates a simple alert infobar and delegate and adds the infobar to
// |infobar_manager|. If |vector_icon_id| is not VECTOR_ICON_NONE, it will be
// shown; otherwise, |icon_id| (if present) will be used as the icon.
- static void Create(infobars::InfoBarManager* infobar_manager,
- int icon_id,
- gfx::VectorIconId vector_icon_id,
- const base::string16& message,
- bool auto_expire);
+ // |infobar_identifier| names what class triggered the infobar for metrics.
+ static void 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);
private:
- SimpleAlertInfoBarDelegate(int icon_id,
- gfx::VectorIconId vector_icon_id,
- const base::string16& message,
- bool auto_expire);
+ SimpleAlertInfoBarDelegate(
+ infobars::InfoBarDelegate::InfoBarIdentifier infobar_identifier,
+ int icon_id,
+ gfx::VectorIconId vector_icon_id,
+ const base::string16& message,
+ bool auto_expire);
~SimpleAlertInfoBarDelegate() override;
// ConfirmInfoBarDelegate:
+ infobars::InfoBarDelegate::InfoBarIdentifier GetIdentifier() const override;
int GetIconId() const override;
gfx::VectorIconId GetVectorIconId() const override;
bool ShouldExpire(const NavigationDetails& details) const override;
base::string16 GetMessageText() const override;
int GetButtons() const override;
+ infobars::InfoBarDelegate::InfoBarIdentifier infobar_identifier_;
const int icon_id_;
gfx::VectorIconId vector_icon_id_;
base::string16 message_;
« no previous file with comments | « components/infobars/core/infobar_delegate.h ('k') | components/infobars/core/simple_alert_infobar_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698