Chromium Code Reviews| 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..62f97c619927ab9353e24e262840d23f60626aac |
| --- /dev/null |
| +++ b/chrome/browser/android/webapk/webapk_metrics.h |
| @@ -0,0 +1,62 @@ |
| +// 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 { |
| + |
| +// 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 { |
| + // The user did not interact with the banner. |
| + 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. |
| + BANNER_DISMISSED_BEFORE_INSTALLATION, |
| + // The banner with the "Adding" button is dismissed during installation. |
| + BANNER_DISMISSED_DURING_INSTALLATION, |
| + INSTALL_COMPLETED, |
| + INSTALL_FAILED, |
| + INSTALL_EVENT_MAX, |
| +}; |
| + |
| +// The ways in which WebAPK instllation can be started. |
|
dominickn
2016/09/21 06:54:27
Nit: "installation"
Xi Han
2016/09/21 14:22:08
Sorry for the typo.
|
| +enum InstallStartType { |
| + STARTED_FROM_BANNER, |
| + STARTED_FROM_ADD_TO_HOME_SCREEN_MENU, |
|
dominickn
2016/09/21 06:54:28
General nit: change ADD_TO_HOME_SCREEN_MENU to jus
Xi Han
2016/09/21 14:22:08
Done.
|
| + START_TYPE_MAX, |
| +}; |
| + |
| +// The ways in which WebApk installation can be triggered. |
|
dominickn
2016/09/21 06:54:28
Splitting these histograms is the right move, but
Xi Han
2016/09/21 14:22:08
That is correct.
|
| +enum InstallTriggeredType { |
| + TRIGGERED_FROM_BANNER, |
| + TRIGGERED_FROM_ADD_TO_HOME_SCREEN_MENU, |
| + TRIGGERED_TYPE_MAX, |
| +}; |
| + |
| +// User actions after a WebAPK is installed. |
| +enum UserAction { |
| + // TODO(hanxi|zpeng): Records the first two user actions after |
| + // crbug.com/638614 is fixed. |
| + // Launch a previously installed WebAPK since the WebAPK has been installed on |
| + // the device before. |
| + USER_ACTION_OPEN, |
| + USER_ACTION_OPEN_DISMISS, |
| + // Open a newly installed WebAPK via a successful installation. |
| + USER_ACTION_INSTALLED_OPEN, |
| + USER_ACTION_INSTALLED_OPEN_DISMISS, |
| + USER_ACTION_MAX, |
| +}; |
| + |
| +void TrackInstallEvent(InstallEvent event); |
| +void TrackInstallStartType(InstallStartType event); |
| +void TrackInstallTriggeredType(InstallTriggeredType event); |
| +void TrackUserAction(UserAction event); |
| + |
| +}; // namespace webapk |
| + |
| +#endif // CHROME_BROWSER_ANDROID_WEBAPK_WEBAPK_METRICS_H_ |