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

Unified Diff: components/ntp_snippets/remote/ntp_snippets_service.cc

Issue 2406573002: 📰 Persist category dismissals (Closed)
Patch Set: fix test Created 4 years, 2 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/ntp_snippets/remote/ntp_snippets_service.cc
diff --git a/components/ntp_snippets/remote/ntp_snippets_service.cc b/components/ntp_snippets/remote/ntp_snippets_service.cc
index a33f6740e8eff6067ec389483de09d2897492089..3a03c5b7c6b3954d0c0b9afd64f7117f926e2862 100644
--- a/components/ntp_snippets/remote/ntp_snippets_service.cc
+++ b/components/ntp_snippets/remote/ntp_snippets_service.cc
@@ -961,6 +961,8 @@ void NTPSnippetsService::EnterState(State state) {
}
void NTPSnippetsService::NotifyNewSuggestions() {
+ ContentSuggestionsProvider::Observer::SuggestionBatch receivedSuggestions;
+
for (const auto& item : categories_) {
Category category = item.first;
const CategoryContent& content = item.second;
@@ -985,10 +987,10 @@ void NTPSnippetsService::NotifyNewSuggestions() {
result.emplace_back(std::move(suggestion));
}
- DVLOG(1) << "NotifyNewSuggestions(): " << result.size()
- << " items in category " << category;
- observer()->OnNewSuggestions(this, category, std::move(result));
+ receivedSuggestions[category] = std::move(result);
}
+
+ observer()->OnNewSuggestionBatch(this, std::move(receivedSuggestions));
}
void NTPSnippetsService::UpdateCategoryStatus(Category category,

Powered by Google App Engine
This is Rietveld 408576698