Added Yandex search bar as default on newtab and new-tab-page. Joinded with previous patch

i8ce changed/i9e/chromium-119.0.6045.199-1.el9.inferit.2
Alexey Berezhok 1 year ago
parent baf4745797
commit 18e7e18219

@ -1,31 +1,31 @@
From e25aad27626b4f623c4da97fff225f6b729eddd0 Mon Sep 17 00:00:00 2001 From e1462e35be07ce56385a274ca4f81812417dcce6 Mon Sep 17 00:00:00 2001
From: alexey <aberezhok@msvsphere-os.ru> From: Alexey Berezhok <aberezhok@msvsphere-os.ru>
Date: Mon, 4 Dec 2023 15:59:21 +0300 Date: Tue, 5 Dec 2023 21:46:29 +0300
Subject: [PATCH] Added Yandex search bar as default on newtab and new-tab-page Subject: [PATCH] Added Yandex search bar as default on newtab and new-tab-page
--- ---
chrome/app/generated_resources.grd | 3 --- chrome/app/generated_resources.grd | 3 --
.../app/resources/generated_resources_be.xtb | 2 +- .../app/resources/generated_resources_be.xtb | 2 +-
.../resources/generated_resources_en-GB.xtb | 2 +- .../resources/generated_resources_en-GB.xtb | 2 +-
.../app/resources/generated_resources_ru.xtb | 2 +- .../app/resources/generated_resources_ru.xtb | 2 +-
.../app/resources/generated_resources_uk.xtb | 2 +- .../app/resources/generated_resources_uk.xtb | 2 +-
chrome/browser/history/top_sites_factory.cc | 4 ++-- chrome/browser/history/top_sites_factory.cc | 4 +--
.../resources/new_tab_page/lens_form.html | 1 + .../resources/new_tab_page/lens_form.html | 1 +
.../resources/new_tab_page/lens_form.ts | 19 ++++++++++++++++++- .../resources/new_tab_page/lens_form.ts | 19 ++++++++++++-
.../new_tab_page/lens_upload_dialog.html | 10 +++++----- .../new_tab_page/lens_upload_dialog.html | 10 +++----
.../browser/resources/new_tab_page/logo.html | 5 +---- .../browser/resources/new_tab_page/logo.html | 5 +---
chrome/browser/resources/new_tab_page/logo.ts | 2 +- chrome/browser/resources/new_tab_page/logo.ts | 2 +-
.../new_tab_page/realbox/realbox.html | 7 +++++++ .../new_tab_page/realbox/realbox.html | 7 +++++
chrome/browser/search/search.cc | 7 +++++++ chrome/browser/search/search.cc | 7 +++++
chrome/browser/search/search.h | 2 ++ chrome/browser/search/search.h | 2 ++
.../ui/webui/new_tab_page/new_tab_page_ui.cc | 5 +++++ .../ui/webui/new_tab_page/new_tab_page_ui.cc | 5 ++++
components/search/search.cc | 14 ++++++++++++++ components/search/search.cc | 14 ++++++++++
components/search/search.h | 7 +++++++ components/search/search.h | 7 +++++
components/search_engines/keyword_table.cc | 4 ++++ components/search_engines/keyword_table.cc | 4 +++
.../search_engines/prepopulated_engines.json | 10 +++++----- .../search_engines/prepopulated_engines.json | 21 +++++++-------
.../search_engines/template_url_data_util.cc | 6 +++++- .../search_engines/template_url_data_util.cc | 6 +++-
.../template_url_prepopulate_data.cc | 16 +++++++++++++++- .../template_url_prepopulate_data.cc | 28 +++++++++++++++----
21 files changed, 103 insertions(+), 27 deletions(-) 21 files changed, 117 insertions(+), 36 deletions(-)
diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd
index 0b10daa9ce..3c794026c7 100644 index 0b10daa9ce..3c794026c7 100644
@ -421,10 +421,19 @@ index ad6afc9ee4..d28ac27862 100644
data->suggestions_url_post_params = s.ColumnString(18); data->suggestions_url_post_params = s.ColumnString(18);
data->image_url_post_params = s.ColumnString(19); data->image_url_post_params = s.ColumnString(19);
diff --git a/components/search_engines/prepopulated_engines.json b/components/search_engines/prepopulated_engines.json diff --git a/components/search_engines/prepopulated_engines.json b/components/search_engines/prepopulated_engines.json
index eded2b55e1..844fd0ce19 100644 index 8ab6a40d2e..844fd0ce19 100644
--- a/components/search_engines/prepopulated_engines.json --- a/components/search_engines/prepopulated_engines.json
+++ b/components/search_engines/prepopulated_engines.json +++ b/components/search_engines/prepopulated_engines.json
@@ -648,7 +648,7 @@ @@ -639,7 +639,7 @@
"suggest_url": "https://suggest.yandex.by/suggest-ff.cgi?part={searchTerms}&{google:cursorPosition}",
"image_url": "https://yandex.by/images/search/?rpt=imageview",
"image_url_post_params": "upfile={google:imageThumbnail},original_width={google:imageOriginalWidth},original_height={google:imageOriginalHeight},prg=1",
- "new_tab_url": "https://www.yandex.by/chrome/newtab",
+ "new_tab_url": "chrome://new-tab-page",
"type": "SEARCH_ENGINE_YANDEX",
"id": 15
},
@@ -648,10 +648,11 @@
"name": "Yandex", "name": "Yandex",
"keyword": "yandex.com", "keyword": "yandex.com",
"favicon_url": "https://yastatic.net/lego/_/rBTjd6UOPk5913OSn5ZQVYMTQWQ.ico", "favicon_url": "https://yastatic.net/lego/_/rBTjd6UOPk5913OSn5ZQVYMTQWQ.ico",
@ -433,7 +442,11 @@ index eded2b55e1..844fd0ce19 100644
"suggest_url": "https://suggest.yandex.com/suggest-ff.cgi?part={searchTerms}&{google:cursorPosition}&uil=en&v=3&sn=5", "suggest_url": "https://suggest.yandex.com/suggest-ff.cgi?part={searchTerms}&{google:cursorPosition}&uil=en&v=3&sn=5",
"image_url": "https://yandex.com/images/search?rpt=imageview", "image_url": "https://yandex.com/images/search?rpt=imageview",
"image_url_post_params": "upfile={google:imageThumbnail},original_width={google:imageOriginalWidth},original_height={google:imageOriginalHeight},prg=1", "image_url_post_params": "upfile={google:imageThumbnail},original_width={google:imageOriginalWidth},original_height={google:imageOriginalHeight},prg=1",
@@ -662,7 +662,7 @@ + "new_tab_url": "chrome://new-tab-page",
"type": "SEARCH_ENGINE_YANDEX",
"id": 15
},
@@ -661,11 +662,11 @@
"keyword": "yandex.kz", "keyword": "yandex.kz",
"favicon_url": "https://yastatic.net/lego/_/pDu9OWAQKB0s2J9IojKpiS_Eho.ico", "favicon_url": "https://yastatic.net/lego/_/pDu9OWAQKB0s2J9IojKpiS_Eho.ico",
"logo_url": "https://storage.ape.yandex.net/get/browser/Doodles/yandex/drawable-xxhdpi/yandex.png", "logo_url": "https://storage.ape.yandex.net/get/browser/Doodles/yandex/drawable-xxhdpi/yandex.png",
@ -442,7 +455,12 @@ index eded2b55e1..844fd0ce19 100644
"suggest_url": "https://suggest.yandex.kz/suggest-ff.cgi?part={searchTerms}&{google:cursorPosition}", "suggest_url": "https://suggest.yandex.kz/suggest-ff.cgi?part={searchTerms}&{google:cursorPosition}",
"image_url": "https://yandex.kz/images/search/?rpt=imageview", "image_url": "https://yandex.kz/images/search/?rpt=imageview",
"image_url_post_params": "upfile={google:imageThumbnail},original_width={google:imageOriginalWidth},original_height={google:imageOriginalHeight},prg=1", "image_url_post_params": "upfile={google:imageThumbnail},original_width={google:imageOriginalWidth},original_height={google:imageOriginalHeight},prg=1",
@@ -676,7 +676,7 @@ - "new_tab_url": "https://www.yandex.kz/chrome/newtab",
+ "new_tab_url": "chrome://new-tab-page",
"type": "SEARCH_ENGINE_YANDEX",
"id": 15
},
@@ -675,11 +676,11 @@
"keyword": "yandex.ru", "keyword": "yandex.ru",
"favicon_url": "https://yastatic.net/lego/_/pDu9OWAQKB0s2J9IojKpiS_Eho.ico", "favicon_url": "https://yastatic.net/lego/_/pDu9OWAQKB0s2J9IojKpiS_Eho.ico",
"logo_url": "https://storage.ape.yandex.net/get/browser/Doodles/yandex/drawable-xxhdpi/yandex.png", "logo_url": "https://storage.ape.yandex.net/get/browser/Doodles/yandex/drawable-xxhdpi/yandex.png",
@ -451,7 +469,12 @@ index eded2b55e1..844fd0ce19 100644
"suggest_url": "https://suggest.yandex.ru/suggest-ff.cgi?part={searchTerms}&{google:cursorPosition}", "suggest_url": "https://suggest.yandex.ru/suggest-ff.cgi?part={searchTerms}&{google:cursorPosition}",
"image_url": "https://yandex.ru/images/search/?rpt=imageview", "image_url": "https://yandex.ru/images/search/?rpt=imageview",
"image_url_post_params": "upfile={google:imageThumbnail},original_width={google:imageOriginalWidth},original_height={google:imageOriginalHeight},prg=1", "image_url_post_params": "upfile={google:imageThumbnail},original_width={google:imageOriginalWidth},original_height={google:imageOriginalHeight},prg=1",
@@ -689,7 +689,7 @@ - "new_tab_url": "https://www.yandex.ru/chrome/newtab",
+ "new_tab_url": "chrome://new-tab-page",
"type": "SEARCH_ENGINE_YANDEX",
"id": 15
},
@@ -688,11 +689,11 @@
"name": "Yandex", "name": "Yandex",
"keyword": "yandex.com.tr", "keyword": "yandex.com.tr",
"favicon_url": "https://yastatic.net/lego/_/rBTjd6UOPk5913OSn5ZQVYMTQWQ.ico", "favicon_url": "https://yastatic.net/lego/_/rBTjd6UOPk5913OSn5ZQVYMTQWQ.ico",
@ -460,7 +483,12 @@ index eded2b55e1..844fd0ce19 100644
"suggest_url": "https://suggest.yandex.com.tr/suggest-ff.cgi?part={searchTerms}&{google:cursorPosition}", "suggest_url": "https://suggest.yandex.com.tr/suggest-ff.cgi?part={searchTerms}&{google:cursorPosition}",
"image_url": "https://yandex.com.tr/gorsel/search?rpt=imageview", "image_url": "https://yandex.com.tr/gorsel/search?rpt=imageview",
"image_url_post_params": "upfile={google:imageThumbnail},original_width={google:imageOriginalWidth},original_height={google:imageOriginalHeight},prg=1", "image_url_post_params": "upfile={google:imageThumbnail},original_width={google:imageOriginalWidth},original_height={google:imageOriginalHeight},prg=1",
@@ -703,7 +703,7 @@ - "new_tab_url": "https://www.yandex.com.tr/chrome/newtab",
+ "new_tab_url": "chrome://new-tab-page",
"type": "SEARCH_ENGINE_YANDEX",
"id": 15
},
@@ -702,11 +703,11 @@
"keyword": "yandex.ua", "keyword": "yandex.ua",
"favicon_url": "https://yastatic.net/lego/_/pDu9OWAQKB0s2J9IojKpiS_Eho.ico", "favicon_url": "https://yastatic.net/lego/_/pDu9OWAQKB0s2J9IojKpiS_Eho.ico",
"logo_url": "https://storage.ape.yandex.net/get/browser/Doodles/yandex/drawable-xxhdpi/yandex.png", "logo_url": "https://storage.ape.yandex.net/get/browser/Doodles/yandex/drawable-xxhdpi/yandex.png",
@ -469,6 +497,11 @@ index eded2b55e1..844fd0ce19 100644
"suggest_url": "https://suggest.yandex.ua/suggest-ff.cgi?part={searchTerms}&{google:cursorPosition}", "suggest_url": "https://suggest.yandex.ua/suggest-ff.cgi?part={searchTerms}&{google:cursorPosition}",
"image_url": "https://yandex.ua/images/search/?rpt=imageview", "image_url": "https://yandex.ua/images/search/?rpt=imageview",
"image_url_post_params": "upfile={google:imageThumbnail},original_width={google:imageOriginalWidth},original_height={google:imageOriginalHeight},prg=1", "image_url_post_params": "upfile={google:imageThumbnail},original_width={google:imageOriginalWidth},original_height={google:imageOriginalHeight},prg=1",
- "new_tab_url": "https://www.yandex.ua/chrome/newtab",
+ "new_tab_url": "chrome://new-tab-page",
"type": "SEARCH_ENGINE_YANDEX",
"id": 15
},
diff --git a/components/search_engines/template_url_data_util.cc b/components/search_engines/template_url_data_util.cc diff --git a/components/search_engines/template_url_data_util.cc b/components/search_engines/template_url_data_util.cc
index 82d054944a..13d2aa704e 100644 index 82d054944a..13d2aa704e 100644
--- a/components/search_engines/template_url_data_util.cc --- a/components/search_engines/template_url_data_util.cc
@ -509,10 +542,59 @@ index 82d054944a..13d2aa704e 100644
if (string_value) { if (string_value) {
contextual_search_url = *string_value; contextual_search_url = *string_value;
diff --git a/components/search_engines/template_url_prepopulate_data.cc b/components/search_engines/template_url_prepopulate_data.cc diff --git a/components/search_engines/template_url_prepopulate_data.cc b/components/search_engines/template_url_prepopulate_data.cc
index b544a89951..3f53afda71 100644 index 492a908ed6..3f53afda71 100644
--- a/components/search_engines/template_url_prepopulate_data.cc --- a/components/search_engines/template_url_prepopulate_data.cc
+++ b/components/search_engines/template_url_prepopulate_data.cc +++ b/components/search_engines/template_url_prepopulate_data.cc
@@ -1681,6 +1681,12 @@ GetPrepopulatedEnginesForEeaRegionCountries(int country_id, @@ -56,6 +56,7 @@ struct EngineAndTier {
// Default (for countries with no better engine set)
constexpr EngineAndTier engines_default[] = {
+ {SearchEngineTier::kTopEngines, &yandex_com},
{SearchEngineTier::kTopEngines, &google},
{SearchEngineTier::kTopEngines, &bing},
{SearchEngineTier::kTopEngines, &yahoo},
@@ -209,8 +210,8 @@ constexpr EngineAndTier engines_BR[] = {
// Belarus
constexpr EngineAndTier engines_BY[] = {
- {SearchEngineTier::kTopEngines, &google},
{SearchEngineTier::kTopEngines, &yandex_by},
+ {SearchEngineTier::kTopEngines, &google},
{SearchEngineTier::kTopEngines, &bing},
{SearchEngineTier::kTopEngines, &duckduckgo},
{SearchEngineTier::kTopEngines, &mail_ru},
@@ -597,9 +598,9 @@ constexpr EngineAndTier engines_IN[] = {
// Iraq
constexpr EngineAndTier engines_IQ[] = {
+ {SearchEngineTier::kTopEngines, &yandex_tr},
{SearchEngineTier::kTopEngines, &google},
{SearchEngineTier::kTopEngines, &bing},
- {SearchEngineTier::kTopEngines, &yandex_tr},
{SearchEngineTier::kTopEngines, &yahoo},
{SearchEngineTier::kTopEngines, &duckduckgo},
};
@@ -702,8 +703,8 @@ constexpr EngineAndTier engines_KW[] = {
// Kazakhstan
constexpr EngineAndTier engines_KZ[] = {
- {SearchEngineTier::kTopEngines, &google},
{SearchEngineTier::kTopEngines, &yandex_kz},
+ {SearchEngineTier::kTopEngines, &google},
{SearchEngineTier::kTopEngines, &bing},
{SearchEngineTier::kTopEngines, &mail_ru},
{SearchEngineTier::kTopEngines, &yahoo},
@@ -1172,8 +1173,8 @@ constexpr EngineAndTier engines_TN[] = {
// Turkey
constexpr EngineAndTier engines_TR[] = {
- {SearchEngineTier::kTopEngines, &google},
{SearchEngineTier::kTopEngines, &yandex_tr},
+ {SearchEngineTier::kTopEngines, &google},
{SearchEngineTier::kTopEngines, &yahoo_tr},
{SearchEngineTier::kTopEngines, &bing},
{SearchEngineTier::kTopEngines, &duckduckgo},
@@ -1680,6 +1681,12 @@ GetPrepopulatedEnginesForEeaRegionCountries(int country_id,
current_number_of_engines++; current_number_of_engines++;
} }
@ -525,26 +607,27 @@ index b544a89951..3f53afda71 100644
return t_urls; return t_urls;
} }
@@ -1775,6 +1781,14 @@ std::vector<std::unique_ptr<TemplateURLData>> GetPrepopulatedEngines( @@ -1774,12 +1781,23 @@ std::vector<std::unique_ptr<TemplateURLData>> GetPrepopulatedEngines(
} }
} }
} }
+ +
+ if (default_search_provider_index) { if (default_search_provider_index) {
+ const auto itr = const auto itr =
- base::ranges::find(t_urls, google.id, &TemplateURLData::prepopulate_id);
+ base::ranges::find(t_urls, yandex_ru.id, &TemplateURLData::prepopulate_id); + base::ranges::find(t_urls, yandex_ru.id, &TemplateURLData::prepopulate_id);
+ *default_search_provider_index = *default_search_provider_index =
+ itr == t_urls.end() ? 0 : std::distance(t_urls.begin(), itr); itr == t_urls.end() ? 0 : std::distance(t_urls.begin(), itr);
+ } }
+ +
/* Making yandex_ru be the first in "const PrepopulatedEngine* const engines_RU[]" + /* Making yandex_ru be the first in "const PrepopulatedEngine* const engines_RU[]"
* makes it be the first item in chrome://settings/search, + * makes it be the first item in chrome://settings/search,
* but Google is still chosen by default. + * but Google is still chosen by default.
@@ -1783,7 +1797,7 @@ std::vector<std::unique_ptr<TemplateURLData>> GetPrepopulatedEngines( + * Removed code calculated the distance between 0 and Google's position
* so that Google still was the default search engine. + * and assign that position to default_search_provider_index,
* Instead, just use the first search engine as the default one. + * 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; + */
+ //if (default_search_provider_index) *default_search_provider_index = 0; + //if (default_search_provider_index) *default_search_provider_index = 0;
return t_urls; return t_urls;
} }

@ -299,7 +299,7 @@
Name: chromium%{chromium_channel} Name: chromium%{chromium_channel}
Version: 119.0.6045.199 Version: 119.0.6045.199
Release: 1%{?dist}.inferit.1 Release: 1%{?dist}.inferit.2
Summary: A WebKit (Blink) powered web browser that Google doesn't want you to use Summary: A WebKit (Blink) powered web browser that Google doesn't want you to use
Url: http://www.chromium.org/Home Url: http://www.chromium.org/Home
License: BSD-3-Clause AND LGPL-2.1-or-later AND Apache-2.0 AND IJG AND MIT AND GPL-2.0-or-later AND ISC AND OpenSSL AND (MPL-1.1 OR GPL-2.0-only OR LGPL-2.0-only) License: BSD-3-Clause AND LGPL-2.1-or-later AND Apache-2.0 AND IJG AND MIT AND GPL-2.0-or-later AND ISC AND OpenSSL AND (MPL-1.1 OR GPL-2.0-only OR LGPL-2.0-only)
@ -454,10 +454,10 @@ Patch402: chromium-119-nvidia-use-separate-bo-to-verify-modifier.patch
# hide UseChromeOSDirectVideoDecoder flag on VA-API devices to avoid crashes # hide UseChromeOSDirectVideoDecoder flag on VA-API devices to avoid crashes
Patch403: chromium-119-hide-UseChromeOSDirectVideoDecoder-flag-on-VA-API-devices.patch Patch403: chromium-119-hide-UseChromeOSDirectVideoDecoder-flag-on-VA-API-devices.patch
# Yandex Search by default #Patch500: 0001-Yandex-as-default-search-engine.patch
Patch500: 0001-Yandex-as-default-search-engine.patch
# MSVSphere # MSVSphere
Patch501: 0001-Added-Russian-description-and-summary-for-gnome-soft.patch Patch501: 0001-Added-Russian-description-and-summary-for-gnome-soft.patch
# Yandex Search by default
Patch502: 0001-Added-Yandex-search-bar-as-default-on-newtab-and-new.patch Patch502: 0001-Added-Yandex-search-bar-as-default-on-newtab-and-new.patch
# Use chromium-latest.py to generate clean tarball from released build tarballs, found here: # Use chromium-latest.py to generate clean tarball from released build tarballs, found here:
@ -1133,8 +1133,9 @@ sed -i 's/std::string data_dir_basename = "chromium"/std::string data_dir_basena
%patch -P402 -p1 -b .nvidia-use-separate-bo-to-verify-modifiers %patch -P402 -p1 -b .nvidia-use-separate-bo-to-verify-modifiers
%patch -P403 -p1 -b .UseChromeOSDirectVideoDecoder-flag-on-VA-API-devices %patch -P403 -p1 -b .UseChromeOSDirectVideoDecoder-flag-on-VA-API-devices
%patch -P500 -p1 -b .Yandex-as-default-search-engine #%patch -P500 -p1 -b .Yandex-as-default-search-engine
%patch -P501 -p1 -b .Added-Russian-description-and-summary-for-gnome-soft %patch -P501 -p1 -b .Added-Russian-description-and-summary-for-gnome-soft
%patch -P502 -p1 -b .Yandex-as-default-search-engine
# We patch Chromium to open chrome://new-tab-page even with non-Google search engines # We patch Chromium to open chrome://new-tab-page even with non-Google search engines
# and to use Yandex by default instead of Google for most of our users, # and to use Yandex by default instead of Google for most of our users,
@ -1840,7 +1841,7 @@ getent group chrome-remote-desktop >/dev/null || groupadd -r chrome-remote-deskt
%endif %endif
%changelog %changelog
* Mon Dec 04 2023 Alexey Berezhok <alexey.berezhok@msvsphere-os.ru> - 119.0.6045.199-1.inferit.1 * Mon Dec 04 2023 Alexey Berezhok <alexey.berezhok@msvsphere-os.ru> - 119.0.6045.199-1.inferit.2
- Added Yandex search bar as default on newtab and new-tab-page - Added Yandex search bar as default on newtab and new-tab-page
* Thu Nov 30 2023 Arkady L. Shane <tigro@msvsphere-os.ru> - 119.0.6045.199-1.inferit * Thu Nov 30 2023 Arkady L. Shane <tigro@msvsphere-os.ru> - 119.0.6045.199-1.inferit

Loading…
Cancel
Save