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

Unified Diff: components/ntp_snippets/content_suggestions_service.h

Issue 2781583002: [Content suggestions] Add a function to the service API to fetch favicons (Closed)
Patch Set: Expand the FakeSuggestionsSource 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: components/ntp_snippets/content_suggestions_service.h
diff --git a/components/ntp_snippets/content_suggestions_service.h b/components/ntp_snippets/content_suggestions_service.h
index b207e065b472820fe6117cb086385d66c4ad46d2..fc0b2fc60250bfde9101b3d91d327ff7a2811000 100644
--- a/components/ntp_snippets/content_suggestions_service.h
+++ b/components/ntp_snippets/content_suggestions_service.h
@@ -124,6 +124,16 @@ class ContentSuggestionsService : public KeyedService,
void FetchSuggestionImage(const ContentSuggestion::ID& suggestion_id,
const ImageFetchedCallback& callback);
+ // Fetches the favicon from local cache (if larger than
Michael van Ouwerkerk 2017/03/28 11:23:56 "large than", or "larger than or equal to"?
jkrcal 2017/03/28 13:12:53 Done.
+ // |minimum_size_in_pixel|) or from Google server (if there is no icon in the
+ // cache) and returns the resuls in the callback. If that suggestion doesn't
Michael van Ouwerkerk 2017/03/28 11:23:56 s/resuls/results/
jkrcal 2017/03/28 13:12:53 Done.
+ // exist or the fetch fails, the callback gets an empty image. The callback
Michael van Ouwerkerk 2017/03/28 11:23:56 In the Java docs, it says we may get a null Bitmap
jkrcal 2017/03/28 13:12:53 The difference between c++ and java makes sense. "
+ // will not be called synchronously.
+ void FetchSuggestionFavicon(const ContentSuggestion::ID& suggestion_id,
+ int minimum_size_in_pixel,
+ int desired_size_in_pixel,
+ const ImageFetchedCallback& callback);
+
// Dismisses the suggestion with the given |suggestion_id|, if it exists.
// This will not trigger an update through the observers (i.e. providers must
// not call |Observer::OnNewSuggestions|).

Powered by Google App Engine
This is Rietveld 408576698