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

Unified Diff: components/ntp_snippets/category_info.h

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/category_info.h
diff --git a/components/ntp_snippets/category_info.h b/components/ntp_snippets/category_info.h
index 1a659ed232da0099d91745ebbbab24c13a25490a..78cd53ce682f5783d79121a174076a698825d31c 100644
--- a/components/ntp_snippets/category_info.h
+++ b/components/ntp_snippets/category_info.h
@@ -26,7 +26,8 @@ class CategoryInfo {
CategoryInfo(const base::string16& title,
ContentSuggestionsCardLayout card_layout,
bool has_more_button,
- bool show_if_empty);
+ bool show_if_empty,
+ const base::string16& no_suggestions_message);
CategoryInfo(CategoryInfo&&) = default;
CategoryInfo& operator=(CategoryInfo&&) = default;
@@ -46,11 +47,19 @@ class CategoryInfo {
// Whether this category should be shown if it offers no suggestions.
bool show_if_empty() const { return show_if_empty_; }
+ // The message to show if there are no suggestions in this category. Note that
+ // this matters even if |show_if_empty()| is false: The message still shows
+ // up when the user dismisses all suggestions in the category.
+ const base::string16& no_suggestions_message() const {
+ return no_suggestions_message_;
+ }
+
private:
base::string16 title_;
ContentSuggestionsCardLayout card_layout_;
bool has_more_button_;
bool show_if_empty_;
+ base::string16 no_suggestions_message_;
DISALLOW_COPY_AND_ASSIGN(CategoryInfo);
};

Powered by Google App Engine
This is Rietveld 408576698