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

Unified Diff: components/ntp_snippets/content_suggestions_service.cc

Issue 2473483006: Adds a Fetch() method to the ContentSuggestionService which asks any provider to provide more conte… (Closed)
Patch Set: comments by Markus. Created 4 years, 1 month 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.cc
diff --git a/components/ntp_snippets/content_suggestions_service.cc b/components/ntp_snippets/content_suggestions_service.cc
index 9d037fa862f137b09324f4c42ed50214a959ea87..c1463e3c41868595e1ce47118ce863fcfadc9288 100644
--- a/components/ntp_snippets/content_suggestions_service.cc
+++ b/components/ntp_snippets/content_suggestions_service.cc
@@ -196,6 +196,17 @@ void ContentSuggestionsService::RegisterProvider(
providers_.push_back(std::move(provider));
}
+void ContentSuggestionsService::Fetch(
+ const Category& category,
+ const std::set<std::string>& known_suggestion_ids,
+ const FetchingCallback& callback) {
+ auto providers_it = providers_by_category_.find(category);
+ if (providers_it == providers_by_category_.end())
+ return;
+
+ providers_it->second->Fetch(category, known_suggestion_ids, callback);
+}
+
////////////////////////////////////////////////////////////////////////////////
// Private methods

Powered by Google App Engine
This is Rietveld 408576698