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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/ntp/InterestsItemView.java

Issue 1487373004: Metrics for user interests shown on the NTP. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@int
Patch Set: rebase Created 5 years 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/ntp/InterestsItemView.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/InterestsItemView.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/InterestsItemView.java
index 7acb3b7ad081e8319e60cdd87f027cba46f4d7d9..f7e7c2e689183713f40b3a9a4998a00a7c35c5ac 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/InterestsItemView.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/InterestsItemView.java
@@ -26,6 +26,7 @@ import android.view.View;
import android.view.View.OnClickListener;
import org.chromium.base.Log;
+import org.chromium.base.metrics.RecordHistogram;
import org.chromium.chrome.R;
import org.chromium.chrome.browser.ntp.InterestsPage.InterestsClickListener;
import org.chromium.chrome.browser.ntp.InterestsService.Interest;
@@ -232,9 +233,10 @@ class InterestsItemView extends AppCompatTextView implements OnClickListener {
*/
private class ImageDownloadedCallback {
public void onCallback(Drawable image, String url) {
- if (image == null) {
- return;
- }
+ boolean imageDownloadSuccess = image != null;
+ RecordHistogram.recordBooleanHistogram(
+ "NewTabPage.Interests.ImageDownloadSuccess", imageDownloadSuccess);
+ if (!imageDownloadSuccess) return;
// If the Interest this View is displaying has changed while downloading, do not update
// the image.
if (url == mInterest.getImageUrl()) {

Powered by Google App Engine
This is Rietveld 408576698