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

Unified Diff: components/ntp_snippets/remote/remote_suggestions_provider.h

Issue 2568033005: [NTP::SectionOrder] Replace CategoryFactory with a category ranker. (Closed)
Patch Set: treib@ nits. 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/remote/remote_suggestions_provider.h
diff --git a/components/ntp_snippets/remote/remote_suggestions_provider.h b/components/ntp_snippets/remote/remote_suggestions_provider.h
index 6fac400e32ffebc265d67569adf21081dc4c737f..0c7f4af3fe9465c817b41dac2b32d73e8612dc36 100644
--- a/components/ntp_snippets/remote/remote_suggestions_provider.h
+++ b/components/ntp_snippets/remote/remote_suggestions_provider.h
@@ -21,7 +21,6 @@
#include "base/time/time.h"
#include "components/image_fetcher/image_fetcher_delegate.h"
#include "components/ntp_snippets/category.h"
-#include "components/ntp_snippets/category_factory.h"
#include "components/ntp_snippets/category_status.h"
#include "components/ntp_snippets/content_suggestion.h"
#include "components/ntp_snippets/content_suggestions_provider.h"
@@ -46,6 +45,7 @@ class ImageFetcher;
namespace ntp_snippets {
class RemoteSuggestionsDatabase;
+class CategoryRanker;
class UserClassifier;
// CachedImageFetcher takes care of fetching images from the network and caching
@@ -114,9 +114,9 @@ class RemoteSuggestionsProvider final : public ContentSuggestionsProvider {
// (British English person in the US) are not language codes.
RemoteSuggestionsProvider(
Observer* observer,
- CategoryFactory* category_factory,
PrefService* pref_service,
const std::string& application_language_code,
+ CategoryRanker* category_ranker,
const UserClassifier* user_classifier,
NTPSnippetsScheduler* scheduler,
std::unique_ptr<NTPSnippetsFetcher> snippets_fetcher,
@@ -408,6 +408,9 @@ class RemoteSuggestionsProvider final : public ContentSuggestionsProvider {
// The ISO 639-1 code of the language used by the application.
const std::string application_language_code_;
+ // Ranker that orders the categories. Not owned.
+ CategoryRanker* category_ranker_;
+
// Classifier that tells us how active the user is. Not owned.
const UserClassifier* user_classifier_;

Powered by Google App Engine
This is Rietveld 408576698