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

Unified Diff: components/ntp_snippets/mock_content_suggestions_provider_observer.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/mock_content_suggestions_provider_observer.cc
diff --git a/components/ntp_snippets/mock_content_suggestions_provider_observer.cc b/components/ntp_snippets/mock_content_suggestions_provider_observer.cc
index 38f97191106b26b71a8a45955573d8cbe54a9404..4a5a6160048585d800c5899b6f22314a82a3c890 100644
--- a/components/ntp_snippets/mock_content_suggestions_provider_observer.cc
+++ b/components/ntp_snippets/mock_content_suggestions_provider_observer.cc
@@ -22,5 +22,19 @@ void MockContentSuggestionsProviderObserver::OnNewSuggestions(
}
OnNewSuggestions(provider, category, suggestions_list);
}
+void MockContentSuggestionsProviderObserver::OnNewSuggestionBatch(
+ ContentSuggestionsProvider* provider,
+ SuggestionBatch suggestion_batch) {
+ std::map<Category, std::list<ContentSuggestion>, Category::CompareByID>
+ suggestion_batch2;
+ for (auto it = suggestion_batch.begin(); it != suggestion_batch.end(); ++it) {
+ std::list<ContentSuggestion> suggestions_list;
+ for (ContentSuggestion& suggestion : it->second) {
+ suggestions_list.push_back(std::move(suggestion));
+ }
+ suggestion_batch2[it->first] = std::move(suggestions_list);
+ }
+ OnNewSuggestionBatch(provider, suggestion_batch2);
+}
} // namespace ntp_snippets

Powered by Google App Engine
This is Rietveld 408576698