48 lines
2.2 KiB
Diff
48 lines
2.2 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
|
||
|
@@ -85,10 +85,11 @@ constexpr size_t kMaxPedalMatchIndex =
|
||
|
|
||
|
// static
|
||
|
size_t AutocompleteResult::GetMaxMatches(bool is_zero_suggest) {
|
||
|
+ // 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_IOS)
|
||
|
// By default, iPad has the same max as iPhone.
|
||
|
// `kDefaultMaxAutocompleteMatches` defines a hard limit on the number of
|
||
|
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
|
||
|
@@ -290,7 +290,11 @@ 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
|
||
|
+ if ((true)) return default_max_matches_per_provider;
|
||
|
|
||
|
std::string param_value;
|
||
|
if (OmniboxFieldTrial::IsMlUrlScoringEnabled()) {
|
||
|
--
|
||
|
2.25.1
|