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

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

Issue 1272883004: Popular sites on the NTP: Favicons! (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@enable_popular_sites
Patch Set: . Created 5 years, 4 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 8e7474218ef142e40a37068a440f2d2b47eeee18..ccd53453905aecad1ce9b28d0a928b45127a44ad 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
@@ -24,10 +24,22 @@ public class MostVisitedSites {
* Parameters guaranteed to be non-null.
*
* @param titles Array of most visited url page titles.
- * @param urls Array of most visited urls.
+ * @param urls Array of most visited URLs, including popular URLs if
+ * available and necessary (i.e. there aren't enough most
+ * visited URLs).
*/
@CalledByNative("MostVisitedURLsObserver")
public void onMostVisitedURLsAvailable(String[] titles, String[] urls);
+
+ /**
+ * This is called when the list of popular URLs is initially available or updated.
+ * Parameters guaranteed to be non-null.
+ *
+ * @param urls Array of popular URLs.
+ * @param faviconUrls Array of URLs for the corresponding favicons (if known).
+ */
+ @CalledByNative("MostVisitedURLsObserver")
+ public void onPopularURLsAvailable(String[] urls, String[] faviconUrls);
}
/**
@@ -79,6 +91,13 @@ public class MostVisitedSites {
observer.onMostVisitedURLsAvailable(titles, urls);
}
}
+ @Override
+ public void onPopularURLsAvailable(String[] urls, String[] faviconUrls) {
+ // Don't notify observer if we've already been destroyed.
+ if (mNativeMostVisitedSites != 0) {
+ observer.onPopularURLsAvailable(urls, faviconUrls);
+ }
+ }
};
nativeSetMostVisitedURLsObserver(mNativeMostVisitedSites, wrappedObserver, numSites);
}

Powered by Google App Engine
This is Rietveld 408576698