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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/profiles/MostVisitedSites.java

Issue 1373983003: Add UMA stats for which icon types are shown and clicked on the NTP. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed test Created 5 years, 3 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/profiles/MostVisitedSites.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/profiles/MostVisitedSites.java b/chrome/android/java/src/org/chromium/chrome/browser/profiles/MostVisitedSites.java
index ccd53453905aecad1ce9b28d0a928b45127a44ad..1256ef9c4d2e750ce660fe4bb945d2bd9c22fceb 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/profiles/MostVisitedSites.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/profiles/MostVisitedSites.java
@@ -25,8 +25,8 @@ public class MostVisitedSites {
*
* @param titles Array of most visited url page titles.
* @param urls Array of most visited URLs, including popular URLs if
- * available and necessary (i.e. there aren't enough most
- * visited URLs).
+ * available and necessary (i.e. there aren't enough most
+ * visited URLs).
*/
@CalledByNative("MostVisitedURLsObserver")
public void onMostVisitedURLsAvailable(String[] titles, String[] urls);
@@ -51,9 +51,11 @@ public class MostVisitedSites {
* Parameter may be null.
*
* @param thumbnail The bitmap thumbnail for the requested URL.
+ * @param isLocalThumbnail Whether the thumbnail was locally captured, as opposed to
+ * server-provided.
*/
@CalledByNative("ThumbnailCallback")
- public void onMostVisitedURLsThumbnailAvailable(Bitmap thumbnail);
+ public void onMostVisitedURLsThumbnailAvailable(Bitmap thumbnail, boolean isLocalThumbnail);
}
/**
@@ -79,7 +81,8 @@ public class MostVisitedSites {
* after any changes to the list. Note: the observer may be notified synchronously or
* asynchronously.
* @param observer The MostVisitedURLsObserver to be called once when the most visited sites
- * are initially available and again whenever the list of most visited sites changes.
+ * are initially available and again whenever the list of most visited sites
+ * changes.
* @param numSites The maximum number of most visited sites to return.
*/
public void setMostVisitedURLsObserver(final MostVisitedURLsObserver observer, int numSites) {
@@ -111,10 +114,11 @@ public class MostVisitedSites {
public void getURLThumbnail(String url, final ThumbnailCallback callback) {
ThumbnailCallback wrappedCallback = new ThumbnailCallback() {
@Override
- public void onMostVisitedURLsThumbnailAvailable(Bitmap thumbnail) {
+ public void onMostVisitedURLsThumbnailAvailable(Bitmap thumbnail,
+ boolean isLocalThumbnail) {
// Don't notify callback if we've already been destroyed.
if (mNativeMostVisitedSites != 0) {
- callback.onMostVisitedURLsThumbnailAvailable(thumbnail);
+ callback.onMostVisitedURLsThumbnailAvailable(thumbnail, isLocalThumbnail);
}
}
};
@@ -122,7 +126,7 @@ public class MostVisitedSites {
}
/**
- * Blacklist a URL from the most visited URLs list.
+ * Blacklists a URL from the most visited URLs list.
* @param url The URL to be blacklisted.
*/
public void blacklistUrl(String url) {
@@ -130,28 +134,35 @@ public class MostVisitedSites {
}
/**
- * Called when the loading of the Most Visited page is complete.
+ * Records metrics about which types of tiles are displayed.
+ * @param tileTypes An array of values from MostVisitedTileType indicating the type of each
+ * tile that's currently showing.
+ * @paral isIconMode Whether the icon-based version of the NTP is showing (as opposed to the
+ * thumbnail-based version).
*/
- public void onLoadingComplete() {
- nativeOnLoadingComplete(mNativeMostVisitedSites);
+ public void recordTileTypeMetrics(int[] tileTypes, boolean isIconMode) {
+ nativeRecordTileTypeMetrics(mNativeMostVisitedSites, tileTypes, isIconMode);
}
/**
- * Record the opening of a Most Visited Item.
+ * Records the opening of a Most Visited Item.
* @param index The index of the item that was opened.
+ * @param tileType The visual type of the item. Valid values are listed in MostVisitedTileType.
*/
- public void recordOpenedMostVisitedItem(int index) {
- nativeRecordOpenedMostVisitedItem(mNativeMostVisitedSites, index);
+ public void recordOpenedMostVisitedItem(int index, int tileType) {
+ nativeRecordOpenedMostVisitedItem(mNativeMostVisitedSites, index, tileType);
}
private native long nativeInit(Profile profile);
private native void nativeDestroy(long nativeMostVisitedSites);
- private native void nativeOnLoadingComplete(long nativeMostVisitedSites);
private native void nativeSetMostVisitedURLsObserver(long nativeMostVisitedSites,
MostVisitedURLsObserver observer, int numSites);
private native void nativeGetURLThumbnail(long nativeMostVisitedSites, String url,
ThumbnailCallback callback);
private native void nativeBlacklistUrl(long nativeMostVisitedSites, String url);
- private native void nativeRecordOpenedMostVisitedItem(long nativeMostVisitedSites, int index);
+ private native void nativeRecordTileTypeMetrics(long nativeMostVisitedSites, int[] tileTypes,
+ boolean isIconMode);
+ private native void nativeRecordOpenedMostVisitedItem(long nativeMostVisitedSites, int index,
+ int tileType);
}

Powered by Google App Engine
This is Rietveld 408576698