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 a85e867a232649a3877bb6c100c303ea89beb936..7615e6f53dde612d1e313523653122629030b6c9 100644 |
| --- a/components/ntp_snippets/category_info.h |
| +++ b/components/ntp_snippets/category_info.h |
| @@ -20,13 +20,26 @@ enum class ContentSuggestionsCardLayout { |
| MINIMAL_CARD |
| }; |
| +// On Android builds, a Java counterpart will be generated for this enum. |
| +// GENERATED_JAVA_ENUM_PACKAGE: org.chromium.chrome.browser.ntp.snippets |
|
dgn
2017/03/17 13:45:27
I'd prefer if you used org.chromium.chrome.browser
gambard
2017/03/17 14:05:07
Done.
I took the same package as ContentSuggestion
|
| +enum class ContentSuggestionsAdditionalAction { |
| + // No additional action available. |
| + NONE, |
| + |
| + // More suggestions can be fetch using the Fetch methods with this category. |
|
dgn
2017/03/17 13:45:26
s/can be fetch/can be fetched/
gambard
2017/03/17 14:05:07
Done.
|
| + FETCH, |
| + |
| + // Open a new surface dedicated to the content related to this category. The |
| + // UI has to choose which surface to open. |
| + VIEW_ALL |
| +}; |
| + |
| // Contains static meta information about a Category. |
| class CategoryInfo { |
| public: |
| CategoryInfo(const base::string16& title, |
| ContentSuggestionsCardLayout card_layout, |
| - bool has_fetch_action, |
| - bool has_view_all_action, |
| + ContentSuggestionsAdditionalAction additional_action, |
| bool show_if_empty, |
| const base::string16& no_suggestions_message); |
| CategoryInfo() = delete; |
| @@ -42,13 +55,10 @@ 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 "Fetch" action, that triggers fetching more |
| - // suggestions for the category. |
| - bool has_fetch_action() const { return has_fetch_action_; } |
| - |
| - // Whether the category supports a "ViewAll" action, that triggers displaying |
| - // all the content related to the current categories. |
| - bool has_view_all_action() const { return has_view_all_action_; } |
| + // Supported action for the category. |
| + ContentSuggestionsAdditionalAction additional_action() const { |
| + return additional_action_; |
| + } |
| // Whether this category should be shown if it offers no suggestions. |
| bool show_if_empty() const { return show_if_empty_; } |
| @@ -64,9 +74,7 @@ class CategoryInfo { |
| base::string16 title_; |
| ContentSuggestionsCardLayout card_layout_; |
| - // Supported actions for the category. |
| - bool has_fetch_action_; |
| - bool has_view_all_action_; |
| + ContentSuggestionsAdditionalAction additional_action_; |
| // Whether to show the category if a fetch returns no suggestions. |
| bool show_if_empty_; |