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

Unified Diff: chrome/browser/android/webapk/webapk_metrics.h

Issue 2301263004: Add WebAPK installation metrics. (Closed)
Patch Set: Created 4 years, 3 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/android/webapk/webapk_metrics.h
diff --git a/chrome/browser/android/webapk/webapk_metrics.h b/chrome/browser/android/webapk/webapk_metrics.h
new file mode 100644
index 0000000000000000000000000000000000000000..a5c25a56059415df20ed954cc122d5fa43b2536f
--- /dev/null
+++ b/chrome/browser/android/webapk/webapk_metrics.h
@@ -0,0 +1,54 @@
+// Copyright 2016 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.
+
+#ifndef CHROME_BROWSER_ANDROID_WEBAPK_WEBAPK_METRICS_H_
+#define CHROME_BROWSER_ANDROID_WEBAPK_WEBAPK_METRICS_H_
+
+#include "base/macros.h"
+
+namespace webapk {
+
+// This enum backs a UMA histogram, so it should be treated as append-only.
+enum InstallEvent {
+ INSTALL_EVENT_MIN = 0,
+ INSTALL_EVENT_ADD_FROM_BANNER_STARTED = 1,
+ INSTALL_EVENT_ADD_FROM_MENU_STARTED = 2,
+ INSTALL_EVENT_COMPLETED = 3,
+ INSTALL_EVENT_FAILED = 4,
+ INSTALL_EVENT_MAX = 5,
+};
+
+// This enum backs a UMA histogram, so it should be treated as append-only.
+enum DismissEvent {
+ DISMISS_EVENT_MIN = 10,
dominickn 2016/09/05 07:34:31 Start these enums from 0. The app banner ones don'
Xi Han 2016/09/07 20:58:52 I see, thanks, updated. Also, since I changed to U
+ DISMISS_EVENT_ADD_TO_HOMESCREEN = 11,
+ DISMISS_EVENT_ADDING = 12,
+ DISMISS_EVENT_OPEN = 13,
+ DISMISS_EVENT_MAX = 14,
+};
+
+// This enum backs a UMA histogram, so it should be treated as append-only.
+enum UserAction {
+ USER_ACTION_MIN = 20,
+ USER_ACTION_ADD_FROM_MENU = 21,
+ USER_ACTION_ADD_FROM_BANNER_ACCEPTED = 22,
+ USER_ACTION_INSTALLED_OPEN = 23,
+ // Banner is deleted due to the fact that user closes the associated tab
+ // or Chrome. The cases that user closes the banner (clicks
+ // the "X" button) are recorded in the |DissmissEvent|.
+ USER_ACTION_BANNER_IGNORED = 24,
+ USER_ACTION_MAX = 25,
+};
+
+extern const char kDismissEventHistogram[];
+extern const char kInstallEventHistogram[];
+extern const char kUserActionHistogram[];
+
+void TrackDismissEvent(int event);
+void TrackInstallEvent(int event);
+void TrackUserAction(int event);
+
+}; // namespace webapk
+
+#endif // CHROME_BROWSER_ANDROID_WEBAPK_WEBAPK_METRICS_H_

Powered by Google App Engine
This is Rietveld 408576698