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

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, 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
« 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..3910cfd9ccce2c993a74af1ad5aa5342b4dc73cc 100644
--- a/components/ntp_snippets/reading_list/reading_list_suggestions_provider.cc
+++ b/components/ntp_snippets/reading_list/reading_list_suggestions_provider.cc
@@ -127,10 +127,27 @@ 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_)
return;
+ if (reading_list_model_->IsPerformingBatchUpdates())
Olivier 2017/04/03 13:13:53 super nit: group with the if above.
Marc Treib 2017/04/04 16:57:49 nit: Braces please, also above
gambard 2017/04/05 08:08:55 Done.
gambard 2017/04/05 08:08:55 Done.
+ return;
+
DCHECK(reading_list_model_->loaded());
std::vector<const ReadingListEntry*> entries;
for (const GURL& url : reading_list_model_->Keys()) {
« 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