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

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

Issue 2781583002: [Content suggestions] Add a function to the service API to fetch favicons (Closed)
Patch Set: Fix compilation #2 Created 3 years, 9 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/ntp/snippets/SuggestionsSource.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SuggestionsSource.java b/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SuggestionsSource.java
index 073147059a8ed649918b63bee512cfe476f0b4c0..cfc78b9e24fa091e302e5b6fb709fb63b09d9b02 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SuggestionsSource.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ntp/snippets/SuggestionsSource.java
@@ -76,6 +76,20 @@ public interface SuggestionsSource {
void fetchSuggestionImage(SnippetArticle suggestion, Callback<Bitmap> callback);
/**
+ * Fetches the favicon for a content suggestion. A null Bitmap is returned if no good favicon is
+ * available. The callback is never called synchronously.
+ * @param suggestion The suggestion which the favicon should represent.
+ * @param minimumSizePx Minimal required size, if only a smaller favicon is available, a null
+ * Bitmap is returned.
+ * @param desiredSizePx If set to 0, it denotes that the favicon should be returned in its
+ * original size (as in favicon cache) without being resized. If not 0, it must be larger or
+ * equal to the minimum size and the favicon will be returned resized to this size.
+ * @param callback The callback that receives the favicon image.
+ */
+ void fetchSuggestionFavicon(SnippetArticle suggestion, int minimumSizePx, int desiredSizePx,
+ Callback<Bitmap> callback);
+
+ /**
* Fetches new suggestions.
* @param category the category to fetch new suggestions for.
* @param displayedSuggestionIds ids of suggestions already known and that we want to keep.
@@ -101,4 +115,4 @@ public interface SuggestionsSource {
* Sets the recipient for update events from the source.
*/
void setObserver(Observer observer);
-}
+}

Powered by Google App Engine
This is Rietveld 408576698