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

Unified Diff: chrome/browser/ntp_snippets/content_suggestions_service_factory.cc

Issue 2595883002: [NTP::SectionOrder] Add a flag to choose category ranker. (Closed)
Patch Set: histograms.xml. Created 3 years, 12 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
« no previous file with comments | « chrome/browser/about_flags.cc ('k') | components/ntp_snippets/features.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ntp_snippets/content_suggestions_service_factory.cc
diff --git a/chrome/browser/ntp_snippets/content_suggestions_service_factory.cc b/chrome/browser/ntp_snippets/content_suggestions_service_factory.cc
index d065de4d250d36d8efd9be9dead54f0f974f21d7..84882dbb62c29c8d245b3dfd38c031beec717352 100644
--- a/chrome/browser/ntp_snippets/content_suggestions_service_factory.cc
+++ b/chrome/browser/ntp_snippets/content_suggestions_service_factory.cc
@@ -29,7 +29,7 @@
#include "components/keyed_service/content/browser_context_dependency_manager.h"
#include "components/keyed_service/core/service_access_type.h"
#include "components/ntp_snippets/bookmarks/bookmark_suggestions_provider.h"
-#include "components/ntp_snippets/category_rankers/constant_category_ranker.h"
+#include "components/ntp_snippets/category_rankers/category_ranker.h"
#include "components/ntp_snippets/content_suggestions_service.h"
#include "components/ntp_snippets/features.h"
#include "components/ntp_snippets/ntp_snippets_constants.h"
@@ -76,6 +76,7 @@ using content::BrowserThread;
using history::HistoryService;
using image_fetcher::ImageFetcherImpl;
using ntp_snippets::BookmarkSuggestionsProvider;
+using ntp_snippets::CategoryRanker;
using ntp_snippets::ContentSuggestionsService;
using ntp_snippets::ForeignSessionsSuggestionsProvider;
using ntp_snippets::NTPSnippetsFetcher;
@@ -252,8 +253,8 @@ KeyedService* ContentSuggestionsServiceFactory::BuildServiceInstanceFor(
HistoryService* history_service = HistoryServiceFactory::GetForProfile(
profile, ServiceAccessType::EXPLICIT_ACCESS);
PrefService* pref_service = profile->GetPrefs();
- auto category_ranker =
- base::MakeUnique<ntp_snippets::ConstantCategoryRanker>();
+ std::unique_ptr<CategoryRanker> category_ranker =
+ ntp_snippets::BuildSelectedCategoryRanker(pref_service);
auto* service =
new ContentSuggestionsService(state, signin_manager, history_service,
pref_service, std::move(category_ranker));
« no previous file with comments | « chrome/browser/about_flags.cc ('k') | components/ntp_snippets/features.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698