Chromium Code Reviews| Index: components/ntp_snippets/content_suggestion.h |
| diff --git a/components/ntp_snippets/content_suggestion.h b/components/ntp_snippets/content_suggestion.h |
| index b2403f6c749ef97c3245abbaba77e7288dd6e952..937b62a6d0603b16f7d98ea7c59a60d9763e6a5a 100644 |
| --- a/components/ntp_snippets/content_suggestion.h |
| +++ b/components/ntp_snippets/content_suggestion.h |
| @@ -46,6 +46,24 @@ struct RecentTabSuggestionExtra { |
| int64_t offline_page_id = 0; |
| }; |
| +// ReadingListSuggestionExtra contains additional data which is only available |
| +// for Reading List suggestions. |
| +struct ReadingListSuggestionExtra { |
| + // State of the distillation a suggestion. This is a duplicate of |
| + // ReadingListEntry::DistillationState and should be kept sync. It is |
| + // duplicated here to prevent a dependence on ReadingList. |
| + enum class ReadingListSuggestionDistilledState { |
| + PROCESSING, |
| + SUCCESS, |
| + FAILURE |
| + }; |
| + |
| + // State of the distillation of the suggestion. |
| + ReadingListSuggestionDistilledState distilled_state; |
|
Marc Treib
2017/03/29 08:24:58
nit: Give this a default value? (Can be inline " =
gambard
2017/03/29 09:54:07
Done.
|
| + // URL of the page whose favicon should be displayed for this suggestion. |
| + GURL favicon_page_url; |
| +}; |
| + |
| // Contains additional data for notification-worthy suggestions. |
| struct NotificationExtra { |
| // Deadline for showing notification. If the deadline is past, the |
| @@ -144,6 +162,15 @@ class ContentSuggestion { |
| void set_recent_tab_suggestion_extra( |
| std::unique_ptr<RecentTabSuggestionExtra> recent_tab_suggestion_extra); |
| + // Extra information for reading list suggestions. Only available for |
| + // KnownCategories::READING_LIST suggestions. |
| + ReadingListSuggestionExtra* reading_list_suggestion_extra() const { |
| + return reading_list_suggestion_extra_.get(); |
| + } |
| + void set_reading_list_suggestion_extra( |
| + std::unique_ptr<ReadingListSuggestionExtra> |
| + reading_list_suggestion_extra); |
| + |
| // Extra information for notifications. When absent, no notification should be |
| // sent for this suggestion. When present, a notification should be sent, |
| // unless other factors disallow it (examples: the extra parameters say to; |
| @@ -169,6 +196,7 @@ class ContentSuggestion { |
| float score_; |
| std::unique_ptr<DownloadSuggestionExtra> download_suggestion_extra_; |
| std::unique_ptr<RecentTabSuggestionExtra> recent_tab_suggestion_extra_; |
| + std::unique_ptr<ReadingListSuggestionExtra> reading_list_suggestion_extra_; |
| std::unique_ptr<NotificationExtra> notification_extra_; |
| // The time when the remote suggestion was fetched from the server. This field |