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

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

Issue 2006023002: Log some information about the state of the homepage on Android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: JNI doesn't support null strings :-/ Created 4 years, 7 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/LaunchMetrics.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/metrics/LaunchMetrics.java b/chrome/android/java/src/org/chromium/chrome/browser/metrics/LaunchMetrics.java
index cc9ef557bfb5ce06e3e8d141296869a90651b469..7bc17e812598c7f445d3774e88134b79744ef85c 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/metrics/LaunchMetrics.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/metrics/LaunchMetrics.java
@@ -190,7 +190,6 @@ public class LaunchMetrics {
* This intermediate step is necessary because Activity.onCreate() may be called when
* the native library has not yet been loaded.
* @param webContents WebContents for the current Tab.
- * @param application The ChromeApplication object.
*/
public static void commitLaunchMetrics(WebContents webContents) {
for (Pair<String, Integer> item : sActivityUrls) {
@@ -207,6 +206,23 @@ public class LaunchMetrics {
for (CachedHistogram event : CachedHistogram.sEvents) event.commitAndClear();
}
+ /**
+ * Records metrics about the state of the homepage on launch.
+ * @param showHomeButton Whether the home button is shown.
+ * @param homepageIsNtp Whether the homepage is set to the NTP.
+ * @param homepageUrl The value of the homepage URL.
+ */
+ public static void recordHomePageLaunchMetrics(
+ boolean showHomeButton, boolean homepageIsNtp, String homepageUrl) {
+ if (homepageUrl == null) {
+ homepageUrl = "";
+ assert !showHomeButton : "Homepage should be disabled for a null URL";
+ }
+ nativeRecordHomePageLaunchMetrics(showHomeButton, homepageIsNtp, homepageUrl);
+ }
+
private static native void nativeRecordLaunch(
boolean standalone, String url, int source, WebContents webContents);
+ private static native void nativeRecordHomePageLaunchMetrics(
+ boolean showHomeButton, boolean homepageIsNtp, String homepageUrl);
}

Powered by Google App Engine
This is Rietveld 408576698