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..56ea64bcd82fa122bb524c04ab671c7e05d3f9c6 |
--- /dev/null |
+++ b/chrome/browser/android/webapk/webapk_metrics.h |
@@ -0,0 +1,56 @@ |
+// 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_ |
+ |
+namespace webapk { |
+ |
+// The states of WebAPK installation process. These states are tracked to |
+// record dismiss events for WebAPK installation. |
+enum InstallState { |
+ WAIT_FOR_START, |
+ INSTALLING, |
+ INSTALLED, |
+}; |
+ |
+// Keep these enums up to date with tools/metrics/histograms/histograms.xml. |
+// Events for WebAPKs installation flow. The sum of |InstalllEvent| histogram |
+// is the total number of times that a WebAPK infobar was triggered. |
+enum InstallEvent { |
dominickn
2016/09/19 01:38:39
I think if you get rid of the INSTALL_EVENT prefix
Xi Han
2016/09/20 18:25:18
Done.
|
+ // Banner is deleted due to the closing of Chrome or the associated tab. |
dominickn
2016/09/19 01:38:39
Nit: change comment to "The user did not interact
Xi Han
2016/09/20 18:25:18
Acknowledged.
|
+ INSTALL_EVENT_BANNER_IGNORED, |
+ // The banner with the "Add-to-Homescreen" button is dismissed before the |
+ // installation started. "Dismiss" means the user closes the banner by |
+ // clicking the "X" button. |
+ INSTALL_EVENT_ADD_TO_HOME_SCREEN_DISMISS, |
dominickn
2016/09/19 01:38:39
Call this BANNER_DISMISSED_BEFORE_INSTALLATION.
Xi Han
2016/09/20 18:25:19
Done.
|
+ // The banner with the "Adding" button is dismissed during installation. |
+ INSTALL_EVENT_ADDING_DISMISS, |
dominickn
2016/09/19 01:38:39
Call this DISMISSED_DURING_INSTALLATION
Xi Han
2016/09/20 18:25:19
Done.
|
+ INSTALL_EVENT_COMPLETED, |
+ INSTALL_EVENT_FAILED, |
+ INSTALL_EVENT_MAX, |
+}; |
+ |
+// The ways of how WebAPK instllation is triggered / started. |
dominickn
2016/09/19 01:38:39
Nit: "The ways in which WebAPK installation can be
Xi Han
2016/09/20 18:25:19
Done.
|
+enum StartType { |
+ TRIGGERED_FROM_BANNER, |
dominickn
2016/09/19 01:38:39
TRIGGERED and STARTED are pretty difficult to tell
Xi Han
2016/09/20 18:25:19
Hmm, how about introduce a "InstallTriggeredType"
|
+ STARTED_FROM_BANNER, |
+ STARTED_FROM_ADD_TO_HOME_SCREEN_MENU, |
+ START_TYPE_MAX, |
+}; |
+ |
+// User actions after a WebAPK is installed. |
+enum UserAction { |
+ USER_ACTION_INSTALLED_OPEN, |
+ USER_ACTION_INSTALLED_OPEN_DISMISS, |
+ USER_ACTION_MAX, |
+}; |
+ |
+void TrackInstallEvent(InstallEvent event); |
+void TrackStartType(StartType event); |
+void TrackUserAction(UserAction event); |
+ |
+}; // namespace webapk |
+ |
+#endif // CHROME_BROWSER_ANDROID_WEBAPK_WEBAPK_METRICS_H_ |