You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
chromium/SOURCES/0001-Yandex-as-default-sear...

132 lines
5.7 KiB

diff -urN chromium-114.0.5735.133.orig/components/search_engines/prepopulated_engines.json chromium-114.0.5735.133/components/search_engines/prepopulated_engines.json
--- chromium-114.0.5735.133.orig/components/search_engines/prepopulated_engines.json 2023-06-30 16:00:39.781216875 +0300
+++ chromium-114.0.5735.133/components/search_engines/prepopulated_engines.json 2023-06-30 16:10:06.030718785 +0300
@@ -560,7 +560,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
},
@@ -573,6 +573,7 @@
"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_post_params": "upfile={google:imageThumbnail},original_width={google:imageOriginalWidth},original_height={google:imageOriginalHeight},prg=1",
+ "new_tab_url": "chrome://new-tab-page",
"type": "SEARCH_ENGINE_YANDEX",
"id": 15
},
@@ -586,7 +587,7 @@
"suggest_url": "https://suggest.yandex.kz/suggest-ff.cgi?part={searchTerms}&{google:cursorPosition}",
"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",
- "new_tab_url": "https://www.yandex.kz/chrome/newtab",
+ "new_tab_url": "chrome://new-tab-page",
"type": "SEARCH_ENGINE_YANDEX",
"id": 15
},
@@ -600,7 +601,7 @@
"suggest_url": "https://suggest.yandex.ru/suggest-ff.cgi?part={searchTerms}&{google:cursorPosition}",
"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",
- "new_tab_url": "https://www.yandex.ru/chrome/newtab",
+ "new_tab_url": "chrome://new-tab-page",
"type": "SEARCH_ENGINE_YANDEX",
"id": 15
},
@@ -613,7 +614,7 @@
"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_post_params": "upfile={google:imageThumbnail},original_width={google:imageOriginalWidth},original_height={google:imageOriginalHeight},prg=1",
- "new_tab_url": "https://www.yandex.com.tr/chrome/newtab",
+ "new_tab_url": "chrome://new-tab-page",
"type": "SEARCH_ENGINE_YANDEX",
"id": 15
},
@@ -627,7 +628,7 @@
"suggest_url": "https://suggest.yandex.ua/suggest-ff.cgi?part={searchTerms}&{google:cursorPosition}",
"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",
- "new_tab_url": "https://www.yandex.ua/chrome/newtab",
+ "new_tab_url": "chrome://new-tab-page",
"type": "SEARCH_ENGINE_YANDEX",
"id": 15
},
diff -urN chromium-114.0.5735.133.orig/components/search_engines/template_url_prepopulate_data.cc chromium-114.0.5735.133/components/search_engines/template_url_prepopulate_data.cc
--- chromium-114.0.5735.133.orig/components/search_engines/template_url_prepopulate_data.cc 2023-06-30 16:00:39.780216890 +0300
+++ chromium-114.0.5735.133/components/search_engines/template_url_prepopulate_data.cc 2023-06-30 16:12:58.769100093 +0300
@@ -29,6 +29,7 @@
// Default (for countries with no better engine set)
const PrepopulatedEngine* const engines_default[] = {
+ &yandex_com,
&google,
&bing,
&yahoo,
@@ -156,8 +157,8 @@
// Belarus
const PrepopulatedEngine* const engines_BY[] = {
- &google,
&yandex_by,
+ &google,
&mail_ru,
&bing,
&duckduckgo,
@@ -435,10 +436,10 @@
// Iraq
const PrepopulatedEngine* const engines_IQ[] = {
+ &yandex_tr,
&google,
&bing,
&yahoo,
- &yandex_tr,
&petal_search,
};
@@ -525,8 +526,8 @@
// Kazakhstan
const PrepopulatedEngine* const engines_KZ[] = {
- &google,
&yandex_kz,
+ &google,
&mail_ru,
&bing,
&duckduckgo,
@@ -894,8 +895,8 @@
// Turkey
const PrepopulatedEngine* const engines_TR[] = {
- &google,
&yandex_tr,
+ &google,
&yahoo_tr,
&bing,
&duckduckgo,
@@ -1382,12 +1383,15 @@
t_urls = GetPrepopulationSetFromCountryID(
country_codes::GetCountryIDFromPrefs(prefs));
}
- if (default_search_provider_index) {
- const auto itr =
- base::ranges::find(t_urls, google.id, &TemplateURLData::prepopulate_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;
}