OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_ANDROID_WEBAPK_WEBAPK_METRICS_H_ |
| 6 #define CHROME_BROWSER_ANDROID_WEBAPK_WEBAPK_METRICS_H_ |
| 7 |
| 8 namespace webapk { |
| 9 |
| 10 // Keep these enums up to date with tools/metrics/histograms/histograms.xml. |
| 11 // Events for WebAPKs installation flow. The sum of InstallEvent histogram |
| 12 // is the total number of times that a WebAPK infobar was triggered. |
| 13 enum InstallEvent { |
| 14 // The user did not interact with the infobar. |
| 15 INFOBAR_IGNORED, |
| 16 // The infobar with the "Add-to-Homescreen" button is dismissed before the |
| 17 // installation started. "Dismiss" means the user closes the infobar by |
| 18 // clicking the "X" button. |
| 19 INFOBAR_DISMISSED_BEFORE_INSTALLATION, |
| 20 // The infobar with the "Adding" button is dismissed during installation. |
| 21 INFOBAR_DISMISSED_DURING_INSTALLATION, |
| 22 INSTALL_COMPLETED, |
| 23 INSTALL_FAILED, |
| 24 INSTALL_EVENT_MAX, |
| 25 }; |
| 26 |
| 27 // The ways in which WebAPK installation can be started. |
| 28 enum InstallSource { |
| 29 INSTALL_SOURCE_BANNER, |
| 30 INSTALL_SOURCE_MENU, |
| 31 INSTALL_SOURCE_MAX, |
| 32 }; |
| 33 |
| 34 // The ways in which the WebAPK infobar can be shown. |
| 35 enum InfoBarShown { |
| 36 WEBAPK_INFOBAR_SHOWN_FROM_BANNER, |
| 37 WEBAPK_INFOBAR_SHOWN_FROM_MENU, |
| 38 WEBAPK_INFOBAR_SHOWN_MAX, |
| 39 }; |
| 40 |
| 41 // User actions after a WebAPK is installed. |
| 42 enum UserAction { |
| 43 // TODO(hanxi|zpeng): Records the first two user actions after |
| 44 // crbug.com/638614 is fixed. |
| 45 // Launch a previously installed WebAPK since the WebAPK has been installed on |
| 46 // the device before. |
| 47 USER_ACTION_OPEN, |
| 48 USER_ACTION_OPEN_DISMISS, |
| 49 // Open a newly installed WebAPK via a successful installation. |
| 50 USER_ACTION_INSTALLED_OPEN, |
| 51 USER_ACTION_INSTALLED_OPEN_DISMISS, |
| 52 USER_ACTION_MAX, |
| 53 }; |
| 54 |
| 55 void TrackInstallEvent(InstallEvent event); |
| 56 void TrackInstallSource(InstallSource event); |
| 57 void TrackInstallInfoBarShown(InfoBarShown event); |
| 58 void TrackUserAction(UserAction event); |
| 59 |
| 60 }; // namespace webapk |
| 61 |
| 62 #endif // CHROME_BROWSER_ANDROID_WEBAPK_WEBAPK_METRICS_H_ |
OLD | NEW |