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

Unified Diff: components/ntp_snippets/content_suggestions_service.cc

Issue 2557363002: [NTP Snippets] Refactor background scheduling for remote suggestions (Closed)
Patch Set: Fixing the last changes :) Created 4 years 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 fbfa26715ce5bd97f7bebc56664d7de8575dfee1..43dddc17cc31af214d386e53b1e24e5268a4191f 100644
--- a/components/ntp_snippets/content_suggestions_service.cc
+++ b/components/ntp_snippets/content_suggestions_service.cc
@@ -30,7 +30,8 @@ ContentSuggestionsService::ContentSuggestionsService(
: state_(state),
signin_observer_(this),
history_service_observer_(this),
- ntp_snippets_service_(nullptr),
+ remote_suggestions_provider_(nullptr),
+ remote_suggestions_scheduler_(nullptr),
pref_service_(pref_service),
user_classifier_(pref_service),
category_ranker_(std::move(category_ranker)) {
@@ -49,7 +50,8 @@ ContentSuggestionsService::ContentSuggestionsService(
ContentSuggestionsService::~ContentSuggestionsService() = default;
void ContentSuggestionsService::Shutdown() {
- ntp_snippets_service_ = nullptr;
+ remote_suggestions_provider_ = nullptr;
+ remote_suggestions_scheduler_ = nullptr;
suggestions_by_category_.clear();
providers_by_category_.clear();
categories_.clear();
@@ -234,6 +236,12 @@ void ContentSuggestionsService::Fetch(
providers_it->second->Fetch(category, known_suggestion_ids, callback);
}
+void ContentSuggestionsService::ReloadSuggestions() {
+ for (const auto& provider : providers_) {
+ provider->ReloadSuggestions();
+ }
+}
+
////////////////////////////////////////////////////////////////////////////////
// Private methods
« no previous file with comments | « components/ntp_snippets/content_suggestions_service.h ('k') | components/ntp_snippets/remote/ntp_snippets_scheduler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698