| 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 ee5680f25384982766db8e3bee0988e98baf6130..4cf488cf46b143ac6f0651795808e0a17ed8567d 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;
|
| }
|
| }
|
|
|