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

Unified Diff: components/reading_list/core/reading_list_model_impl.cc

Issue 2806213004: Track if a ReadingListEntry has been dismissed (Closed)
Patch Set: Address comment Created 3 years, 8 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/reading_list/core/reading_list_model_impl.cc
diff --git a/components/reading_list/core/reading_list_model_impl.cc b/components/reading_list/core/reading_list_model_impl.cc
index 6b60704e02f11a3c790b722dfa90821377776d92..d1ed193f0b5534f8bfaaf070f9ccf966ac2886bf 100644
--- a/components/reading_list/core/reading_list_model_impl.cc
+++ b/components/reading_list/core/reading_list_model_impl.cc
@@ -461,6 +461,28 @@ void ReadingListModelImpl::SetEntryDistilledState(
}
}
+void ReadingListModelImpl::SetContentSuggestionsExtra(
+ const GURL& url,
+ const reading_list::ContentSuggestionsExtra& extra) {
+ DCHECK(CalledOnValidThread());
+ DCHECK(loaded());
+ ReadingListEntry* entry = GetMutableEntryFromURL(url);
+ if (!entry) {
+ return;
+ }
+
+ for (ReadingListModelObserver& observer : observers_) {
+ observer.ReadingListWillUpdateEntry(this, url);
+ }
+ entry->SetContentSuggestionsExtra(extra);
+ if (storage_layer_) {
+ storage_layer_->SaveEntry(*entry);
+ }
+ for (ReadingListModelObserver& observer : observers_) {
+ observer.ReadingListDidApplyChanges(this);
+ }
+}
+
std::unique_ptr<ReadingListModel::ScopedReadingListBatchUpdate>
ReadingListModelImpl::CreateBatchToken() {
return base::MakeUnique<ReadingListModelImpl::ScopedReadingListBatchUpdate>(

Powered by Google App Engine
This is Rietveld 408576698