diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2018-08-28 15:28:34 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2018-08-28 13:54:51 +0000 |
commit | 2a19c63448c84c1805fb1a585c3651318bb86ca7 (patch) | |
tree | eb17888e8531aa6ee5e85721bd553b832a7e5156 /chromium/components/search_engines | |
parent | b014812705fc80bff0a5c120dfcef88f349816dc (diff) | |
download | qtwebengine-chromium-2a19c63448c84c1805fb1a585c3651318bb86ca7.tar.gz |
BASELINE: Update Chromium to 69.0.3497.70
Change-Id: I2b7b56e4e7a8b26656930def0d4575dc32b900a0
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'chromium/components/search_engines')
8 files changed, 143 insertions, 114 deletions
diff --git a/chromium/components/search_engines/BUILD.gn b/chromium/components/search_engines/BUILD.gn index 90e00b4b68a..b5c89d4f919 100644 --- a/chromium/components/search_engines/BUILD.gn +++ b/chromium/components/search_engines/BUILD.gn @@ -77,6 +77,7 @@ static_library("search_engines") { "//components/url_formatter", "//google_apis", "//net", + "//services/network/public/cpp", "//sql", "//third_party/libxml", "//ui/base", @@ -140,6 +141,8 @@ source_set("unit_tests") { "//components/sync_preferences:test_support", "//components/webdata/common", "//net:net", + "//services/network:test_support", + "//services/network/public/cpp", "//sql", "//testing/gmock", "//testing/gtest", diff --git a/chromium/components/search_engines/DEPS b/chromium/components/search_engines/DEPS index a5e5859cae6..5f550b12827 100644 --- a/chromium/components/search_engines/DEPS +++ b/chromium/components/search_engines/DEPS @@ -17,6 +17,8 @@ include_rules = [ "+google_apis", "+libxml", "+net", + "+services/network/public/cpp", + "+services/network/test", "+sql", "+ui/base", "+ui/gfx", diff --git a/chromium/components/search_engines/prepopulated_engines.json b/chromium/components/search_engines/prepopulated_engines.json index 4571a4ca4f3..535692d44a7 100644 --- a/chromium/components/search_engines/prepopulated_engines.json +++ b/chromium/components/search_engines/prepopulated_engines.json @@ -32,7 +32,7 @@ // Increment this if you change the data in ways that mean users with // existing data should get a new version. - "kCurrentDataVersion": 102 + "kCurrentDataVersion": 103 }, // The following engines are included in country lists and are added to the @@ -86,6 +86,11 @@ "keyword": "baidu.com", "favicon_url": "https://www.baidu.com/favicon.ico", "search_url": "https://www.baidu.com/#ie={inputEncoding}&wd={searchTerms}", + "alternate_urls": [ + "https://www.baidu.com/s?ie={inputEncoding}&wd={searchTerms}", + "https://www.baidu.com/s?ie={inputEncoding}&word={searchTerms}", + "https://www.baidu.com/{google:pathWildcard}/s?ie={inputEncoding}&word={searchTerms}" + ], "suggest_url": "http://suggestion.baidu.com/su?wd={searchTerms}&action=opensearch&ie={inputEncoding}", "type": "SEARCH_ENGINE_BAIDU", "id": 21 @@ -149,6 +154,9 @@ "keyword": "mail.ru", "favicon_url": "https://go.imgsmail.ru/favicon.ico", "search_url": "https://go.mail.ru/search?q={searchTerms}&{mailru:referralID}", + "alternate_urls": [ + "https://go.mail.ru/msearch?q={searchTerms}&{mailru:referralID}" + ], "encoding": "windows-1251", "suggest_url": "https://suggests.go.mail.ru/chrome?q={searchTerms}", "type": "SEARCH_ENGINE_MAILRU", @@ -198,6 +206,10 @@ "keyword": "so.com", "favicon_url": "https://www.so.com/favicon.ico", "search_url": "https://www.so.com/s?ie={inputEncoding}&q={searchTerms}", + "alternate_urls": [ + "https://m.so.com/s?ie={inputEncoding}&q={searchTerms}", + "https://m.so.com/index.php?ie={inputEncoding}&q={searchTerms}" + ], "suggest_url": "https://sug.so.360.cn/suggest?encodein={inputEncoding}&encodeout={outputEncoding}&format=opensearch&word={searchTerms}", "type": "SEARCH_ENGINE_360", "id": 88 @@ -208,6 +220,9 @@ "keyword": "sogou.com", "favicon_url": "https://www.sogou.com/images/logo/old/favicon.ico", "search_url": "https://www.sogou.com/web?ie={inputEncoding}&query={searchTerms}", + "alternate_urls": [ + "https://m.sogou.com/web/{google:pathWildcard}?ie={inputEncoding}&keyword={searchTerms}" + ], "suggest_url": "http://api.sugg.sogou.com/su?type=addrbar&key={searchTerms}&ie={inputEncoding}", "type": "SEARCH_ENGINE_SOGOU", "id": 56 @@ -236,7 +251,7 @@ "name": "Yahoo!", "keyword": "yahoo.com", "favicon_url": "https://search.yahoo.com/favicon.ico", - "search_url": "https://search.yahoo.com/search?ei={inputEncoding}&fr=crmas&p={searchTerms}", + "search_url": "https://search.yahoo.com/search{google:pathWildcard}?ei={inputEncoding}&fr=crmas&p={searchTerms}", "suggest_url": "https://search.yahoo.com/sugg/chrome?output=fxjson&appid=crmas&command={searchTerms}", "type": "SEARCH_ENGINE_YAHOO", "id": 2 @@ -246,7 +261,7 @@ "name": "Yahoo! Argentina", "keyword": "ar.yahoo.com", "favicon_url": "https://ar.search.yahoo.com/favicon.ico", - "search_url": "https://ar.search.yahoo.com/search?ei={inputEncoding}&fr=crmas&p={searchTerms}", + "search_url": "https://ar.search.yahoo.com/search{google:pathWildcard}?ei={inputEncoding}&fr=crmas&p={searchTerms}", "suggest_url": "https://ar.search.yahoo.com/sugg/chrome?output=fxjson&appid=crmas&command={searchTerms}", "type": "SEARCH_ENGINE_YAHOO", "id": 2 @@ -256,7 +271,7 @@ "name": "Yahoo! \u00d6sterreich", "keyword": "at.yahoo.com", "favicon_url": "https://at.search.yahoo.com/favicon.ico", - "search_url": "https://at.search.yahoo.com/search?ei={inputEncoding}&fr=crmas&p={searchTerms}", + "search_url": "https://at.search.yahoo.com/search{google:pathWildcard}?ei={inputEncoding}&fr=crmas&p={searchTerms}", "suggest_url": "https://at.search.yahoo.com/sugg/chrome?output=fxjson&appid=crmas&command={searchTerms}", "type": "SEARCH_ENGINE_YAHOO", "id": 2 @@ -266,7 +281,7 @@ "name": "Yahoo!7", "keyword": "au.yahoo.com", "favicon_url": "https://au.search.yahoo.com/favicon.ico", - "search_url": "https://au.search.yahoo.com/search?ei={inputEncoding}&fr=crmas&p={searchTerms}", + "search_url": "https://au.search.yahoo.com/search{google:pathWildcard}?ei={inputEncoding}&fr=crmas&p={searchTerms}", "suggest_url": "https://au.search.yahoo.com/sugg/chrome?output=fxjson&appid=crmas&command={searchTerms}", "type": "SEARCH_ENGINE_YAHOO", "id": 2 @@ -276,7 +291,7 @@ "name": "Yahoo! Brasil", "keyword": "br.yahoo.com", "favicon_url": "https://br.search.yahoo.com/favicon.ico", - "search_url": "https://br.search.yahoo.com/search?ei={inputEncoding}&fr=crmas&p={searchTerms}", + "search_url": "https://br.search.yahoo.com/search{google:pathWildcard}?ei={inputEncoding}&fr=crmas&p={searchTerms}", "suggest_url": "https://br.search.yahoo.com/sugg/chrome?output=fxjson&appid=crmas&command={searchTerms}", "type": "SEARCH_ENGINE_YAHOO", "id": 2 @@ -286,7 +301,7 @@ "name": "Yahoo! Canada", "keyword": "ca.yahoo.com", "favicon_url": "https://ca.search.yahoo.com/favicon.ico", - "search_url": "https://ca.search.yahoo.com/search?ei={inputEncoding}&fr=crmas&p={searchTerms}", + "search_url": "https://ca.search.yahoo.com/search{google:pathWildcard}?ei={inputEncoding}&fr=crmas&p={searchTerms}", "suggest_url": "https://ca.search.yahoo.com/sugg/chrome?output=fxjson&appid=crmas&command={searchTerms}", "type": "SEARCH_ENGINE_YAHOO", "id": 2 @@ -296,7 +311,7 @@ "name": "Yahoo! Schweiz", "keyword": "ch.yahoo.com", "favicon_url": "https://ch.search.yahoo.com/favicon.ico", - "search_url": "https://ch.search.yahoo.com/search?ei={inputEncoding}&fr=crmas&p={searchTerms}", + "search_url": "https://ch.search.yahoo.com/search{google:pathWildcard}?ei={inputEncoding}&fr=crmas&p={searchTerms}", "suggest_url": "https://ch.search.yahoo.com/sugg/chrome?output=fxjson&appid=crmas&command={searchTerms}", "type": "SEARCH_ENGINE_YAHOO", "id": 2 @@ -306,7 +321,7 @@ "name": "Yahoo! Chile", "keyword": "cl.yahoo.com", "favicon_url": "https://cl.search.yahoo.com/favicon.ico", - "search_url": "https://cl.search.yahoo.com/search?ei={inputEncoding}&fr=crmas&p={searchTerms}", + "search_url": "https://cl.search.yahoo.com/search{google:pathWildcard}?ei={inputEncoding}&fr=crmas&p={searchTerms}", "suggest_url": "https://cl.search.yahoo.com/sugg/chrome?output=fxjson&appid=crmas&command={searchTerms}", "type": "SEARCH_ENGINE_YAHOO", "id": 2 @@ -316,7 +331,7 @@ "name": "Yahoo! Colombia", "keyword": "co.yahoo.com", "favicon_url": "https://co.search.yahoo.com/favicon.ico", - "search_url": "https://co.search.yahoo.com/search?ei={inputEncoding}&fr=crmas&p={searchTerms}", + "search_url": "https://co.search.yahoo.com/search{google:pathWildcard}?ei={inputEncoding}&fr=crmas&p={searchTerms}", "suggest_url": "https://co.search.yahoo.com/sugg/chrome?output=fxjson&appid=crmas&command={searchTerms}", "type": "SEARCH_ENGINE_YAHOO", "id": 2 @@ -326,7 +341,7 @@ "name": "Yahoo! Deutschland", "keyword": "de.yahoo.com", "favicon_url": "https://de.search.yahoo.com/favicon.ico", - "search_url": "https://de.search.yahoo.com/search?ei={inputEncoding}&fr=crmas&p={searchTerms}", + "search_url": "https://de.search.yahoo.com/search{google:pathWildcard}?ei={inputEncoding}&fr=crmas&p={searchTerms}", "suggest_url": "https://de.search.yahoo.com/sugg/chrome?output=fxjson&appid=crmas&command={searchTerms}", "type": "SEARCH_ENGINE_YAHOO", "id": 2 @@ -339,7 +354,7 @@ "name": "Yahoo! Danmark", "keyword": "dk.yahoo.com", "favicon_url": "https://dk.search.yahoo.com/favicon.ico", - "search_url": "https://dk.search.yahoo.com/search?ei={inputEncoding}&fr=crmas&p={searchTerms}", + "search_url": "https://dk.search.yahoo.com/search{google:pathWildcard}?ei={inputEncoding}&fr=crmas&p={searchTerms}", "type": "SEARCH_ENGINE_YAHOO", "id": 2 }, @@ -348,7 +363,7 @@ "name": "Yahoo! Espa\u00f1a", "keyword": "es.yahoo.com", "favicon_url": "https://es.search.yahoo.com/favicon.ico", - "search_url": "https://es.search.yahoo.com/search?ei={inputEncoding}&fr=crmas&p={searchTerms}", + "search_url": "https://es.search.yahoo.com/search{google:pathWildcard}?ei={inputEncoding}&fr=crmas&p={searchTerms}", "suggest_url": "https://es.search.yahoo.com/sugg/chrome?output=fxjson&appid=crmas&command={searchTerms}", "type": "SEARCH_ENGINE_YAHOO", "id": 2 @@ -358,7 +373,7 @@ "name": "Yahoo! Suomi", "keyword": "fi.yahoo.com", "favicon_url": "https://fi.search.yahoo.com/favicon.ico", - "search_url": "https://fi.search.yahoo.com/search?ei={inputEncoding}&fr=crmas&p={searchTerms}", + "search_url": "https://fi.search.yahoo.com/search{google:pathWildcard}?ei={inputEncoding}&fr=crmas&p={searchTerms}", "type": "SEARCH_ENGINE_YAHOO", "id": 2 }, @@ -367,7 +382,7 @@ "name": "Yahoo! France", "keyword": "fr.yahoo.com", "favicon_url": "https://fr.search.yahoo.com/favicon.ico", - "search_url": "https://fr.search.yahoo.com/search?ei={inputEncoding}&fr=crmas&p={searchTerms}", + "search_url": "https://fr.search.yahoo.com/search{google:pathWildcard}?ei={inputEncoding}&fr=crmas&p={searchTerms}", "suggest_url": "https://fr.search.yahoo.com/sugg/chrome?output=fxjson&appid=crmas&command={searchTerms}", "type": "SEARCH_ENGINE_YAHOO", "id": 5 // Can't be 2 as this has to appear in the Belgium list alongside @@ -378,7 +393,7 @@ "name": "Yahoo! \u0395\u03bb\u03bb\u03ac\u03b4\u03b1\u03c2", "keyword": "gr.yahoo.com", "favicon_url": "https://gr.search.yahoo.com/favicon.ico", - "search_url": "https://gr.search.yahoo.com/search?ei={inputEncoding}&fr=crmas&p={searchTerms}", + "search_url": "https://gr.search.yahoo.com/search{google:pathWildcard}?ei={inputEncoding}&fr=crmas&p={searchTerms}", "type": "SEARCH_ENGINE_YAHOO", "id": 2 }, @@ -387,7 +402,7 @@ "name": "Yahoo! Hong Kong", "keyword": "hk.yahoo.com", "favicon_url": "https://hk.search.yahoo.com/favicon.ico", - "search_url": "https://hk.search.yahoo.com/search?ei={inputEncoding}&fr=crmas&p={searchTerms}", + "search_url": "https://hk.search.yahoo.com/search{google:pathWildcard}?ei={inputEncoding}&fr=crmas&p={searchTerms}", "suggest_url": "https://hk.search.yahoo.com/sugg/chrome?output=fxjson&appid=crmas&command={searchTerms}", "type": "SEARCH_ENGINE_YAHOO", "id": 2 @@ -397,7 +412,7 @@ "name": "Yahoo! Indonesia", "keyword": "id.yahoo.com", "favicon_url": "https://id.search.yahoo.com/favicon.ico", - "search_url": "https://id.search.yahoo.com/search?ei={inputEncoding}&fr=crmas&p={searchTerms}", + "search_url": "https://id.search.yahoo.com/search{google:pathWildcard}?ei={inputEncoding}&fr=crmas&p={searchTerms}", "suggest_url": "https://id.search.yahoo.com/sugg/chrome?output=fxjson&appid=crmas&command={searchTerms}", "type": "SEARCH_ENGINE_YAHOO", "id": 2 @@ -407,7 +422,7 @@ "name": "Yahoo! India", "keyword": "in.yahoo.com", "favicon_url": "https://in.search.yahoo.com/favicon.ico", - "search_url": "https://in.search.yahoo.com/search?ei={inputEncoding}&fr=crmas&p={searchTerms}", + "search_url": "https://in.search.yahoo.com/search{google:pathWildcard}?ei={inputEncoding}&fr=crmas&p={searchTerms}", "suggest_url": "https://in.search.yahoo.com/sugg/chrome?output=fxjson&appid=crmas&command={searchTerms}", "type": "SEARCH_ENGINE_YAHOO", "id": 2 @@ -417,7 +432,7 @@ "name": "Yahoo! JAPAN", "keyword": "yahoo.co.jp", "favicon_url": "https://search.yahoo.co.jp/favicon.ico", - "search_url": "https://search.yahoo.co.jp/search?ei={inputEncoding}&fr=crmas&p={searchTerms}", + "search_url": "https://search.yahoo.co.jp/search{google:pathWildcard}?ei={inputEncoding}&fr=crmas&p={searchTerms}", "suggest_url": "https://search.yahooapis.jp/AssistSearchService/V2/webassistSearch?p={searchTerms}&appid=oQsoxcyxg66enp0TYoirkKoryq6rF8bK76mW0KYxZ0v0WPLtn.Lix6wy8F_LwGWHUII-&output=fxjson&fr=crmas", "type": "SEARCH_ENGINE_YAHOO", "id": 2 @@ -427,7 +442,7 @@ "name": "Yahoo!\u200e \u0645\u0643\u062a\u0648\u0628", "keyword": "maktoob.yahoo.com", "favicon_url": "https://maktoob.search.yahoo.com/favicon.ico", - "search_url": "https://maktoob.search.yahoo.com/search?ei={inputEncoding}&fr=crmas&p={searchTerms}", + "search_url": "https://maktoob.search.yahoo.com/search{google:pathWildcard}?ei={inputEncoding}&fr=crmas&p={searchTerms}", "type": "SEARCH_ENGINE_YAHOO", "id": 2 }, @@ -436,7 +451,7 @@ "name": "Yahoo! M\u00e9xico", "keyword": "mx.yahoo.com", "favicon_url": "https://mx.search.yahoo.com/favicon.ico", - "search_url": "https://mx.search.yahoo.com/search?ei={inputEncoding}&fr=crmas&p={searchTerms}", + "search_url": "https://mx.search.yahoo.com/search{google:pathWildcard}?ei={inputEncoding}&fr=crmas&p={searchTerms}", "suggest_url": "https://mx.search.yahoo.com/sugg/chrome?output=fxjson&appid=crmas&command={searchTerms}", "type": "SEARCH_ENGINE_YAHOO", "id": 2 @@ -446,7 +461,7 @@ "name": "Yahoo! Malaysia", "keyword": "malaysia.yahoo.com", "favicon_url": "https://malaysia.search.yahoo.com/favicon.ico", - "search_url": "https://malaysia.search.yahoo.com/search?ei={inputEncoding}&fr=crmas&p={searchTerms}", + "search_url": "https://malaysia.search.yahoo.com/search{google:pathWildcard}?ei={inputEncoding}&fr=crmas&p={searchTerms}", "suggest_url": "https://malaysia.search.yahoo.com/sugg/chrome?output=fxjson&appid=crmas&command={searchTerms}", "type": "SEARCH_ENGINE_YAHOO", "id": 2 @@ -456,7 +471,7 @@ "name": "Yahoo! Nederland", "keyword": "nl.yahoo.com", "favicon_url": "https://nl.search.yahoo.com/favicon.ico", - "search_url": "https://nl.search.yahoo.com/search?ei={inputEncoding}&fr=crmas&p={searchTerms}", + "search_url": "https://nl.search.yahoo.com/search{google:pathWildcard}?ei={inputEncoding}&fr=crmas&p={searchTerms}", "suggest_url": "https://nl.search.yahoo.com/sugg/chrome?output=fxjson&appid=crmas&command={searchTerms}", "type": "SEARCH_ENGINE_YAHOO", "id": 2 @@ -466,7 +481,7 @@ "name": "Yahoo! New Zealand", "keyword": "nz.yahoo.com", "favicon_url": "https://nz.search.yahoo.com/favicon.ico", - "search_url": "https://nz.search.yahoo.com/search?ei={inputEncoding}&fr=crmas&p={searchTerms}", + "search_url": "https://nz.search.yahoo.com/search{google:pathWildcard}?ei={inputEncoding}&fr=crmas&p={searchTerms}", "suggest_url": "https://nz.search.yahoo.com/sugg/chrome?output=fxjson&appid=crmas&command={searchTerms}", "type": "SEARCH_ENGINE_YAHOO", "id": 2 @@ -476,7 +491,7 @@ "name": "Yahoo! Per\u00fa", "keyword": "pe.yahoo.com", "favicon_url": "https://pe.search.yahoo.com/favicon.ico", - "search_url": "https://pe.search.yahoo.com/search?ei={inputEncoding}&fr=crmas&p={searchTerms}", + "search_url": "https://pe.search.yahoo.com/search{google:pathWildcard}?ei={inputEncoding}&fr=crmas&p={searchTerms}", "suggest_url": "https://pe.search.yahoo.com/sugg/chrome?output=fxjson&appid=crmas&command={searchTerms}", "type": "SEARCH_ENGINE_YAHOO", "id": 2 @@ -486,7 +501,7 @@ "name": "Yahoo! Philippines", "keyword": "ph.yahoo.com", "favicon_url": "https://ph.search.yahoo.com/favicon.ico", - "search_url": "https://ph.search.yahoo.com/search?ei={inputEncoding}&fr=crmas&p={searchTerms}", + "search_url": "https://ph.search.yahoo.com/search{google:pathWildcard}?ei={inputEncoding}&fr=crmas&p={searchTerms}", "suggest_url": "https://ph.search.yahoo.com/sugg/chrome?output=fxjson&appid=crmas&command={searchTerms}", "type": "SEARCH_ENGINE_YAHOO", "id": 2 @@ -496,7 +511,7 @@ "name": "Yahoo! Qu\u00e9bec", "keyword": "qc.yahoo.com", "favicon_url": "https://qc.search.yahoo.com/favicon.ico", - "search_url": "https://qc.search.yahoo.com/search?ei={inputEncoding}&fr=crmas&p={searchTerms}", + "search_url": "https://qc.search.yahoo.com/search{google:pathWildcard}?ei={inputEncoding}&fr=crmas&p={searchTerms}", "suggest_url": "https://qc.search.yahoo.com/sugg/chrome?output=fxjson&appid=crmas&command={searchTerms}", "type": "SEARCH_ENGINE_YAHOO", "id": 5 // Can't be 2 as this has to appear in the Canada list alongside @@ -507,7 +522,7 @@ "name": "Yahoo! Rom\u00e2nia", "keyword": "ro.yahoo.com", "favicon_url": "https://ro.search.yahoo.com/favicon.ico", - "search_url": "https://ro.search.yahoo.com/search?ei={inputEncoding}&fr=crmas&p={searchTerms}", + "search_url": "https://ro.search.yahoo.com/search{google:pathWildcard}?ei={inputEncoding}&fr=crmas&p={searchTerms}", "type": "SEARCH_ENGINE_YAHOO", "id": 2 }, @@ -516,7 +531,7 @@ "name": "Yahoo! Sverige", "keyword": "se.yahoo.com", "favicon_url": "https://se.search.yahoo.com/favicon.ico", - "search_url": "https://se.search.yahoo.com/search?ei={inputEncoding}&fr=crmas&p={searchTerms}", + "search_url": "https://se.search.yahoo.com/search{google:pathWildcard}?ei={inputEncoding}&fr=crmas&p={searchTerms}", "type": "SEARCH_ENGINE_YAHOO", "id": 2 }, @@ -525,7 +540,7 @@ "name": "Yahoo! Singapore", "keyword": "sg.yahoo.com", "favicon_url": "https://sg.search.yahoo.com/favicon.ico", - "search_url": "https://sg.search.yahoo.com/search?ei={inputEncoding}&fr=crmas&p={searchTerms}", + "search_url": "https://sg.search.yahoo.com/search{google:pathWildcard}?ei={inputEncoding}&fr=crmas&p={searchTerms}", "suggest_url": "https://sg.search.yahoo.com/sugg/chrome?output=fxjson&appid=crmas&command={searchTerms}", "type": "SEARCH_ENGINE_YAHOO", "id": 2 @@ -535,7 +550,7 @@ "name": "Yahoo! \u0e1b\u0e23\u0e30\u0e40\u0e17\u0e28\u0e44\u0e17\u0e22", "keyword": "th.yahoo.com", "favicon_url": "https://th.search.yahoo.com/favicon.ico", - "search_url": "https://th.search.yahoo.com/search?ei={inputEncoding}&fr=crmas&p={searchTerms}", + "search_url": "https://th.search.yahoo.com/search{google:pathWildcard}?ei={inputEncoding}&fr=crmas&p={searchTerms}", "suggest_url": "https://th.search.yahoo.com/sugg/chrome?output=fxjson&appid=crmas&command={searchTerms}", "type": "SEARCH_ENGINE_YAHOO", "id": 2 @@ -545,7 +560,7 @@ "name": "Yahoo! T\u00fcrkiye", "keyword": "tr.yahoo.com", "favicon_url": "https://tr.search.yahoo.com/favicon.ico", - "search_url": "https://tr.search.yahoo.com/search?ei={inputEncoding}&fr=crmas&p={searchTerms}", + "search_url": "https://tr.search.yahoo.com/search{google:pathWildcard}?ei={inputEncoding}&fr=crmas&p={searchTerms}", "type": "SEARCH_ENGINE_YAHOO", "id": 2 }, @@ -554,7 +569,7 @@ "name": "Yahoo!\u5947\u6469", "keyword": "tw.yahoo.com", "favicon_url": "https://tw.search.yahoo.com/favicon.ico", - "search_url": "https://tw.search.yahoo.com/search?ei={inputEncoding}&fr=crmas&p={searchTerms}", + "search_url": "https://tw.search.yahoo.com/search{google:pathWildcard}?ei={inputEncoding}&fr=crmas&p={searchTerms}", "suggest_url": "https://tw.search.yahoo.com/sugg/chrome?output=fxjson&appid=crmas&command={searchTerms}", "type": "SEARCH_ENGINE_YAHOO", "id": 2 @@ -564,7 +579,7 @@ "name": "Yahoo! UK & Ireland", "keyword": "uk.yahoo.com", "favicon_url": "https://uk.search.yahoo.com/favicon.ico", - "search_url": "https://uk.search.yahoo.com/search?ei={inputEncoding}&fr=crmas&p={searchTerms}", + "search_url": "https://uk.search.yahoo.com/search{google:pathWildcard}?ei={inputEncoding}&fr=crmas&p={searchTerms}", "suggest_url": "https://uk.search.yahoo.com/sugg/chrome?output=fxjson&appid=crmas&command={searchTerms}", "type": "SEARCH_ENGINE_YAHOO", "id": 2 @@ -574,7 +589,7 @@ "name": "Yahoo! Venezuela", "keyword": "ve.yahoo.com", "favicon_url": "https://ve.search.yahoo.com/favicon.ico", - "search_url": "https://ve.search.yahoo.com/search?ei={inputEncoding}&fr=crmas&p={searchTerms}", + "search_url": "https://ve.search.yahoo.com/search{google:pathWildcard}?ei={inputEncoding}&fr=crmas&p={searchTerms}", "suggest_url": "https://ve.search.yahoo.com/sugg/chrome?output=fxjson&appid=crmas&command={searchTerms}", "type": "SEARCH_ENGINE_YAHOO", "id": 2 @@ -584,7 +599,7 @@ "name": "Yahoo! Vi\u1ec7t Nam", "keyword": "vn.yahoo.com", "favicon_url": "https://vn.search.yahoo.com/favicon.ico", - "search_url": "https://vn.search.yahoo.com/search?ei={inputEncoding}&fr=crmas&p={searchTerms}", + "search_url": "https://vn.search.yahoo.com/search{google:pathWildcard}?ei={inputEncoding}&fr=crmas&p={searchTerms}", "suggest_url": "https://vn.search.yahoo.com/sugg/chrome?output=fxjson&appid=crmas&command={searchTerms}", "type": "SEARCH_ENGINE_YAHOO", "id": 2 diff --git a/chromium/components/search_engines/search_engine_data_type_controller_unittest.cc b/chromium/components/search_engines/search_engine_data_type_controller_unittest.cc index e71aa9259a5..c61dd5df173 100644 --- a/chromium/components/search_engines/search_engine_data_type_controller_unittest.cc +++ b/chromium/components/search_engines/search_engine_data_type_controller_unittest.cc @@ -134,9 +134,9 @@ TEST_F(SyncSearchEngineDataTypeControllerTest, StartAssociationFailed) { syncer::SEARCH_ENGINES)); Start(); - EXPECT_EQ(syncer::DataTypeController::DISABLED, search_engine_dtc_.state()); + EXPECT_EQ(syncer::DataTypeController::FAILED, search_engine_dtc_.state()); EXPECT_FALSE(syncable_service_.syncing()); - search_engine_dtc_.Stop(); + search_engine_dtc_.Stop(syncer::KEEP_METADATA); EXPECT_EQ(syncer::DataTypeController::NOT_RUNNING, search_engine_dtc_.state()); EXPECT_FALSE(syncable_service_.syncing()); @@ -153,7 +153,7 @@ TEST_F(SyncSearchEngineDataTypeControllerTest, Stop) { Start(); EXPECT_EQ(syncer::DataTypeController::RUNNING, search_engine_dtc_.state()); EXPECT_TRUE(syncable_service_.syncing()); - search_engine_dtc_.Stop(); + search_engine_dtc_.Stop(syncer::KEEP_METADATA); EXPECT_EQ(syncer::DataTypeController::NOT_RUNNING, search_engine_dtc_.state()); // AsyncDirectoryTypeController::Stop posts call to StopLocalService to model @@ -171,7 +171,7 @@ TEST_F(SyncSearchEngineDataTypeControllerTest, StopBeforeLoaded) { EXPECT_EQ(syncer::DataTypeController::MODEL_STARTING, search_engine_dtc_.state()); EXPECT_FALSE(syncable_service_.syncing()); - search_engine_dtc_.Stop(); + search_engine_dtc_.Stop(syncer::KEEP_METADATA); EXPECT_EQ(nullptr, search_engine_dtc_.GetSubscriptionForTesting()); EXPECT_EQ(syncer::DataTypeController::NOT_RUNNING, search_engine_dtc_.state()); diff --git a/chromium/components/search_engines/template_url.cc b/chromium/components/search_engines/template_url.cc index bcb27362724..1c945fecb78 100644 --- a/chromium/components/search_engines/template_url.cc +++ b/chromium/components/search_engines/template_url.cc @@ -15,6 +15,7 @@ #include "base/logging.h" #include "base/macros.h" #include "base/metrics/field_trial.h" +#include "base/stl_util.h" #include "base/strings/string_number_conversions.h" #include "base/strings/string_piece.h" #include "base/strings/string_split.h" @@ -1441,7 +1442,7 @@ void TemplateURL::EncodeSearchTerms( base::string16* encoded_original_query) const { std::vector<std::string> encodings(input_encodings()); - if (std::find(encodings.begin(), encodings.end(), "UTF-8") == encodings.end()) + if (!base::ContainsValue(encodings, "UTF-8")) encodings.push_back("UTF-8"); for (auto i = encodings.begin(); i != encodings.end(); ++i) { if (TryEncoding(search_terms_args.search_terms, diff --git a/chromium/components/search_engines/template_url_fetcher.cc b/chromium/components/search_engines/template_url_fetcher.cc index 47a8a7904db..a930d09b6ad 100644 --- a/chromium/components/search_engines/template_url_fetcher.cc +++ b/chromium/components/search_engines/template_url_fetcher.cc @@ -13,10 +13,8 @@ #include "components/search_engines/template_url_service.h" #include "net/base/load_flags.h" #include "net/traffic_annotation/network_traffic_annotation.h" -#include "net/url_request/url_fetcher.h" -#include "net/url_request/url_fetcher_delegate.h" -#include "net/url_request/url_request_context_getter.h" -#include "net/url_request/url_request_status.h" +#include "services/network/public/cpp/resource_request.h" +#include "services/network/public/cpp/simple_url_loader.h" namespace { @@ -46,19 +44,20 @@ constexpr net::NetworkTrafficAnnotationTag kTrafficAnnotation = } // namespace // RequestDelegate ------------------------------------------------------------ -class TemplateURLFetcher::RequestDelegate : public net::URLFetcherDelegate { +class TemplateURLFetcher::RequestDelegate { public: - RequestDelegate( - TemplateURLFetcher* fetcher, - const base::string16& keyword, - const GURL& osdd_url, - const GURL& favicon_url, - const URLFetcherCustomizeCallback& url_fetcher_customize_callback); - - // net::URLFetcherDelegate: + RequestDelegate(TemplateURLFetcher* fetcher, + const base::string16& keyword, + const GURL& osdd_url, + const GURL& favicon_url, + const url::Origin& initiator, + network::mojom::URLLoaderFactory* url_loader_factory, + int render_frame_id, + int resource_type); + // If data contains a valid OSDD, a TemplateURL is created and added to // the TemplateURLService. - void OnURLFetchComplete(const net::URLFetcher* source) override; + void OnSimpleLoaderComplete(std::unique_ptr<std::string> response_body); // URL of the OSDD. GURL url() const { return osdd_url_; } @@ -70,7 +69,7 @@ class TemplateURLFetcher::RequestDelegate : public net::URLFetcherDelegate { void OnLoaded(); void AddSearchProvider(); - std::unique_ptr<net::URLFetcher> url_fetcher_; + std::unique_ptr<network::SimpleURLLoader> simple_url_loader_; TemplateURLFetcher* fetcher_; std::unique_ptr<TemplateURL> template_url_; base::string16 keyword_; @@ -87,12 +86,11 @@ TemplateURLFetcher::RequestDelegate::RequestDelegate( const base::string16& keyword, const GURL& osdd_url, const GURL& favicon_url, - const URLFetcherCustomizeCallback& url_fetcher_customize_callback) - : url_fetcher_(net::URLFetcher::Create(osdd_url, - net::URLFetcher::GET, - this, - kTrafficAnnotation)), - fetcher_(fetcher), + const url::Origin& initiator, + network::mojom::URLLoaderFactory* url_loader_factory, + int render_frame_id, + int resource_type) + : fetcher_(fetcher), keyword_(keyword), osdd_url_(osdd_url), favicon_url_(favicon_url) { @@ -107,14 +105,22 @@ TemplateURLFetcher::RequestDelegate::RequestDelegate( model->Load(); } - if (!url_fetcher_customize_callback.is_null()) - url_fetcher_customize_callback.Run(url_fetcher_.get()); - - url_fetcher_->SetLoadFlags(net::LOAD_DO_NOT_SEND_COOKIES | - net::LOAD_DO_NOT_SAVE_COOKIES | - net::LOAD_DO_NOT_SEND_AUTH_DATA); - url_fetcher_->SetRequestContext(fetcher->request_context_.get()); - url_fetcher_->Start(); + auto resource_request = std::make_unique<network::ResourceRequest>(); + resource_request->url = osdd_url; + resource_request->request_initiator = initiator; + resource_request->render_frame_id = render_frame_id; + resource_request->resource_type = resource_type; + resource_request->load_flags = net::LOAD_DO_NOT_SEND_COOKIES | + net::LOAD_DO_NOT_SAVE_COOKIES | + net::LOAD_DO_NOT_SEND_AUTH_DATA; + simple_url_loader_ = network::SimpleURLLoader::Create( + std::move(resource_request), kTrafficAnnotation); + simple_url_loader_->DownloadToString( + url_loader_factory, + base::BindOnce( + &TemplateURLFetcher::RequestDelegate::OnSimpleLoaderComplete, + base::Unretained(this)), + 50000 /* max_body_size */); } void TemplateURLFetcher::RequestDelegate::OnLoaded() { @@ -125,27 +131,19 @@ void TemplateURLFetcher::RequestDelegate::OnLoaded() { // WARNING: AddSearchProvider deletes us. } -void TemplateURLFetcher::RequestDelegate::OnURLFetchComplete( - const net::URLFetcher* source) { +void TemplateURLFetcher::RequestDelegate::OnSimpleLoaderComplete( + std::unique_ptr<std::string> response_body) { // Validation checks. // Make sure we can still replace the keyword, i.e. the fetch was successful. - // If the OSDD file was loaded HTTP, we also have to check the response_code. - // For other schemes, e.g. when the OSDD file is bundled with an extension, - // the response_code is not applicable and should be -1. Also, ensure that - // the returned information results in a valid search URL. - std::string data; - if (!source->GetStatus().is_success() || - ((source->GetResponseCode() != -1) && - (source->GetResponseCode() != 200)) || - !source->GetResponseAsString(&data)) { + if (!response_body) { fetcher_->RequestCompleted(this); // WARNING: RequestCompleted deletes us. return; } template_url_ = TemplateURLParser::Parse( - fetcher_->template_url_service_->search_terms_data(), data.data(), - data.length(), nullptr); + fetcher_->template_url_service_->search_terms_data(), + response_body->data(), response_body->length(), nullptr); if (!template_url_ || !template_url_->url_ref().SupportsReplacement( fetcher_->template_url_service_->search_terms_data())) { @@ -198,12 +196,8 @@ void TemplateURLFetcher::RequestDelegate::AddSearchProvider() { // TemplateURLFetcher --------------------------------------------------------- -TemplateURLFetcher::TemplateURLFetcher( - TemplateURLService* template_url_service, - net::URLRequestContextGetter* request_context) - : template_url_service_(template_url_service), - request_context_(request_context) { -} +TemplateURLFetcher::TemplateURLFetcher(TemplateURLService* template_url_service) + : template_url_service_(template_url_service) {} TemplateURLFetcher::~TemplateURLFetcher() { } @@ -212,7 +206,10 @@ void TemplateURLFetcher::ScheduleDownload( const base::string16& keyword, const GURL& osdd_url, const GURL& favicon_url, - const URLFetcherCustomizeCallback& url_fetcher_customize_callback) { + const url::Origin& initiator, + network::mojom::URLLoaderFactory* url_loader_factory, + int render_frame_id, + int resource_type) { DCHECK(osdd_url.is_valid()); DCHECK(!keyword.empty()); @@ -236,7 +233,8 @@ void TemplateURLFetcher::ScheduleDownload( } requests_.push_back(std::make_unique<RequestDelegate>( - this, keyword, osdd_url, favicon_url, url_fetcher_customize_callback)); + this, keyword, osdd_url, favicon_url, initiator, url_loader_factory, + render_frame_id, resource_type)); } void TemplateURLFetcher::RequestCompleted(RequestDelegate* request) { diff --git a/chromium/components/search_engines/template_url_fetcher.h b/chromium/components/search_engines/template_url_fetcher.h index 896c755f027..9944c70d872 100644 --- a/chromium/components/search_engines/template_url_fetcher.h +++ b/chromium/components/search_engines/template_url_fetcher.h @@ -18,9 +18,14 @@ class GURL; class TemplateURL; class TemplateURLService; -namespace net { -class URLFetcher; -class URLRequestContextGetter; +namespace network { +namespace mojom { +class URLLoaderFactory; +} +} // namespace network + +namespace url { +class Origin; } // TemplateURLFetcher is responsible for downloading OpenSearch description @@ -29,12 +34,8 @@ class URLRequestContextGetter; // class TemplateURLFetcher : public KeyedService { public: - typedef base::Callback<void( - net::URLFetcher* url_fetcher)> URLFetcherCustomizeCallback; - // Creates a TemplateURLFetcher. - TemplateURLFetcher(TemplateURLService* template_url_service, - net::URLRequestContextGetter* request_context); + explicit TemplateURLFetcher(TemplateURLService* template_url_service); ~TemplateURLFetcher() override; // If TemplateURLFetcher is not already downloading the OSDD for osdd_url, @@ -45,14 +46,13 @@ class TemplateURLFetcher : public KeyedService { // TemplateURL in the model for |keyword|, or we're already downloading an // OSDD for this keyword, no download is started. // - // If |url_fetcher_customize_callback| is not null, it's run after a - // URLFetcher is created. This callback can be used to set additional - // parameters on the URLFetcher. - void ScheduleDownload( - const base::string16& keyword, - const GURL& osdd_url, - const GURL& favicon_url, - const URLFetcherCustomizeCallback& url_fetcher_customize_callback); + void ScheduleDownload(const base::string16& keyword, + const GURL& osdd_url, + const GURL& favicon_url, + const url::Origin& initiator, + network::mojom::URLLoaderFactory* url_loader_factory, + int render_frame_id, + int resource_type); // The current number of outstanding requests. int requests_count() const { return requests_.size(); } @@ -69,7 +69,6 @@ class TemplateURLFetcher : public KeyedService { friend class RequestDelegate; TemplateURLService* template_url_service_; - scoped_refptr<net::URLRequestContextGetter> request_context_; // In progress requests. std::vector<std::unique_ptr<RequestDelegate>> requests_; diff --git a/chromium/components/search_engines/template_url_service.cc b/chromium/components/search_engines/template_url_service.cc index 6ad8d799d05..646d44aa3da 100644 --- a/chromium/components/search_engines/template_url_service.cc +++ b/chromium/components/search_engines/template_url_service.cc @@ -2232,11 +2232,22 @@ void TemplateURLService::MergeInSyncTemplateURL( false)) { std::string guid = conflicting_prepopulated_turl->sync_guid(); if (conflicting_prepopulated_turl == default_search_provider_) { - // ApplyDefaultSearchChange() may change something that requires a - // notification, but if so, it will send out that notification, and we - // are not involved, thus we do not update |should_notify| here. - ApplyDefaultSearchChange(&sync_turl->data(), - DefaultSearchManager::FROM_USER); + bool pref_matched = + prefs_->GetString(prefs::kSyncedDefaultSearchProviderGUID) == + default_search_provider_->sync_guid(); + // Update the existing engine in-place. + Update(default_search_provider_, TemplateURL(sync_turl->data())); + // If prefs::kSyncedDefaultSearchProviderGUID matched + // |default_search_provider_|'s GUID before, then update it to match its + // new GUID. If the pref didn't match before, then it probably refers to + // a new search engine from Sync which just hasn't been added locally + // yet, so leave it alone in that case. + if (pref_matched) { + prefs_->SetString(prefs::kSyncedDefaultSearchProviderGUID, + default_search_provider_->sync_guid()); + } + + should_add_sync_turl = false; merge_result->set_num_items_modified( merge_result->num_items_modified() + 1); } else { |