Chromium Code Reviews| Index: chrome/android/java/src/org/chromium/chrome/browser/metrics/WebApkUma.java |
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/metrics/WebApkUma.java b/chrome/android/java/src/org/chromium/chrome/browser/metrics/WebApkUma.java |
| index 87cb3db0ace0c30634d943f5cc5d1561357c5f4a..b91d1adc614e78ec0908c40a226aecd032f54c07 100644 |
| --- a/chrome/android/java/src/org/chromium/chrome/browser/metrics/WebApkUma.java |
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/metrics/WebApkUma.java |
| @@ -29,6 +29,11 @@ public class WebApkUma { |
| public static final String HISTOGRAM_UPDATE_REQUEST_QUEUED = "WebApk.Update.RequestQueued"; |
| + private static final int WEBAPK_OPEN_MAX = 3; |
|
dominickn
2017/02/27 02:21:21
By convention this should go at the end and probab
gonzalon
2017/02/27 18:37:35
Done.
|
| + public static final int WEBAPK_OPEN_LAUNCH_SUCCESS = 0; |
| + public static final int WEBAPK_OPEN_NO_LAUNCH_INTENT = 1; |
| + public static final int WEBAPK_OPEN_ACTIVITY_NOT_FOUND = 2; |
| + |
| /** |
| * Records the time point when a request to update a WebAPK is sent to the WebAPK Server. |
| * @param type representing when the update request is sent to the WebAPK server. |
| @@ -48,4 +53,14 @@ public class WebApkUma { |
| RecordHistogram.recordEnumeratedHistogram(HISTOGRAM_UPDATE_REQUEST_QUEUED, times, |
| UPDATE_REQUEST_QUEUED_MAX); |
| } |
| + |
| + /** |
| + * When a user presses on the "Open WebAPK" menu item, this records whether the WebAPK was |
| + * opened successfully. |
| + * @param type Result of trying to open WebAPK. |
| + */ |
| + public static void recordWebApkOpenAttempt(int type) { |
| + assert type >= 0 && type < WEBAPK_OPEN_MAX; |
| + RecordHistogram.recordEnumeratedHistogram("WebApk.OpenFromMenu", type, WEBAPK_OPEN_MAX); |
| + } |
| } |