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 #include "base/macros.h" |
| 9 |
| 10 namespace webapk { |
| 11 |
| 12 // The states of WebAPK installation process. These states are tracked to |
| 13 // record dismiss events for WebAPK installation. |
| 14 enum InstallState { |
| 15 WAIT_FOR_START, |
| 16 INSTALLING, |
| 17 INSTALLED, |
| 18 }; |
| 19 |
| 20 // Keep these enums up to date with tools/metrics/histograms/histograms.xml. |
| 21 // The sum of |InstalllEvent| histogram is the total number of times that a |
| 22 // WebAPK infobar was triggered. |
| 23 enum InstallEvent { |
| 24 // Banner is deleted due to the closing of Chrome or the associated tab. |
| 25 INSTALL_EVENT_BANNER_IGNORED = 0, |
| 26 // The banner with the "Add-to-Homescreen" button is dismissed before the |
| 27 // installation stared. The *_DISMISS events are the cases that user |
| 28 // closes the banner by clicking the "X" button. |
| 29 INSTALL_EVENT_ADD_TO_HOME_SCREEN_DISMISS, |
| 30 // The banner with the "Adding" button is dismissed during installation. |
| 31 INSTALL_EVENT_ADDING_DISMISS, |
| 32 INSTALL_EVENT_COMPLETED, |
| 33 INSTALL_EVENT_FAILED, |
| 34 INSTALL_EVENT_MAX, |
| 35 }; |
| 36 |
| 37 enum StartType { |
| 38 TRIGGERED_FROM_BANNER = 0, |
| 39 STARTED_FROM_BANNER, |
| 40 STARTED_FROM_ADD_TO_HOME_SCREEN_MENU, |
| 41 START_TYPE_MAX, |
| 42 }; |
| 43 |
| 44 enum UserAction { |
| 45 USER_ACTION_INSTALLED_OPEN = 0, |
| 46 USER_ACTION_INSTALLED_OPEN_DISMISS, |
| 47 USER_ACTION_MAX, |
| 48 }; |
| 49 |
| 50 void TrackInstallEvent(InstallEvent event); |
| 51 void TrackStartType(StartType event); |
| 52 void TrackUserAction(UserAction event); |
| 53 |
| 54 }; // namespace webapk |
| 55 |
| 56 #endif // CHROME_BROWSER_ANDROID_WEBAPK_WEBAPK_METRICS_H_ |
OLD | NEW |