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

Unified Diff: components/ntp_snippets/content_suggestions_service.cc

Issue 2230473002: Refactor and extend SnippetsBridge for multi-section support (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@categoryinfo
Patch Set: Rename SnippetsObserver to ContentSuggestionsSourceObserver Created 4 years, 4 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/content_suggestions_service.cc
diff --git a/components/ntp_snippets/content_suggestions_service.cc b/components/ntp_snippets/content_suggestions_service.cc
index 50f47a48657c1309091afe1268d375d910bf42d4..3311d45624a4372568a304e857f205ae9f105b79 100644
--- a/components/ntp_snippets/content_suggestions_service.cc
+++ b/components/ntp_snippets/content_suggestions_service.cc
@@ -93,8 +93,9 @@ void ContentSuggestionsService::ClearAllCachedSuggestionsForDebugging() {
for (const auto& category_provider_pair : providers_by_category_) {
category_provider_pair.second->ClearCachedSuggestionsForDebugging(
category_provider_pair.first);
+ FOR_EACH_OBSERVER(Observer, observers_,
+ OnNewSuggestions(category_provider_pair.first));
}
- FOR_EACH_OBSERVER(Observer, observers_, OnNewSuggestions());
}
void ContentSuggestionsService::ClearCachedSuggestionsForDebugging(
@@ -197,7 +198,7 @@ void ContentSuggestionsService::OnNewSuggestions(
suggestions_by_category_[category] = std::move(new_suggestions);
- FOR_EACH_OBSERVER(Observer, observers_, OnNewSuggestions());
+ FOR_EACH_OBSERVER(Observer, observers_, OnNewSuggestions(category));
}
void ContentSuggestionsService::OnCategoryStatusChanged(

Powered by Google App Engine
This is Rietveld 408576698