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

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: DCHECK against empty base::Optional<CategoryInfo> in SnippetsInternals 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 5d39f48383fccc79f83a78e3147e8094a295a787..50f47a48657c1309091afe1268d375d910bf42d4 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);
« no previous file with comments | « components/ntp_snippets/content_suggestions_service.h ('k') | components/ntp_snippets/content_suggestions_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698