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

Unified Diff: components/ntp_snippets/features.cc

Issue 2599293002: [NTP::SectionOrder] Implement click counts decay. (Closed)
Patch Set: ios factory. 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 | « components/ntp_snippets/features.h ('k') | components/ntp_snippets/pref_names.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/ntp_snippets/features.cc
diff --git a/components/ntp_snippets/features.cc b/components/ntp_snippets/features.cc
index c3c7fc87baf2a2ac811d3e24bfabae0c1ee721ae..ed013a00d6d2c3f18ad961c21477eb6aa0cb1b71 100644
--- a/components/ntp_snippets/features.cc
+++ b/components/ntp_snippets/features.cc
@@ -4,6 +4,7 @@
#include "components/ntp_snippets/features.h"
+#include "base/time/clock.h"
#include "components/ntp_snippets/category_rankers/click_based_category_ranker.h"
#include "components/ntp_snippets/category_rankers/constant_category_ranker.h"
#include "components/variations/variations_associated_data.h"
@@ -75,13 +76,15 @@ CategoryRankerChoice GetSelectedCategoryRanker() {
}
std::unique_ptr<CategoryRanker> BuildSelectedCategoryRanker(
- PrefService* pref_service) {
+ PrefService* pref_service,
+ std::unique_ptr<base::Clock> clock) {
CategoryRankerChoice choice = ntp_snippets::GetSelectedCategoryRanker();
switch (choice) {
case CategoryRankerChoice::CONSTANT:
return base::MakeUnique<ConstantCategoryRanker>();
case CategoryRankerChoice::CLICK_BASED:
- return base::MakeUnique<ClickBasedCategoryRanker>(pref_service);
+ return base::MakeUnique<ClickBasedCategoryRanker>(pref_service,
+ std::move(clock));
default:
NOTREACHED() << "The category ranker choice value is "
<< static_cast<int>(choice);
« no previous file with comments | « components/ntp_snippets/features.h ('k') | components/ntp_snippets/pref_names.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698