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

Unified Diff: components/ntp_snippets/content_suggestions_service.h

Issue 2568033005: [NTP::SectionOrder] Replace CategoryFactory with a category ranker. (Closed)
Patch Set: rebase. 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.h
diff --git a/components/ntp_snippets/content_suggestions_service.h b/components/ntp_snippets/content_suggestions_service.h
index f8a96a69e416f5bef9d5bc343fa20e156febe01b..8ad6b60afc2150c8a214d113fbc8a3f95efdc89f 100644
--- a/components/ntp_snippets/content_suggestions_service.h
+++ b/components/ntp_snippets/content_suggestions_service.h
@@ -20,7 +20,8 @@
#include "components/history/core/browser/history_service_observer.h"
#include "components/keyed_service/core/keyed_service.h"
#include "components/ntp_snippets/callbacks.h"
-#include "components/ntp_snippets/category_factory.h"
+#include "components/ntp_snippets/category.h"
+#include "components/ntp_snippets/category_rankers/category_ranker.h"
#include "components/ntp_snippets/category_status.h"
#include "components/ntp_snippets/content_suggestions_provider.h"
#include "components/ntp_snippets/user_classifier.h"
@@ -88,7 +89,8 @@ class ContentSuggestionsService : public KeyedService,
ContentSuggestionsService(State state,
SigninManagerBase* signin_manager,
history::HistoryService* history_service,
- PrefService* pref_service);
+ PrefService* pref_service,
+ std::unique_ptr<CategoryRanker> category_ranker);
~ContentSuggestionsService() override;
// Inherited from KeyedService.
@@ -191,8 +193,6 @@ class ContentSuggestionsService : public KeyedService,
// supports it).
void ClearDismissedSuggestionsForDebugging(Category category);
- CategoryFactory* category_factory() { return &category_factory_; }
-
// The reference to the RemoteSuggestionsProvider provider should only be set
// by the factory and only be used for scheduling, periodic fetching and
// debugging.
@@ -205,6 +205,7 @@ class ContentSuggestionsService : public KeyedService,
}
UserClassifier* user_classifier() { return &user_classifier_; }
+ CategoryRanker* category_ranker() { return category_ranker_.get(); }
private:
friend class ContentSuggestionsServiceTest;
@@ -266,9 +267,6 @@ class ContentSuggestionsService : public KeyedService,
// Whether the content suggestions feature is enabled.
State state_;
- // Provides new and existing categories and an order for them.
- CategoryFactory category_factory_;
-
// All registered providers, owned by the service.
std::vector<std::unique_ptr<ContentSuggestionsProvider>> providers_;
@@ -322,6 +320,9 @@ class ContentSuggestionsService : public KeyedService,
UserClassifier user_classifier_;
+ // Provides order for categories.
+ std::unique_ptr<CategoryRanker> category_ranker_;
+
DISALLOW_COPY_AND_ASSIGN(ContentSuggestionsService);
};
« no previous file with comments | « components/ntp_snippets/content_suggestions_provider.cc ('k') | components/ntp_snippets/content_suggestions_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698