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 1b9ecb839cb7d4cedb90f40dc88d6be2ce605fd9..3e52d1311bcece1757be9d202ca6d40c0d57c69a 100644 |
--- a/components/ntp_snippets/content_suggestions_service.cc |
+++ b/components/ntp_snippets/content_suggestions_service.cc |
@@ -48,6 +48,15 @@ CategoryStatus ContentSuggestionsService::GetCategoryStatus( |
return iterator->second->GetCategoryStatus(category); |
} |
+CategoryInfo ContentSuggestionsService::GetCategoryInfo( |
+ Category category) const { |
+ auto iterator = providers_by_category_.find(category); |
+ if (iterator == providers_by_category_.end()) |
+ return CategoryInfo(base::string16()); |
tschumann
2016/08/04 08:59:39
it might be better to explicitly signal the lookup
Marc Treib
2016/08/04 09:46:30
Explicitly signaling the failure might be good, bu
Philipp Keck
2016/08/04 11:48:18
base::Optional sounds good. We could so something
tschumann
2016/08/04 11:51:24
While that's possible, it would be nice to not rel
Philipp Keck
2016/08/08 14:50:18
Done.
|
+ |
+ return iterator->second->GetCategoryInfo(category); |
+} |
+ |
const std::vector<ContentSuggestion>& |
ContentSuggestionsService::GetSuggestionsForCategory(Category category) const { |
auto iterator = suggestions_by_category_.find(category); |