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

Unified Diff: chrome/browser/installable/installable_metrics.cc

Issue 2778983005: Allow the app banner installability check to run on page load. (Closed)
Patch Set: Fix enum in test + minor improvements Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/installable/installable_metrics.cc
diff --git a/chrome/browser/installable/installable_metrics.cc b/chrome/browser/installable/installable_metrics.cc
new file mode 100644
index 0000000000000000000000000000000000000000..70ab65ec21345a25141ed3364571e462f0852002
--- /dev/null
+++ b/chrome/browser/installable/installable_metrics.cc
@@ -0,0 +1,26 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/installable/installable_metrics.h"
+
+#include "base/metrics/histogram_macros.h"
+
+namespace {
+
+const char kMenuOpenHistogram[] = "Webapp.InstallabilityCheckStatus.MenuOpen";
+const char kMenuItemAddToHomescreenHistogram[] =
+ "Webapp.InstallabilityCheckStatus.MenuItemAddToHomescreen";
Ilya Sherman 2017/03/31 17:03:15 Optional nit: I would go ahead and inline these na
dominickn 2017/04/03 00:06:46 Done.
+}
+
+void InstallableMetrics::RecordMenuOpenHistogram(
+ InstallabilityCheckStatus status) {
+ UMA_HISTOGRAM_ENUMERATION(kMenuOpenHistogram, status,
+ InstallabilityCheckStatus::MAX);
+}
+
+void InstallableMetrics::RecordMenuItemAddToHomescreenHistogram(
+ InstallabilityCheckStatus status) {
+ UMA_HISTOGRAM_ENUMERATION(kMenuItemAddToHomescreenHistogram, status,
+ InstallabilityCheckStatus::MAX);
+}

Powered by Google App Engine
This is Rietveld 408576698