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

Side by Side 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, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 package org.chromium.chrome.browser.ntp.snippets; 5 package org.chromium.chrome.browser.ntp.snippets;
6 6
7 import android.graphics.Bitmap; 7 import android.graphics.Bitmap;
8 8
9 import org.chromium.base.Callback; 9 import org.chromium.base.Callback;
10 import org.chromium.chrome.browser.ntp.cards.SuggestionsCategoryInfo; 10 import org.chromium.chrome.browser.ntp.cards.SuggestionsCategoryInfo;
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 */ 69 */
70 List<SnippetArticle> getSuggestionsForCategory(int category); 70 List<SnippetArticle> getSuggestionsForCategory(int category);
71 71
72 /** 72 /**
73 * Fetches the thumbnail image for a content suggestion. A null Bitmap is re turned if no image 73 * Fetches the thumbnail image for a content suggestion. A null Bitmap is re turned if no image
74 * is available. The callback is never called synchronously. 74 * is available. The callback is never called synchronously.
75 */ 75 */
76 void fetchSuggestionImage(SnippetArticle suggestion, Callback<Bitmap> callba ck); 76 void fetchSuggestionImage(SnippetArticle suggestion, Callback<Bitmap> callba ck);
77 77
78 /** 78 /**
79 * Fetches the favicon for a content suggestion. A null Bitmap is returned i f no good favicon is
80 * available. The callback is never called synchronously.
81 * @param suggestion The suggestion which the favicon should represent.
82 * @param minimumSizePx Minimal required size, if only a smaller favicon is available, a null
83 * Bitmap is returned.
84 * @param desiredSizePx If set to 0, it denotes that the favicon should be r eturned in its
85 * original size (as in favicon cache) without being resized. If not 0, it m ust be larger or
86 * equal to the minimum size and the favicon will be returned resized to thi s size.
87 * @param callback The callback that receives the favicon image.
88 */
89 void fetchSuggestionFavicon(SnippetArticle suggestion, int minimumSizePx, in t desiredSizePx,
90 Callback<Bitmap> callback);
91
92 /**
79 * Fetches new suggestions. 93 * Fetches new suggestions.
80 * @param category the category to fetch new suggestions for. 94 * @param category the category to fetch new suggestions for.
81 * @param displayedSuggestionIds ids of suggestions already known and that w e want to keep. 95 * @param displayedSuggestionIds ids of suggestions already known and that w e want to keep.
82 */ 96 */
83 void fetchSuggestions(@CategoryInt int category, String[] displayedSuggestio nIds); 97 void fetchSuggestions(@CategoryInt int category, String[] displayedSuggestio nIds);
84 98
85 /** 99 /**
86 * Tells the source to dismiss the content suggestion. 100 * Tells the source to dismiss the content suggestion.
87 */ 101 */
88 void dismissSuggestion(SnippetArticle suggestion); 102 void dismissSuggestion(SnippetArticle suggestion);
89 103
90 /** 104 /**
91 * Tells the source to dismiss the category. 105 * Tells the source to dismiss the category.
92 */ 106 */
93 void dismissCategory(@CategoryInt int category); 107 void dismissCategory(@CategoryInt int category);
94 108
95 /** 109 /**
96 * Restores all categories previously dismissed with {@link #dismissCategory }. 110 * Restores all categories previously dismissed with {@link #dismissCategory }.
97 */ 111 */
98 void restoreDismissedCategories(); 112 void restoreDismissedCategories();
99 113
100 /** 114 /**
101 * Sets the recipient for update events from the source. 115 * Sets the recipient for update events from the source.
102 */ 116 */
103 void setObserver(Observer observer); 117 void setObserver(Observer observer);
104 } 118 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698