From 6b5cdc0c52b30a37a166a67b4ecd2af7733a1528 Mon Sep 17 00:00:00 2001 From: Rootkit404 <175176948+RKNF404@users.noreply.github.com> Date: Wed, 1 Oct 2025 22:10:33 -0400 Subject: [PATCH 1/2] Revert "chore: temporarily drop search selection patch (#421)" This reverts commit 2125f814cc08b4769d536659e6b4d0d51ee1edf8. --- patches/search-selection.patch | 45 ++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 patches/search-selection.patch diff --git a/patches/search-selection.patch b/patches/search-selection.patch new file mode 100644 index 00000000..4fdddd4d --- /dev/null +++ b/patches/search-selection.patch @@ -0,0 +1,45 @@ +Copyright 2024-2025 The Trivalent Authors + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software distributed under the License is +distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and limitations under the License. +--- +diff --git a/chrome/browser/search_engine_choice/search_engine_choice_dialog_service_factory.cc b/chrome/browser/search_engine_choice/search_engine_choice_dialog_service_factory.cc +index e4d2eacf3f316..0dfdd8c0d365d 100644 +--- a/chrome/browser/search_engine_choice/search_engine_choice_dialog_service_factory.cc ++++ b/chrome/browser/search_engine_choice/search_engine_choice_dialog_service_factory.cc +@@ -129,10 +129,6 @@ SearchEngineChoiceDialogServiceFactory::BuildServiceInstanceForBrowserContext( + + base::CommandLine* const command_line = + base::CommandLine::ForCurrentProcess(); +- if (!g_is_chrome_build && +- !command_line->HasSwitch(switches::kForceSearchEngineChoiceScreen)) { +- return nullptr; +- } + + if (command_line->HasSwitch(switches::kNoFirstRun) && + !command_line->HasSwitch( +diff --git a/components/regional_capabilities/program_settings.cc b/components/regional_capabilities/program_settings.cc +index ad23174e4b..4dc197eccc 100644 +--- a/components/regional_capabilities/program_settings.cc ++++ b/components/regional_capabilities/program_settings.cc +@@ -48,7 +48,12 @@ constexpr ProgramSettings kDefaultSettings{ + .program = Program::kDefault, + .associated_countries = base::raw_span(), + .search_engine_list_type = SearchEngineListType::kTopN, +- .choice_screen_eligibility_config = std::nullopt, ++ .choice_screen_eligibility_config = ++ ChoiceScreenEligibilityConfig{ ++ .should_preserve_non_prepopulated_dse = false, ++ .should_preserve_imported_choice = false, ++ .should_preserve_non_google_dse = false, ++ }, + }; + + // "Fake" program used for baseline checks. Announces itself as Taiyaki, but From 993e1a2d1a87e11b6908aae071be7dccfd66cec1 Mon Sep 17 00:00:00 2001 From: Rootkit404 <175176948+RKNF404@users.noreply.github.com> Date: Wed, 1 Oct 2025 22:14:51 -0400 Subject: [PATCH 2/2] fix: search selection crashes --- patches/search-selection.patch | 37 +++++++++++++++++++++------------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/patches/search-selection.patch b/patches/search-selection.patch index 4fdddd4d..49882359 100644 --- a/patches/search-selection.patch +++ b/patches/search-selection.patch @@ -26,20 +26,29 @@ index e4d2eacf3f316..0dfdd8c0d365d 100644 if (command_line->HasSwitch(switches::kNoFirstRun) && !command_line->HasSwitch( diff --git a/components/regional_capabilities/program_settings.cc b/components/regional_capabilities/program_settings.cc -index ad23174e4b..4dc197eccc 100644 +index ad23174e4b..48867e9824 100644 --- a/components/regional_capabilities/program_settings.cc +++ b/components/regional_capabilities/program_settings.cc -@@ -48,7 +48,12 @@ constexpr ProgramSettings kDefaultSettings{ - .program = Program::kDefault, - .associated_countries = base::raw_span(), - .search_engine_list_type = SearchEngineListType::kTopN, -- .choice_screen_eligibility_config = std::nullopt, -+ .choice_screen_eligibility_config = -+ ChoiceScreenEligibilityConfig{ -+ .should_preserve_non_prepopulated_dse = false, -+ .should_preserve_imported_choice = false, -+ .should_preserve_non_google_dse = false, -+ }, - }; +@@ -80,8 +80,7 @@ bool IsValidSerializedProgram(int serialized_program) { - // "Fake" program used for baseline checks. Announces itself as Taiyaki, but + bool IsInProgramRegion(Program program, + const country_codes::CountryId& country_id) { +- return base::Contains(GetSettingsForProgram(program).associated_countries, +- country_id); ++ return true; + } + + bool IsClientCompatibleWithProgram(Program program) { +diff --git a/components/regional_capabilities/regional_capabilities_service.cc b/components/regional_capabilities/regional_capabilities_service.cc +index 4f95ae3d04..7f4d4953ec 100644 +--- a/components/regional_capabilities/regional_capabilities_service.cc ++++ b/components/regional_capabilities/regional_capabilities_service.cc +@@ -169,7 +169,7 @@ Program CountryIdToProgram(const CountryId& country_id) { + static constexpr Program kCountryDerivedPrograms[] = { + #if BUILDFLAG(IS_IOS) + // Only iOS can derive Taiyaki scope directly from the country. +- Program::kTaiyaki, ++ //Program::kTaiyaki, + #endif + + Program::kWaffle,