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

Unified Diff: components/ntp_snippets/content_suggestions_service.cc

Issue 2207493002: Add CategoryInfo for meta information of content suggestions Categories (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use base::Optional for ContentSuggestionsService::GetCategoryInfo Created 4 years, 4 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.cc
diff --git a/components/ntp_snippets/content_suggestions_service.cc b/components/ntp_snippets/content_suggestions_service.cc
index 43ee91ef2542ea02ef3d1af0723761ffe8b84ee5..98c232621ce17b9565bf5d4e536951747d5b04ce 100644
--- a/components/ntp_snippets/content_suggestions_service.cc
+++ b/components/ntp_snippets/content_suggestions_service.cc
@@ -50,6 +50,14 @@ CategoryStatus ContentSuggestionsService::GetCategoryStatus(
return iterator->second->GetCategoryStatus(category);
}
+base::Optional<CategoryInfo> ContentSuggestionsService::GetCategoryInfo(
+ Category category) const {
+ auto iterator = providers_by_category_.find(category);
+ if (iterator == providers_by_category_.end())
+ return base::Optional<CategoryInfo>();
+ return iterator->second->GetCategoryInfo(category);
+}
+
const std::vector<ContentSuggestion>&
ContentSuggestionsService::GetSuggestionsForCategory(Category category) const {
auto iterator = suggestions_by_category_.find(category);

Powered by Google App Engine
This is Rietveld 408576698