1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "chrome/browser/banners/app_banner_metrics.h"
7 #include "base/metrics/histogram.h"
11 void TrackDismissEvent(int event
) {
12 std::vector
<int> codes
;
13 for (int i
= DISMISS_EVENT_MIN
+ 1; i
< DISMISS_EVENT_MAX
; ++i
) {
16 DCHECK(std::find(codes
.begin(), codes
.end(), event
) != codes
.end());
17 UMA_HISTOGRAM_CUSTOM_ENUMERATION("AppBanners.DismissEvent", event
, codes
);
20 void TrackDisplayEvent(int event
) {
21 std::vector
<int> codes
;
22 for (int i
= DISPLAY_EVENT_MIN
+ 1; i
< DISPLAY_EVENT_MAX
; ++i
) {
25 DCHECK(std::find(codes
.begin(), codes
.end(), event
) != codes
.end());
26 UMA_HISTOGRAM_CUSTOM_ENUMERATION("AppBanners.DisplayEvent", event
, codes
);
29 void TrackInstallEvent(int event
) {
30 std::vector
<int> codes
;
31 for (int i
= INSTALL_EVENT_MIN
+ 1; i
< INSTALL_EVENT_MAX
; ++i
) {
34 DCHECK(std::find(codes
.begin(), codes
.end(), event
) != codes
.end());
35 UMA_HISTOGRAM_CUSTOM_ENUMERATION("AppBanners.InstallEvent", event
, codes
);
38 } // namespace banners