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..0f22289454c1515e55a1aadcb4f329be48a2397c 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,12 @@ public class WebApkUma { |
| public static final String HISTOGRAM_UPDATE_REQUEST_QUEUED = "WebApk.Update.RequestQueued"; |
| + private static final String WEBAPK_OPEN_NAME = "WebApk.OpenFromMenu"; |
| + private static final int WEBAPK_OPEN_MAX = 3; |
| + 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 +54,14 @@ public class WebApkUma { |
| RecordHistogram.recordEnumeratedHistogram(HISTOGRAM_UPDATE_REQUEST_QUEUED, times, |
| UPDATE_REQUEST_QUEUED_MAX); |
| } |
| + |
| + /** |
| + * When pressing on the Open WebAPK menu item, this records whether the WebAPK was opened |
| + * successfully. |
| + * @param type representing the result of trying to open a WebAPK. |
| + */ |
|
pkotwicz
2017/02/24 16:29:40
Nits:
"When pressing" -> "When a user presses"
"on
gonzalon
2017/02/24 16:41:29
Done, but the last change goes against the wording
|
| + public static void recordWebApkOpenAttempt(int type) { |
| + assert type >= 0 && type < WEBAPK_OPEN_MAX; |
| + RecordHistogram.recordEnumeratedHistogram(WEBAPK_OPEN_NAME, type, WEBAPK_OPEN_MAX); |
|
pkotwicz
2017/02/24 16:29:40
Nit: Just inline "WebApk.OpenFromMenu"
gonzalon
2017/02/24 16:41:29
Done, but this goes against the way it's done on t
|
| + } |
| } |