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

Side by Side Diff: chrome/browser/banners/app_banner_metrics.cc

Issue 929533002: [App banners] Add UMA metrics (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@banner_cleanup
Patch Set: Fixing rebase Created 5 years, 10 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 2014 The Chromium Authors. All rights reserved. 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 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/android/banners/app_banner_utilities.h" 5 #include "chrome/browser/banners/app_banner_metrics.h"
6
7 #include <algorithm>
8 #include <string>
9 6
10 #include "base/metrics/histogram.h" 7 #include "base/metrics/histogram.h"
11 #include "chrome/browser/android/banners/app_banner_metrics_ids.h"
12 8
13 namespace banners { 9 namespace banners {
14 10
15 void TrackDismissEvent(int event) { 11 void TrackDismissEvent(int event) {
16 std::vector<int> codes; 12 std::vector<int> codes;
17 for (int i = DISMISS_MIN + 1; i < DISMISS_MAX; ++i) { 13 for (int i = DISMISS_EVENT_MIN + 1; i < DISMISS_EVENT_MAX; ++i) {
18 codes.push_back(i); 14 codes.push_back(i);
19 } 15 }
20 DCHECK(std::find(codes.begin(), codes.end(), event) != codes.end()); 16 DCHECK(std::find(codes.begin(), codes.end(), event) != codes.end());
21 UMA_HISTOGRAM_CUSTOM_ENUMERATION("AppBanners.DismissEvent", event, codes); 17 UMA_HISTOGRAM_CUSTOM_ENUMERATION("AppBanners.DismissEvent", event, codes);
22 } 18 }
23 19
24 void TrackDisplayEvent(int event) { 20 void TrackDisplayEvent(int event) {
25 std::vector<int> codes; 21 std::vector<int> codes;
26 for (int i = DISPLAY_MIN + 1; i < DISPLAY_MAX; ++i) { 22 for (int i = DISPLAY_EVENT_MIN + 1; i < DISPLAY_EVENT_MAX; ++i) {
27 codes.push_back(i); 23 codes.push_back(i);
28 } 24 }
29 DCHECK(std::find(codes.begin(), codes.end(), event) != codes.end()); 25 DCHECK(std::find(codes.begin(), codes.end(), event) != codes.end());
30 UMA_HISTOGRAM_CUSTOM_ENUMERATION("AppBanners.DisplayEvent", event, codes); 26 UMA_HISTOGRAM_CUSTOM_ENUMERATION("AppBanners.DisplayEvent", event, codes);
31 } 27 }
32 28
33 void TrackInstallEvent(int event) { 29 void TrackInstallEvent(int event) {
34 std::vector<int> codes; 30 std::vector<int> codes;
35 for (int i = INSTALL_MIN + 1; i < INSTALL_MAX; ++i) { 31 for (int i = INSTALL_EVENT_MIN + 1; i < INSTALL_EVENT_MAX; ++i) {
36 codes.push_back(i); 32 codes.push_back(i);
37 } 33 }
38 DCHECK(std::find(codes.begin(), codes.end(), event) != codes.end()); 34 DCHECK(std::find(codes.begin(), codes.end(), event) != codes.end());
39 UMA_HISTOGRAM_CUSTOM_ENUMERATION("AppBanners.InstallEvent", event, codes); 35 UMA_HISTOGRAM_CUSTOM_ENUMERATION("AppBanners.InstallEvent", event, codes);
40 } 36 }
41 37
42 } // namespace banners 38 } // namespace banners
OLDNEW
« no previous file with comments | « chrome/browser/banners/app_banner_metrics.h ('k') | chrome/browser/banners/app_banner_settings_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698