Index: components/infobars/core/infobar_container.cc |
diff --git a/components/infobars/core/infobar_container.cc b/components/infobars/core/infobar_container.cc |
index 90ba064d4e0b6dca083a14c0e7c0c1589c5e166d..faba7e3dd4874d99af8ae7b8b53cc7acd110e476 100644 |
--- a/components/infobars/core/infobar_container.cc |
+++ b/components/infobars/core/infobar_container.cc |
@@ -8,6 +8,9 @@ |
#include "base/auto_reset.h" |
#include "base/logging.h" |
+#include "base/metrics/histogram_base.h" |
+#include "base/metrics/metrics_hashes.h" |
+#include "base/metrics/sparse_histogram.h" |
#include "build/build_config.h" |
#include "components/infobars/core/infobar.h" |
#include "components/infobars/core/infobar_delegate.h" |
@@ -152,6 +155,11 @@ void InfoBarContainer::AddInfoBar(InfoBar* infobar, |
PlatformSpecificAddInfoBar(infobar, position); |
infobar->set_container(this); |
infobar->Show(animate); |
+ |
+ // Record the infobar being displayed. |
+ int hashed_id = static_cast<base::HistogramBase::Sample>( |
Ilya Sherman
2015/12/16 23:41:52
nit: It's weird to cast to a base::HistogramBase::
Ilya Sherman
2015/12/16 23:41:52
nit: You might want to use one of the more explici
gone
2015/12/17 00:34:59
Swapped it over to storing a Sample. Thanks for t
|
+ base::HashMetricName(infobar->delegate()->GetIdentifier())); |
+ UMA_HISTOGRAM_SPARSE_SLOWLY("InfoBar.Added", hashed_id); |
} |
} // namespace infobars |