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

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: review 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..172321b6c7467f7464f1022c05021f742fe8caae 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;
@@ -38,19 +39,29 @@ class CategoryInfo {
// Layout of the cards to be used to display suggestions in this category.
ContentSuggestionsCardLayout card_layout() const { return card_layout_; }
- // Whether the category supports a "More" button. The button either triggers
- // a fixed action (like opening a native page) or, if there is no such fixed
- // action, it queries the provider for more suggestions.
+ // Whether the category should show a "More" button even if it's empty. The
dgn 2016/10/26 16:00:33 "even if it's not empty". We already always show i
Marc Treib 2016/10/26 16:35:28 Good catch, thanks! Done.
+ // button either triggers a fixed action (like opening a native page) or, if
+ // there is no such fixed action, it queries the provider for more
+ // suggestions.
+ // TODO(treib): Rename this to "always_show_more_button".
bool has_more_button() const { return has_more_button_; }
// 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);
};
« no previous file with comments | « components/ntp_snippets/bookmarks/bookmark_suggestions_provider.cc ('k') | components/ntp_snippets/category_info.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698