diff --git a/0001-Functional-new-tab-page-with-non-Google-search-engin.patch b/0001-Functional-new-tab-page-with-non-Google-search-engin.patch index aa538f0..1f72aea 100644 --- a/0001-Functional-new-tab-page-with-non-Google-search-engin.patch +++ b/0001-Functional-new-tab-page-with-non-Google-search-engin.patch @@ -1,4 +1,4 @@ -From 2021de782f99d2276005d57b151f30759ab2c7f3 Mon Sep 17 00:00:00 2001 +From 04d1d9b5e32defe38d9f55c13a70c6179aa6e13b Mon Sep 17 00:00:00 2001 From: Mikhail Novosyolov Date: Thu, 26 May 2022 20:47:28 +0300 Subject: [PATCH] Functional new tab page with non-Google search engines @@ -6,9 +6,25 @@ Subject: [PATCH] Functional new tab page with non-Google search engines If e.g Yandex is chosen as a search engine, chrome://new-tab-page is replaced with chrome://new-tab-page-third-party which does not allow to add new items. Use chrome://new-tab-page. --- + chrome/browser/search/search.cc | 4 +--- chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) + 2 files changed, 2 insertions(+), 4 deletions(-) +diff --git a/chrome/browser/search/search.cc b/chrome/browser/search/search.cc +index 5b7e75599e..8302ba016e 100644 +--- a/chrome/browser/search/search.cc ++++ b/chrome/browser/search/search.cc +@@ -179,9 +179,7 @@ struct NewTabURLDetails { + #if BUILDFLAG(IS_ANDROID) + const GURL local_url; + #else +- const GURL local_url(DefaultSearchProviderIsGoogle(profile) +- ? chrome::kChromeUINewTabPageURL +- : chrome::kChromeUINewTabPageThirdPartyURL); ++ const GURL local_url(chrome::kChromeUINewTabPageURL); + #endif + + if (ShouldShowLocalNewTab(profile)) diff --git a/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc b/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc index d29dc6e3fb..8173d0fbbe 100644 --- a/chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc @@ -23,5 +39,5 @@ index d29dc6e3fb..8173d0fbbe 100644 if (base::FeatureList::IsEnabled(features::kWebUIFeedback)) { if (url.host_piece() == chrome::kChromeUIFeedbackHost) -- -2.33.2 +2.35.2 diff --git a/0002-Yandex-as-default-search-engine.patch b/0002-Yandex-as-default-search-engine.patch index c5d93ff..2b48598 100644 --- a/0002-Yandex-as-default-search-engine.patch +++ b/0002-Yandex-as-default-search-engine.patch @@ -1,4 +1,4 @@ -From b6bcaa2f6f16d65e0fffaefc6de2e94ad5780f76 Mon Sep 17 00:00:00 2001 +From 6681497319c9b7f8d5d27912284ca228408e3d9a Mon Sep 17 00:00:00 2001 From: Mikhail Novosyolov Date: Sun, 29 May 2022 22:31:21 +0300 Subject: [PATCH] Yandex as default search engine @@ -8,15 +8,19 @@ Quality of google.ru search results seems to be degradating a bit. I understand that Google develops Chromium, and so it would be fair if they got some money from adverstisment, but, firstly, they have themselves stopped all ads in Russia, -secondly, influnce of Google is a bad thing because they take part in the information war. +secondly, influnce of Google is a bad thing because they have to take part in the information war. The patch "Functional new tab page with non-Google search engines" makes chrome://new-tab-page work. Yandex's URL which is patched here does not allow to add new items in to the quick access list and shows advertisment of the proprietary Yandex browser. I do not want users to install it. + +A simpler solution would be changing chromium-default-config.json like +http://git.osmesh.ru/MOS/mos-panel-desktop/src/commit/0f02deea4f7da5ee186433cc71a7ba0193a8f52d/kometa-std-desktop-1.1/chromium.json +but it would make Yandex.ru be the default even for not Russian users. --- - components/search_engines/prepopulated_engines.json | 9 +++++---- - .../search_engines/template_url_prepopulate_data.cc | 11 ++++++----- - 2 files changed, 11 insertions(+), 9 deletions(-) + .../search_engines/prepopulated_engines.json | 9 ++++--- + .../template_url_prepopulate_data.cc | 27 ++++++++++--------- + 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/components/search_engines/prepopulated_engines.json b/components/search_engines/prepopulated_engines.json index 13572d4355..cc449a1ccb 100644 @@ -67,7 +71,7 @@ index 13572d4355..cc449a1ccb 100644 "id": 15 }, diff --git a/components/search_engines/template_url_prepopulate_data.cc b/components/search_engines/template_url_prepopulate_data.cc -index e38343c221..8efd6fd2c5 100644 +index e38343c221..4759cd6711 100644 --- a/components/search_engines/template_url_prepopulate_data.cc +++ b/components/search_engines/template_url_prepopulate_data.cc @@ -28,6 +28,7 @@ namespace { @@ -130,6 +134,29 @@ index e38343c221..8efd6fd2c5 100644 &yahoo_tr, &bing, &duckduckgo, +@@ -1381,13 +1382,15 @@ std::vector> GetPrepopulatedEngines( + t_urls = GetPrepopulationSetFromCountryID( + country_codes::GetCountryIDFromPrefs(prefs)); + } +- if (default_search_provider_index) { +- const auto itr = std::find_if( +- t_urls.begin(), t_urls.end(), +- [](const auto& t_url) { return t_url->prepopulate_id == google.id; }); +- *default_search_provider_index = +- itr == t_urls.end() ? 0 : std::distance(t_urls.begin(), itr); +- } ++ /* Making yandex_ru be the first in "const PrepopulatedEngine* const engines_RU[]" ++ * makes it be the first item in chrome://settings/search, ++ * but Google is still chosen by default. ++ * Removed code calculated the distance between 0 and Google's position ++ * and assign that position to default_search_provider_index, ++ * so that Google still was the default search engine. ++ * Instead, just use the first search engine as the default one. ++ */ ++ if (default_search_provider_index) *default_search_provider_index = 0; + return t_urls; + } + -- 2.35.2 diff --git a/0004-Hide-sync-with-Google.patch b/0004-Hide-sync-with-Google.patch new file mode 100644 index 0000000..6ce25d3 --- /dev/null +++ b/0004-Hide-sync-with-Google.patch @@ -0,0 +1,105 @@ +From 91050333ece16bfa526d6f44bf2324f71a794220 Mon Sep 17 00:00:00 2001 +From: Mikhail Novosyolov +Date: Sun, 5 Jun 2022 16:52:13 +0300 +Subject: [PATCH] Hide sync with Google + +Syncing with Google does not work noawadays because Google decided +to block it work other API keys than the ons used in Google Chrome. + +Click "Turn on sync" does not turn it on. + +Hiding: +* button in chrome://settings +* button when clicking on the user avatar on the right from the address bar +* button on the welcome page which is not shown by default in ROSA (?) + +As code is just being commented out in chrome://settings, advanced users +probably can uncomemnt it in developer tools without recompiling Chromium +if they want to use their own API keys. +--- + .../settings/people_page/sync_account_control.html | 2 ++ + chrome/browser/resources/welcome/signin_view.html | 2 ++ + chrome/browser/ui/views/profiles/profile_menu_view.cc | 9 ++++----- + 3 files changed, 8 insertions(+), 5 deletions(-) + +diff --git a/chrome/browser/resources/settings/people_page/sync_account_control.html b/chrome/browser/resources/settings/people_page/sync_account_control.html +index 70b3128642..b91ea8675a 100644 +--- a/chrome/browser/resources/settings/people_page/sync_account_control.html ++++ b/chrome/browser/resources/settings/people_page/sync_account_control.html +@@ -117,6 +117,7 @@ + + ++ +