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

Unified Diff: components/ntp_snippets/remote/remote_suggestions_fetcher.cc

Issue 2804633003: Add base::FeatureParam<> struct (Closed)
Patch Set: Remove windows-incompatible constexpr Created 3 years, 8 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
Index: components/ntp_snippets/remote/remote_suggestions_fetcher.cc
diff --git a/components/ntp_snippets/remote/remote_suggestions_fetcher.cc b/components/ntp_snippets/remote/remote_suggestions_fetcher.cc
index 8bd852cedd2cc393fcb1e4dec8c531a5579151da..d20a1d14c3b881dcc719489621a1b7d3f71a8da9 100644
--- a/components/ntp_snippets/remote/remote_suggestions_fetcher.cc
+++ b/components/ntp_snippets/remote/remote_suggestions_fetcher.cc
@@ -50,8 +50,9 @@ const char kContentSuggestionsApiScope[] =
const char kSnippetsServerNonAuthorizedFormat[] = "%s?key=%s";
const char kAuthorizationRequestHeaderFormat[] = "Bearer %s";
-// Variation parameter for chrome-content-suggestions backend.
-const char kContentSuggestionsBackend[] = "content_suggestions_backend";
+constexpr base::FeatureParam<std::string> kContentSuggestionsBackend{
+ &kArticleSuggestionsFeature, "content_suggestions_backend",
+ kContentSuggestionsServer};
const int kFetchTimeHistogramResolution = 5;
@@ -173,8 +174,7 @@ void FilterCategories(
} // namespace
GURL GetFetchEndpoint(version_info::Channel channel) {
- std::string endpoint = variations::GetVariationParamValueByFeature(
- ntp_snippets::kArticleSuggestionsFeature, kContentSuggestionsBackend);
+ std::string endpoint = kContentSuggestionsBackend.Get();
if (!endpoint.empty()) {
return GURL{endpoint};
}

Powered by Google App Engine
This is Rietveld 408576698