Increase-number-of-autocomplete-matches-from-5-to-10.patch
This commit is contained in:
parent
f04d6109a5
commit
d8ac61aea6
1 changed files with 35 additions and 21 deletions
|
@ -4,19 +4,19 @@ Subject: Increase number of autocomplete matches from 5 to 10
|
|||
|
||||
Patch from https://github.com/Eloston/ungoogled-chromium/issues/814#issuecomment-526874703
|
||||
---
|
||||
components/omnibox/browser/autocomplete_result.cc | 3 ++-
|
||||
components/omnibox/browser/omnibox_field_trial.cc | 6 +++---
|
||||
2 files changed, 5 insertions(+), 4 deletions(-)
|
||||
.../omnibox/browser/autocomplete_result.cc | 3 +-
|
||||
.../omnibox/browser/omnibox_field_trial.cc | 30 ++-----------------
|
||||
2 files changed, 4 insertions(+), 29 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
|
||||
@@ -67,7 +67,8 @@ struct MatchGURLHash {
|
||||
@@ -68,7 +68,8 @@ struct MatchGURLHash {
|
||||
// static
|
||||
size_t AutocompleteResult::GetMaxMatches(bool is_zero_suggest) {
|
||||
#if (defined(OS_ANDROID))
|
||||
- constexpr size_t kDefaultMaxAutocompleteMatches = 5;
|
||||
+ // changed from 6, this needs to be double the value of default_max_matches_per_provider from components/omnibox/browser/omnibox_field_trial.cc
|
||||
+ // changed from 5, 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;
|
||||
#elif defined(OS_IOS) // !defined(OS_ANDROID)
|
||||
constexpr size_t kDefaultMaxAutocompleteMatches = 6;
|
||||
|
@ -24,29 +24,43 @@ diff --git a/components/omnibox/browser/autocomplete_result.cc b/components/omni
|
|||
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
|
||||
@@ -335,11 +335,11 @@ void OmniboxFieldTrial::GetDemotionsByType(
|
||||
@@ -330,34 +330,8 @@ 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 new search features are disabled, ignore the parameter and use the
|
||||
// default value.
|
||||
- if (!base::FeatureList::IsEnabled(omnibox::kNewSearchFeatures))
|
||||
+ /*if (!base::FeatureList::IsEnabled(omnibox::kNewSearchFeatures))
|
||||
return default_max_matches_per_provider;
|
||||
|
||||
std::string param_value = base::GetFieldTrialParamValueByFeature(
|
||||
@@ -366,7 +366,7 @@ size_t OmniboxFieldTrial::GetProviderMaxMatches(
|
||||
else if (k == provider)
|
||||
return v;
|
||||
}
|
||||
-
|
||||
- std::string param_value = base::GetFieldTrialParamValueByFeature(
|
||||
- omnibox::kUIExperimentMaxAutocompleteMatches,
|
||||
- OmniboxFieldTrial::kUIMaxAutocompleteMatchesByProviderParam);
|
||||
-
|
||||
- // If the experiment param specifies a max results for |provider|, return the
|
||||
- // specified limit.
|
||||
- // E.g., if param_value = '3:2' and provider = 3, return 2.
|
||||
- // Otherwise, if the experiment param specifies a default value for
|
||||
- // unspecified providers, return the default value.
|
||||
- // E.g., if param_value = '3:3,*:4' and provider = 1, return 4,
|
||||
- // Otherwise, return |default_max_matches_per_provider|.
|
||||
- base::StringPairs kv_pairs;
|
||||
- if (base::SplitStringIntoKeyValuePairs(param_value, ':', ',', &kv_pairs)) {
|
||||
- for (const auto& kv_pair : kv_pairs) {
|
||||
- int k;
|
||||
- base::StringToInt(kv_pair.first, &k);
|
||||
- size_t v;
|
||||
- base::StringToSizeT(kv_pair.second, &v);
|
||||
-
|
||||
- if (kv_pair.first == "*")
|
||||
- default_max_matches_per_provider = v;
|
||||
- else if (k == provider)
|
||||
- return v;
|
||||
- }
|
||||
- }
|
||||
+ }*/
|
||||
|
||||
-
|
||||
+ // this needs to be half the value of kDefaultMaxAutocompleteMatches from components/omnibox/browser/autocomplete_result.cc
|
||||
+ size_t default_max_matches_per_provider = 5; // was 3;
|
||||
return default_max_matches_per_provider;
|
||||
}
|
||||
|
||||
--
|
||||
2.17.1
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue