From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Sun, 27 Oct 2019 10:18:39 +0100
Subject: Increase number of autocomplete matches to 10

Patch adapted from https://github.com/Eloston/ungoogled-chromium/issues/814#issuecomment-526874703

License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
---
 components/omnibox/browser/autocomplete_result.cc | 1 +
 components/omnibox/browser/omnibox_field_trial.cc | 6 +++---
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/components/omnibox/browser/autocomplete_result.cc b/components/omnibox/browser/autocomplete_result.cc
--- a/components/omnibox/browser/autocomplete_result.cc
+++ b/components/omnibox/browser/autocomplete_result.cc
@@ -78,6 +78,7 @@ constexpr size_t kMaxPedalMatchIndex = std::numeric_limits<size_t>::max();
 // static
 size_t AutocompleteResult::GetMaxMatches(bool is_zero_suggest) {
 #if BUILDFLAG(IS_ANDROID)
+  // this needs to be double the value of default_max_matches_per_provider from components/omnibox/browser/omnibox_field_trial.cc
   constexpr size_t kDefaultMaxAutocompleteMatches = 10;
   constexpr size_t kDefaultMaxZeroSuggestMatches = 15;
 #elif BUILDFLAG(IS_IOS)
diff --git a/components/omnibox/browser/omnibox_field_trial.cc b/components/omnibox/browser/omnibox_field_trial.cc
--- a/components/omnibox/browser/omnibox_field_trial.cc
+++ b/components/omnibox/browser/omnibox_field_trial.cc
@@ -323,9 +323,9 @@ void OmniboxFieldTrial::GetDemotionsByType(
 
 size_t OmniboxFieldTrial::GetProviderMaxMatches(
     AutocompleteProvider::Type provider) {
-  size_t default_max_matches_per_provider = 3;
+  size_t default_max_matches_per_provider = 5; // was 3; this needs to be half the value of kDefaultMaxAutocompleteMatches from components/omnibox/browser/autocomplete_result.cc
 
-  std::string param_value = base::GetFieldTrialParamValueByFeature(
+/*  std::string param_value = base::GetFieldTrialParamValueByFeature(
       omnibox::kUIExperimentMaxAutocompleteMatches,
       OmniboxFieldTrial::kUIMaxAutocompleteMatchesByProviderParam);
 
@@ -349,7 +349,7 @@ size_t OmniboxFieldTrial::GetProviderMaxMatches(
       else if (k == provider)
         return v;
     }
-  }
+  }*/
 
   return default_max_matches_per_provider;
 }
--
2.25.1
