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

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

Issue 2178833002: Add new app banner metrics using InstallableStatusCode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@banner-integrate-checker-no-refptr
Patch Set: Fix histogram name Created 4 years, 4 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 2015 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/banners/app_banner_metrics.h" 5 #include "chrome/browser/banners/app_banner_metrics.h"
6 6
7 #include "base/metrics/histogram_macros.h" 7 #include "base/metrics/histogram_macros.h"
8 #include "base/metrics/sparse_histogram.h" 8 #include "base/metrics/sparse_histogram.h"
9 #include "chrome/browser/installable/installable_logging.h"
9 10
10 namespace banners { 11 namespace banners {
11 12
12 const char kDismissEventHistogram[] = "AppBanners.DismissEvent"; 13 const char kDismissEventHistogram[] = "AppBanners.DismissEvent";
13 const char kDisplayEventHistogram[] = "AppBanners.DisplayEvent"; 14 const char kDisplayEventHistogram[] = "AppBanners.DisplayEvent";
14 const char kInstallEventHistogram[] = "AppBanners.InstallEvent"; 15 const char kInstallEventHistogram[] = "AppBanners.InstallEvent";
15 const char kMinutesHistogram[] = 16 const char kMinutesHistogram[] =
16 "AppBanners.MinutesFromFirstVisitToBannerShown"; 17 "AppBanners.MinutesFromFirstVisitToBannerShown";
17 const char kUserResponseHistogram[] = "AppBanners.UserResponse"; 18 const char kUserResponseHistogram[] = "AppBanners.UserResponse";
18 const char kBeforeInstallEventHistogram[] = "AppBanners.BeforeInstallEvent"; 19 const char kBeforeInstallEventHistogram[] = "AppBanners.BeforeInstallEvent";
20 const char kInstallableStatusCodeHistogram[] =
21 "AppBanners.InstallableStatusCode";
19 22
20 void TrackDismissEvent(int event) { 23 void TrackDismissEvent(int event) {
21 DCHECK_LT(DISMISS_EVENT_MIN, event); 24 DCHECK_LT(DISMISS_EVENT_MIN, event);
22 DCHECK_LT(event, DISMISS_EVENT_MAX); 25 DCHECK_LT(event, DISMISS_EVENT_MAX);
23 UMA_HISTOGRAM_SPARSE_SLOWLY(kDismissEventHistogram, event); 26 UMA_HISTOGRAM_SPARSE_SLOWLY(kDismissEventHistogram, event);
24 } 27 }
25 28
26 void TrackDisplayEvent(int event) { 29 void TrackDisplayEvent(int event) {
27 DCHECK_LT(DISPLAY_EVENT_MIN, event); 30 DCHECK_LT(DISPLAY_EVENT_MIN, event);
28 DCHECK_LT(event, DISPLAY_EVENT_MAX); 31 DCHECK_LT(event, DISPLAY_EVENT_MAX);
(...skipping 19 matching lines...) Expand all
48 DCHECK_LT(event, USER_RESPONSE_MAX); 51 DCHECK_LT(event, USER_RESPONSE_MAX);
49 UMA_HISTOGRAM_SPARSE_SLOWLY(kUserResponseHistogram, event); 52 UMA_HISTOGRAM_SPARSE_SLOWLY(kUserResponseHistogram, event);
50 } 53 }
51 54
52 void TrackBeforeInstallEvent(int event) { 55 void TrackBeforeInstallEvent(int event) {
53 DCHECK_LT(BEFORE_INSTALL_EVENT_MIN, event); 56 DCHECK_LT(BEFORE_INSTALL_EVENT_MIN, event);
54 DCHECK_LT(event, BEFORE_INSTALL_EVENT_MAX); 57 DCHECK_LT(event, BEFORE_INSTALL_EVENT_MAX);
55 UMA_HISTOGRAM_SPARSE_SLOWLY(kBeforeInstallEventHistogram, event); 58 UMA_HISTOGRAM_SPARSE_SLOWLY(kBeforeInstallEventHistogram, event);
56 } 59 }
57 60
61 void TrackInstallableStatusCode(InstallableStatusCode code) {
62 DCHECK_LE(NO_ERROR_DETECTED, code);
63 DCHECK_LT(code, MAX_ERROR_CODE);
64 UMA_HISTOGRAM_SPARSE_SLOWLY(kInstallableStatusCodeHistogram, code);
65 }
66
58 } // namespace banners 67 } // namespace banners
OLDNEW
« no previous file with comments | « chrome/browser/banners/app_banner_metrics.h ('k') | chrome/browser/banners/app_banner_settings_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698