OLD | NEW |
---|---|
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 package org.chromium.chrome.browser.metrics; | 5 package org.chromium.chrome.browser.metrics; |
6 | 6 |
7 import org.chromium.base.metrics.RecordHistogram; | 7 import org.chromium.base.metrics.RecordHistogram; |
8 | 8 |
9 /** | 9 /** |
10 * Centralizes UMA data collection for WebAPKs. NOTE: Histogram names and values are defined in | 10 * Centralizes UMA data collection for WebAPKs. NOTE: Histogram names and values are defined in |
(...skipping 11 matching lines...) Expand all Loading... | |
22 public static final int UPDATE_REQUEST_QUEUED_ONCE = 0; | 22 public static final int UPDATE_REQUEST_QUEUED_ONCE = 0; |
23 public static final int UPDATE_REQUEST_QUEUED_TWICE = 1; | 23 public static final int UPDATE_REQUEST_QUEUED_TWICE = 1; |
24 public static final int UPDATE_REQUEST_QUEUED_THREE_TIMES = 2; | 24 public static final int UPDATE_REQUEST_QUEUED_THREE_TIMES = 2; |
25 public static final int UPDATE_REQUEST_QUEUED_MAX = 3; | 25 public static final int UPDATE_REQUEST_QUEUED_MAX = 3; |
26 | 26 |
27 public static final String HISTOGRAM_UPDATE_REQUEST_SENT = | 27 public static final String HISTOGRAM_UPDATE_REQUEST_SENT = |
28 "WebApk.Update.RequestSent"; | 28 "WebApk.Update.RequestSent"; |
29 | 29 |
30 public static final String HISTOGRAM_UPDATE_REQUEST_QUEUED = "WebApk.Update. RequestQueued"; | 30 public static final String HISTOGRAM_UPDATE_REQUEST_QUEUED = "WebApk.Update. RequestQueued"; |
31 | 31 |
32 private static final String WEBAPK_OPEN_NAME = "WebApk.OpenFromMenu"; | |
33 private static final int WEBAPK_OPEN_MAX = 3; | |
34 public static final int WEBAPK_OPEN_LAUNCH_SUCCESS = 0; | |
35 public static final int WEBAPK_OPEN_NO_LAUNCH_INTENT = 1; | |
36 public static final int WEBAPK_OPEN_ACTIVITY_NOT_FOUND = 2; | |
37 | |
32 /** | 38 /** |
33 * Records the time point when a request to update a WebAPK is sent to the W ebAPK Server. | 39 * Records the time point when a request to update a WebAPK is sent to the W ebAPK Server. |
34 * @param type representing when the update request is sent to the WebAPK se rver. | 40 * @param type representing when the update request is sent to the WebAPK se rver. |
35 */ | 41 */ |
36 public static void recordUpdateRequestSent(int type) { | 42 public static void recordUpdateRequestSent(int type) { |
37 assert type >= 0 && type < UPDATE_REQUEST_SENT_MAX; | 43 assert type >= 0 && type < UPDATE_REQUEST_SENT_MAX; |
38 RecordHistogram.recordEnumeratedHistogram(HISTOGRAM_UPDATE_REQUEST_SENT, | 44 RecordHistogram.recordEnumeratedHistogram(HISTOGRAM_UPDATE_REQUEST_SENT, |
39 type, UPDATE_REQUEST_SENT_MAX); | 45 type, UPDATE_REQUEST_SENT_MAX); |
40 } | 46 } |
41 | 47 |
42 /** | 48 /** |
43 * Records the times that an update request has been queued once, twice and three times before | 49 * Records the times that an update request has been queued once, twice and three times before |
44 * sending to WebAPK server. | 50 * sending to WebAPK server. |
45 * @param times representing the times that an update has been queued. | 51 * @param times representing the times that an update has been queued. |
46 */ | 52 */ |
47 public static void recordUpdateRequestQueued(int times) { | 53 public static void recordUpdateRequestQueued(int times) { |
48 RecordHistogram.recordEnumeratedHistogram(HISTOGRAM_UPDATE_REQUEST_QUEUE D, times, | 54 RecordHistogram.recordEnumeratedHistogram(HISTOGRAM_UPDATE_REQUEST_QUEUE D, times, |
49 UPDATE_REQUEST_QUEUED_MAX); | 55 UPDATE_REQUEST_QUEUED_MAX); |
50 } | 56 } |
57 | |
58 /** | |
59 * When pressing on the Open WebAPK menu item, this records whether the WebA PK was opened | |
60 * successfully. | |
61 * @param type representing the result of trying to open a WebAPK. | |
62 */ | |
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
| |
63 public static void recordWebApkOpenAttempt(int type) { | |
64 assert type >= 0 && type < WEBAPK_OPEN_MAX; | |
65 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
| |
66 } | |
51 } | 67 } |
OLD | NEW |