| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/webapk/webapk_metrics.h" | 5 #include "chrome/browser/android/webapk/webapk_metrics.h" |
| 6 | 6 |
| 7 #include "base/metrics/histogram_macros.h" | 7 #include "base/metrics/histogram_macros.h" |
| 8 #include "base/time/time.h" | 8 #include "base/time/time.h" |
| 9 #include "chrome/browser/android/webapk/chrome_webapk_host.h" | 9 #include "chrome/browser/android/webapk/chrome_webapk_host.h" |
| 10 | 10 |
| 11 namespace webapk { | 11 namespace webapk { |
| 12 | 12 |
| 13 const char kGooglePlayInstallState[] = "WebApk.Install.GooglePlayInstallState"; | 13 const char kGooglePlayInstallState[] = "WebApk.Install.GooglePlayInstallState"; |
| 14 const char kInstallDurationHistogram[] = "WebApk.Install.InstallDuration"; | 14 const char kInstallDurationHistogram[] = "WebApk.Install.InstallDuration"; |
| 15 const char kInstallEventHistogram[] = "WebApk.Install.InstallEvent"; | 15 const char kInstallEventHistogram[] = "WebApk.Install.InstallEvent"; |
| 16 const char kInstallSourceHistogram[] = "WebApk.Install.InstallSource"; | 16 const char kInstallSourceHistogram[] = "WebApk.Install.InstallSource"; |
| 17 const char kInfoBarShownHistogram[] = "WebApk.Install.InfoBarShown"; | 17 const char kInfoBarShownHistogram[] = "WebApk.Install.InfoBarShown"; |
| 18 const char kUserActionHistogram[] = "WebApk.Install.UserAction"; | 18 const char kUserActionHistogram[] = "WebApk.Install.UserAction"; |
| 19 | 19 |
| 20 void TrackRequestTokenDuration(base::TimeDelta delta) { |
| 21 UMA_HISTOGRAM_TIMES("WebApk.Install.RequestTokenDuration", delta); |
| 22 } |
| 23 |
| 20 void TrackInstallDuration(base::TimeDelta delta) { | 24 void TrackInstallDuration(base::TimeDelta delta) { |
| 21 UMA_HISTOGRAM_MEDIUM_TIMES(kInstallDurationHistogram, delta); | 25 UMA_HISTOGRAM_MEDIUM_TIMES(kInstallDurationHistogram, delta); |
| 22 } | 26 } |
| 23 | 27 |
| 24 void TrackInstallEvent(InstallEvent event) { | 28 void TrackInstallEvent(InstallEvent event) { |
| 25 UMA_HISTOGRAM_ENUMERATION(kInstallEventHistogram, event, INSTALL_EVENT_MAX); | 29 UMA_HISTOGRAM_ENUMERATION(kInstallEventHistogram, event, INSTALL_EVENT_MAX); |
| 26 } | 30 } |
| 27 | 31 |
| 28 void TrackInstallSource(InstallSource event) { | 32 void TrackInstallSource(InstallSource event) { |
| 29 UMA_HISTOGRAM_ENUMERATION(kInstallSourceHistogram, event, INSTALL_SOURCE_MAX); | 33 UMA_HISTOGRAM_ENUMERATION(kInstallSourceHistogram, event, INSTALL_SOURCE_MAX); |
| 30 } | 34 } |
| 31 | 35 |
| 32 void TrackInstallInfoBarShown(InfoBarShown event) { | 36 void TrackInstallInfoBarShown(InfoBarShown event) { |
| 33 UMA_HISTOGRAM_ENUMERATION(kInfoBarShownHistogram, event, | 37 UMA_HISTOGRAM_ENUMERATION(kInfoBarShownHistogram, event, |
| 34 WEBAPK_INFOBAR_SHOWN_MAX); | 38 WEBAPK_INFOBAR_SHOWN_MAX); |
| 35 } | 39 } |
| 36 | 40 |
| 37 void TrackUserAction(UserAction event) { | 41 void TrackUserAction(UserAction event) { |
| 38 UMA_HISTOGRAM_ENUMERATION(kUserActionHistogram, event, USER_ACTION_MAX); | 42 UMA_HISTOGRAM_ENUMERATION(kUserActionHistogram, event, USER_ACTION_MAX); |
| 39 } | 43 } |
| 40 | 44 |
| 41 void TrackGooglePlayInstallState(GooglePlayInstallState state) { | 45 void TrackGooglePlayInstallState(GooglePlayInstallState state) { |
| 42 UMA_HISTOGRAM_ENUMERATION(kGooglePlayInstallState, static_cast<int>(state), | 46 UMA_HISTOGRAM_ENUMERATION(kGooglePlayInstallState, static_cast<int>(state), |
| 43 static_cast<int>(GooglePlayInstallState::MAX)); | 47 static_cast<int>(GooglePlayInstallState::MAX)); |
| 44 } | 48 } |
| 45 | 49 |
| 46 } // namespace webapk | 50 } // namespace webapk |
| OLD | NEW |