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

Unified Diff: components/ntp_snippets/offline_pages/recent_tab_suggestions_provider.cc

Issue 2447163004: [NTP Snippets] Pass "no suggestions" message from the backend to the UI (Closed)
Patch Set: tests Created 4 years, 2 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/offline_pages/recent_tab_suggestions_provider.cc
diff --git a/components/ntp_snippets/offline_pages/recent_tab_suggestions_provider.cc b/components/ntp_snippets/offline_pages/recent_tab_suggestions_provider.cc
index 777e2a32254203dc78b58159c1def5634bc66d1a..7adbee26fd66e7f0fc020af461d032283cdd8a7f 100644
--- a/components/ntp_snippets/offline_pages/recent_tab_suggestions_provider.cc
+++ b/components/ntp_snippets/offline_pages/recent_tab_suggestions_provider.cc
@@ -74,17 +74,21 @@ CategoryStatus RecentTabSuggestionsProvider::GetCategoryStatus(
CategoryInfo RecentTabSuggestionsProvider::GetCategoryInfo(Category category) {
if (category == provided_category_) {
dgn 2016/10/26 14:05:40 why not a DCHECK here like the others?
Marc Treib 2016/10/26 14:29:09 No reason :) Done.
- return CategoryInfo(l10n_util::GetStringUTF16(
- IDS_NTP_RECENT_TAB_SUGGESTIONS_SECTION_HEADER),
- ContentSuggestionsCardLayout::MINIMAL_CARD,
- /*has_more_button=*/false,
- /*show_if_empty=*/false);
+ return CategoryInfo(
+ l10n_util::GetStringUTF16(
+ IDS_NTP_RECENT_TAB_SUGGESTIONS_SECTION_HEADER),
+ ContentSuggestionsCardLayout::MINIMAL_CARD,
+ /*has_more_button=*/false,
+ /*show_if_empty=*/false,
+ l10n_util::GetStringUTF16(IDS_NTP_SUGGESTIONS_SECTION_EMPTY));
+ // TODO(vitaliii): Replace IDS_NTP_SUGGESTIONS_SECTION_EMPTY with a
+ // category-specific string.
}
NOTREACHED() << "Unknown category " << category.id();
return CategoryInfo(base::string16(),
ContentSuggestionsCardLayout::MINIMAL_CARD,
/*has_more_button=*/false,
- /*show_if_empty=*/false);
+ /*show_if_empty=*/false, base::string16());
}
void RecentTabSuggestionsProvider::DismissSuggestion(

Powered by Google App Engine
This is Rietveld 408576698