Files
cromite/build/patches/Increase-number-of-autocomplete-matches-to-10.patch
T

47 lines
2.3 KiB
Diff

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 | 5 +++--
components/omnibox/browser/omnibox_field_trial.cc | 6 +++++-
2 files changed, 8 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
@@ -102,10 +102,11 @@ constexpr size_t kMaxPedalMatchIndex =
size_t AutocompleteResult::GetMaxMatches(
bool is_zero_suggest,
AutocompleteInput::FeaturedKeywordMode featured_keyword_mode) {
+ // 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 =
- is_android ? 10 : (is_ios ? 10 : 8);
+ is_android ? 10 : (is_ios ? 10 : 8); // kDefaultMaxAutocompleteMatches = 10
constexpr size_t kDefaultMaxZeroSuggestMatches =
- is_android ? 15 : (is_ios ? 20 : 8);
+ is_android ? 15 : (is_ios ? 20 : 8); // kDefaultMaxZeroSuggestMatches = 15
#if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_IOS)
constexpr size_t kMaxFeaturedKeywordAutocompleteMatches = 9;
#endif
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
@@ -173,7 +173,11 @@ void OmniboxFieldTrial::GetActiveSuggestFieldTrialHashes(
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
+ if ((true)) return default_max_matches_per_provider;
std::string param_value;
if (OmniboxFieldTrial::IsMlUrlScoringEnabled()) {
--