Chromium Code Reviews| 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); |
| }; |