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

Unified Diff: components/ntp_snippets/content_suggestion.h

Issue 2780793002: Add extra information for ReadingList ContentSuggestion (Closed)
Patch Set: Add comments Created 3 years, 9 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/content_suggestion.h
diff --git a/components/ntp_snippets/content_suggestion.h b/components/ntp_snippets/content_suggestion.h
index b2403f6c749ef97c3245abbaba77e7288dd6e952..cc523024b759c83c6368047eb4478f33bda5dd2f 100644
--- a/components/ntp_snippets/content_suggestion.h
+++ b/components/ntp_snippets/content_suggestion.h
@@ -17,6 +17,22 @@
namespace ntp_snippets {
+// ReadingListSuggestionExtra contains addition data which is only available for
Marc Treib 2017/03/28 13:38:20 nit: s/addition/additional/ nit: Keep the order c
gambard 2017/03/29 06:51:24 Done.
+// Reading List suggestions.
+struct ReadingListSuggestionExtra {
+ // State of the distillation a suggestion.
Olivier 2017/03/28 13:43:45 Whi not use ReadingListEntry::DistillationState ?
gambard 2017/03/29 06:51:24 I am not using ReadingListEntry::DistillationState
+ enum class ReadingListSuggestionDistilledState {
+ PROCESSING,
+ SUCCESS,
+ FAILURE
+ };
+
+ // State of the distillation of the suggestion.
+ ReadingListSuggestionDistilledState distilled_state;
+ // URL of the page whose favicon should be displayed for this suggestion.
+ GURL favicon_page_url;
Marc Treib 2017/03/28 13:38:20 Can't this be derived from the URL? Generally, +jk
gambard 2017/03/29 06:51:24 No, this is specific to ReadingList: you can have
Marc Treib 2017/03/29 08:24:58 Redirects are officially The Worst :( Alright then
+};
+
// DownloadSuggestionExtra contains additional data which is only available for
// download suggestions.
struct DownloadSuggestionExtra {
@@ -144,6 +160,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 +194,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
« no previous file with comments | « no previous file | components/ntp_snippets/content_suggestion.cc » ('j') | components/ntp_snippets/content_suggestion.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698