OLD | NEW |
---|---|
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 Loading... | |
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 minimumSizeInPixel Minimal required size, if only a smaller favico n is available, null | |
Michael van Ouwerkerk
2017/03/28 11:23:56
nit: 'a null Bitmap'
jkrcal
2017/03/28 13:12:52
Done.
| |
83 * Bitmap is returned. | |
84 * @param desiredSizeInPixel If set to 0, it denotes that the favicon should be returned 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 minimumSizeInPixe l, | |
Bernhard Bauer
2017/03/28 10:11:05
Nit: The usual way to name unit variables is to ju
jkrcal
2017/03/28 13:12:53
Done.
| |
90 int desiredSizeInPixel, 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 } |
OLD | NEW |