Index: components/ntp_snippets/offline_pages/recent_tab_suggestions_provider.cc |
diff --git a/components/ntp_snippets/offline_pages/recent_tab_suggestions_provider.cc b/components/ntp_snippets/offline_pages/recent_tab_suggestions_provider.cc |
index 43be2a4daa6fc31d291f82b8c6c3692a164520ae..3e9b6c1291edfab60cbc67a178f07299719aa92a 100644 |
--- a/components/ntp_snippets/offline_pages/recent_tab_suggestions_provider.cc |
+++ b/components/ntp_snippets/offline_pages/recent_tab_suggestions_provider.cc |
@@ -32,15 +32,8 @@ namespace ntp_snippets { |
namespace { |
-const int kDefaultMaxSuggestionsCount = 5; |
- |
-const char* kMaxSuggestionsCountParamName = "recent_tabs_max_count"; |
- |
-int GetMaxSuggestionsCount() { |
- return variations::GetVariationParamByFeatureAsInt( |
- kRecentOfflineTabSuggestionsFeature, kMaxSuggestionsCountParamName, |
- kDefaultMaxSuggestionsCount); |
-} |
+const base::FeatureParam<int> kMaxSuggestionsCountParam{ |
+ &kRecentOfflineTabSuggestionsFeature, "recent_tabs_max_count", 5}; |
struct OrderUIItemsByMostRecentlyCreatedFirst { |
bool operator()(const DownloadUIItem* left, |
@@ -279,7 +272,8 @@ RecentTabSuggestionsProvider::GetMostRecentlyCreatedWithoutDuplicates( |
std::vector<ContentSuggestion> suggestions; |
for (const DownloadUIItem* ui_item : ui_items) { |
suggestions.push_back(ConvertUIItem(*ui_item)); |
- if (static_cast<int>(suggestions.size()) == GetMaxSuggestionsCount()) { |
+ if (static_cast<int>(suggestions.size()) == |
+ kMaxSuggestionsCountParam.Get()) { |
break; |
} |
} |