Chromium Code Reviews| Index: components/reading_list/core/reading_list_entry.h |
| diff --git a/components/reading_list/core/reading_list_entry.h b/components/reading_list/core/reading_list_entry.h |
| index 042cf05ca6b9bffec351cc85bc59b69e9795c98f..878278b71e2aaf5ba4944721f45f31db0504902c 100644 |
| --- a/components/reading_list/core/reading_list_entry.h |
| +++ b/components/reading_list/core/reading_list_entry.h |
| @@ -22,6 +22,13 @@ class ReadingListLocal; |
| // |ADDED_VIA_EXTENSION| is when the entry was added via the share extension. |
| // |ADDED_VIA_SYNC| is when the entry was added with sync. |
| enum EntrySource { ADDED_VIA_CURRENT_APP, ADDED_VIA_EXTENSION, ADDED_VIA_SYNC }; |
| + |
| +// Contains additional data used by the ContentSuggestions. |
| +struct ContentSuggestionsExtra { |
| + // Whether the Reading List Entry has been dismissed in the Content |
| + // Suggestions. |
| + bool dismissed = false; |
| +}; |
| } |
| namespace sync_pb { |
| @@ -101,6 +108,9 @@ class ReadingListEntry { |
| // Returns if an entry has ever been seen. |
| bool HasBeenSeen() const; |
| + // Extra information about this entry for the Content Suggestions. |
| + const reading_list::ContentSuggestionsExtra* ContentSuggestionsExtra() const; |
|
Marc Treib
2017/04/11 13:37:18
Can this ever be null? If not, should it return a
|
| + |
| // The last update time of the entry. This value may be used to sort the |
| // entries. The value is in microseconds since Jan 1st 1970. |
| int64_t UpdateTime() const; |
| @@ -172,23 +182,28 @@ class ReadingListEntry { |
| // If |first_read_time_us_| is 0 and read is READ, sets |first_read_time_us_| |
| // to |now|. |
| void SetRead(bool read, const base::Time& now); |
| + // Sets extra information about this entry used by Content Suggestions. |
| + void SetContentSuggestionsExtra( |
| + const reading_list::ContentSuggestionsExtra& extra); |
| private: |
| enum State { UNSEEN, UNREAD, READ }; |
| - ReadingListEntry(const GURL& url, |
| - const std::string& title, |
| - State state, |
| - int64_t creation_time, |
| - int64_t first_read_time, |
| - int64_t update_time, |
| - int64_t update_title_time, |
| - ReadingListEntry::DistillationState distilled_state, |
| - const base::FilePath& distilled_path, |
| - const GURL& distilled_url, |
| - int64_t distillation_time, |
| - int64_t distillation_size, |
| - int failed_download_counter, |
| - std::unique_ptr<net::BackoffEntry> backoff); |
| + ReadingListEntry( |
| + const GURL& url, |
| + const std::string& title, |
| + State state, |
| + int64_t creation_time, |
| + int64_t first_read_time, |
| + int64_t update_time, |
| + int64_t update_title_time, |
| + ReadingListEntry::DistillationState distilled_state, |
| + const base::FilePath& distilled_path, |
| + const GURL& distilled_url, |
| + int64_t distillation_time, |
| + int64_t distillation_size, |
| + int failed_download_counter, |
| + std::unique_ptr<net::BackoffEntry> backoff, |
| + const reading_list::ContentSuggestionsExtra& content_suggestions_extra); |
| GURL url_; |
| std::string title_; |
| State state_; |
| @@ -209,6 +224,8 @@ class ReadingListEntry { |
| int64_t distillation_time_us_; |
| int64_t distillation_size_; |
| + reading_list::ContentSuggestionsExtra content_suggestions_extra_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(ReadingListEntry); |
| }; |