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..e9e89498b6ce534540bcd37b5d11a3260aa18842 |
| --- /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_ |
| + |
| +#include "base/macros.h" |
|
dominickn
2016/09/09 08:14:11
Nit: I don't think you use this header.
Xi Han
2016/09/09 15:37:32
Done.
|
| + |
| +namespace webapk { |
| + |
| +// The states of WebAPK installation process. These states are tracked to |
| +// record dismiss events for WebAPK installation. |
| +enum InstallState { |
|
dominickn
2016/09/09 08:14:12
Nit: histograms reviewer will probably ask you to
dominickn
2016/09/09 08:14:12
This is actually a DismissEvent enum - it's record
Xi Han
2016/09/09 15:37:32
Updated.
|
| + WAIT_FOR_START, |
| + INSTALLING, |
| + INSTALLED, |
| +}; |
| + |
| +// Keep these enums up to date with tools/metrics/histograms/histograms.xml. |
| +// The sum of |InstalllEvent| histogram is the total number of times that a |
| +// WebAPK infobar was triggered. |
| +enum InstallEvent { |
| + // Banner is deleted due to the closing of Chrome or the associated tab. |
| + INSTALL_EVENT_BANNER_IGNORED = 0, |
|
dominickn
2016/09/09 08:14:12
Nit: I don't think you need the explicit = 0 now.
Xi Han
2016/09/09 15:37:32
Done.
|
| + // The banner with the "Add-to-Homescreen" button is dismissed before the |
| + // installation stared. The *_DISMISS events are the cases that user |
|
dominickn
2016/09/09 08:14:12
Nit: installation started
Nit: that the user
Nit
Xi Han
2016/09/09 15:37:32
Updated to: "Dismiss" means the user closes the ba
|
| + // closes the banner by clicking the "X" button. |
| + INSTALL_EVENT_ADD_TO_HOME_SCREEN_DISMISS, |
| + // The banner with the "Adding" button is dismissed during installation. |
| + INSTALL_EVENT_ADDING_DISMISS, |
| + INSTALL_EVENT_COMPLETED, |
| + INSTALL_EVENT_FAILED, |
| + INSTALL_EVENT_MAX, |
| +}; |
| + |
| +enum StartType { |
| + TRIGGERED_FROM_BANNER = 0, |
| + STARTED_FROM_BANNER, |
| + STARTED_FROM_ADD_TO_HOME_SCREEN_MENU, |
| + START_TYPE_MAX, |
| +}; |
| + |
| +enum UserAction { |
| + USER_ACTION_INSTALLED_OPEN = 0, |
| + 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_ |