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..5eb21d8e57ebe651a422dc09c270f272e79aace9 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"; |
| + public static final int WEBAPK_OPEN_LAUNCH_SUCCESS = 0; |
|
nyquist
2017/02/28 07:04:19
Could you add a comment about this enum that refer
gonzalon
2017/02/28 16:12:23
Done.
|
| + public static final int WEBAPK_OPEN_NO_LAUNCH_INTENT = 1; |
| + public static final int WEBAPK_OPEN_ACTIVITY_NOT_FOUND = 2; |
| + public static final int WEBAPK_OPEN_MAX = 3; |
| + |
| /** |
| * 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) { |
|
nyquist
2017/02/28 07:04:19
Any reason this isn't documented using @IntDef? Se
gonzalon
2017/02/28 16:12:23
I just followed the style on this file, I added th
nyquist
2017/02/28 17:57:17
Yeah, it's just for performance reasons.
|
| + assert type >= 0 && type < WEBAPK_OPEN_MAX; |
| + RecordHistogram.recordEnumeratedHistogram("WebApk.OpenFromMenu", type, WEBAPK_OPEN_MAX); |
| + } |
| } |