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

Unified Diff: components/ntp_snippets/reading_list/reading_list_suggestions_provider.cc

Issue 2794853004: Update provider on Reading List model update (Closed)
Patch Set: Address comments 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
« no previous file with comments | « components/ntp_snippets/reading_list/reading_list_suggestions_provider.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/ntp_snippets/reading_list/reading_list_suggestions_provider.cc
diff --git a/components/ntp_snippets/reading_list/reading_list_suggestions_provider.cc b/components/ntp_snippets/reading_list/reading_list_suggestions_provider.cc
index d6366ef811e77df3bbb9d908d1526a613b7ceeb0..4f648debdba86e2edbfcd431114dd58fe731f96c 100644
--- a/components/ntp_snippets/reading_list/reading_list_suggestions_provider.cc
+++ b/components/ntp_snippets/reading_list/reading_list_suggestions_provider.cc
@@ -127,9 +127,24 @@ void ReadingListSuggestionsProvider::ReadingListModelBeingDeleted(
reading_list_model_ = nullptr;
}
+void ReadingListSuggestionsProvider::ReadingListDidApplyChanges(
+ ReadingListModel* model) {
+ DCHECK(model == reading_list_model_);
+
+ FetchReadingListInternal();
+}
+
+void ReadingListSuggestionsProvider::ReadingListModelCompletedBatchUpdates(
+ const ReadingListModel* model) {
+ DCHECK(model == reading_list_model_);
+
+ FetchReadingListInternal();
+}
+
void ReadingListSuggestionsProvider::FetchReadingListInternal() {
- if (!reading_list_model_)
+ if (!reading_list_model_ || reading_list_model_->IsPerformingBatchUpdates()) {
return;
+ }
DCHECK(reading_list_model_->loaded());
std::vector<const ReadingListEntry*> entries;
« no previous file with comments | « components/ntp_snippets/reading_list/reading_list_suggestions_provider.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698