Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(726)

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/metrics/WebApkUma.java

Issue 2707993003: [Android]: Hide add-to-homescreen app menu item when WebAPK is installed (Closed)
Patch Set: Add new state for 'Add to Homescreen' Menu item Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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;
+ 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);
+ }
}

Powered by Google App Engine
This is Rietveld 408576698