| Index: ios/chrome/browser/reading_list/reading_list_model_impl.cc
|
| diff --git a/ios/chrome/browser/reading_list/reading_list_model_impl.cc b/ios/chrome/browser/reading_list/reading_list_model_impl.cc
|
| index 7951622fa0c210fdee11a192c4744ce841f04a8f..a07f7f2b98851361e0189072cbb15d52b9c7df3f 100644
|
| --- a/ios/chrome/browser/reading_list/reading_list_model_impl.cc
|
| +++ b/ios/chrome/browser/reading_list/reading_list_model_impl.cc
|
| @@ -138,6 +138,30 @@ const ReadingListEntry& ReadingListModelImpl::AddEntry(
|
| return *unread_.begin();
|
| }
|
|
|
| +void ReadingListModelImpl::MarkUnreadByURL(const GURL& url) {
|
| + DCHECK(loaded());
|
| + ReadingListEntry entry(url, std::string());
|
| + auto result = std::find(read_.begin(), read_.end(), entry);
|
| + if (result == read_.end())
|
| + return;
|
| +
|
| + for (ReadingListModelObserver& observer : observers_) {
|
| + observer.ReadingListWillMoveEntry(this,
|
| + std::distance(read_.begin(), result));
|
| + }
|
| +
|
| + unread_.insert(unread_.begin(), std::move(*result));
|
| + read_.erase(result);
|
| +
|
| + if (storageLayer_ && !IsPerformingBatchUpdates()) {
|
| + storageLayer_->SavePersistentUnreadList(read_);
|
| + storageLayer_->SavePersistentReadList(unread_);
|
| + }
|
| + for (ReadingListModelObserver& observer : observers_) {
|
| + observer.ReadingListDidApplyChanges(this);
|
| + }
|
| +}
|
| +
|
| void ReadingListModelImpl::MarkReadByURL(const GURL& url) {
|
| DCHECK(loaded());
|
| ReadingListEntry entry(url, std::string());
|
|
|