| 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"
|
| +
|
| +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.
|
| +// 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,
|
| + // The banner with the "Add-to-Homescreen" button is dismissed before the
|
| + // installation stared. The *_DISMISS events are the cases that user
|
| + // 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_
|
|
|