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

Unified Diff: components/ntp_snippets/ntp_snippets_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/ntp_snippets_service.cc
diff --git a/components/ntp_snippets/ntp_snippets_service.cc b/components/ntp_snippets/ntp_snippets_service.cc
index 6bda4d84dfd984546aa134f6013d6b02e90960ba..295acfbcd20c73bdc72e2300baca2449e4add84a 100644
--- a/components/ntp_snippets/ntp_snippets_service.cc
+++ b/components/ntp_snippets/ntp_snippets_service.cc
@@ -31,6 +31,8 @@
#include "components/prefs/pref_service.h"
#include "components/suggestions/proto/suggestions.pb.h"
#include "components/variations/variations_associated_data.h"
+#include "grit/components_strings.h"
+#include "ui/base/l10n/l10n_util.h"
#include "ui/gfx/image/image.h"
using image_fetcher::ImageDecoder;
@@ -279,6 +281,12 @@ CategoryStatus NTPSnippetsService::GetCategoryStatus(Category category) {
return category_status_;
}
+CategoryInfo NTPSnippetsService::GetCategoryInfo(Category category) {
+ return CategoryInfo(
+ l10n_util::GetStringUTF16(IDS_NTP_ARTICLE_SUGGESTIONS_SECTION_HEADER),
+ ContentSuggestionsCardLayout::FULL_CARD);
+}
+
void NTPSnippetsService::DismissSuggestion(const std::string& suggestion_id) {
if (!ready())
return;

Powered by Google App Engine
This is Rietveld 408576698