Merge branch 'master' into history-on-incognito

This commit is contained in:
Carl 2020-08-15 23:23:36 +02:00 committed by GitHub
commit 15e75eeb88
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 854 additions and 1033 deletions

View file

@ -1,3 +1,9 @@
# 84.0.4147.121
* removed Qwant search engine
* fixed zh_CN translations
* added patch to not embed non-free unrar library (fixes https://github.com/bromite/bromite/issues/674)
* enable improved cookie controls by default
# 84.0.4147.119
* update zh_CN translations
* disable CORS RFC1918 (fixes https://github.com/bromite/bromite/issues/664)

View file

@ -31,7 +31,7 @@ ETH donations address: `0xf47ff39223d828f99fec5ab53bd068c5c0522042`
# Features
* customizable adblock filters via user-provided URL
* customizable adblock filters via user-provided URL (see https://www.bromite.org/custom-filters)
* remove click-tracking and AMP from search results
* DNS-over-HTTPS support with any valid IETF DoH endpoint
* always-incognito mode

View file

@ -1 +1 @@
84.0.4147.119
84.0.4147.121

View file

@ -39,7 +39,6 @@ Disable-Omaha-update-checks.patch
Disable-update-scheduler.patch
Add-English-only-search-engine.patch
Add-DuckDuckGo-Lite-search-engine.patch
Add-Qwant-search-engine.patch
Fix-crash-when-accessing-page-info-site-settings.patch
openH264-enable-ARM-ARM64-optimizations.patch
Switch-to-fstack-protector-strong.patch
@ -146,5 +145,8 @@ Block-gateway-attacks-via-websockets.patch
Enable-prefetch-privacy-changes-by-default.patch
Enable-reduced-referrer-granularity-by-default.patch
Restore-duet-flags.patch
Disable-support-for-RAR-files-inspection.patch
Enable-improved-cookie-controls-by-default.patch
Session-only-cookies-support.patch
Add-history-support-in-incognito-mode.patch
Automated-domain-substitution.patch

View file

@ -1,999 +0,0 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Mon, 12 Mar 2018 20:31:44 +0100
Subject: Add Qwant search engine
Specify image URL in upstream engine definition
Make search engine selectable in default list
---
.../search_engines/prepopulated_engines.json | 1 +
.../template_url_prepopulate_data.cc | 216 +++++++++---------
2 files changed, 109 insertions(+), 108 deletions(-)
diff --git a/components/search_engines/prepopulated_engines.json b/components/search_engines/prepopulated_engines.json
--- a/components/search_engines/prepopulated_engines.json
+++ b/components/search_engines/prepopulated_engines.json
@@ -193,6 +193,7 @@
"favicon_url": "https://www.qwant.com/favicon.ico",
"search_url": "https://www.qwant.com/?q={searchTerms}&client=opensearch",
"suggest_url": "https://api.qwant.com/api/suggest/?q={searchTerms}&client=opensearch",
+ "image_url": "https://www.qwant.com/?t=images&q={searchTerms}",
"type": "SEARCH_ENGINE_QWANT",
"id": 94
},
diff --git a/components/search_engines/template_url_prepopulate_data.cc b/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
@@ -32,7 +32,7 @@ namespace {
// Default (for countries with no better engine set)
const PrepopulatedEngine* const engines_default[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&bing,
&yahoo,
&duckduckgo, &duckduckgo_light,
@@ -42,7 +42,7 @@ const PrepopulatedEngine* const engines_default[] = {
// Engine selection by country ------------------------------------------------
// United Arab Emirates
const PrepopulatedEngine* const engines_AE[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&bing,
&yahoo,
&duckduckgo, &duckduckgo_light,
@@ -51,7 +51,7 @@ const PrepopulatedEngine* const engines_AE[] = {
// Albania
const PrepopulatedEngine* const engines_AL[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&yahoo,
&bing,
&duckduckgo, &duckduckgo_light,
@@ -60,7 +60,7 @@ const PrepopulatedEngine* const engines_AL[] = {
// Argentina
const PrepopulatedEngine* const engines_AR[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&bing,
&yahoo_ar,
&duckduckgo, &duckduckgo_light,
@@ -69,7 +69,7 @@ const PrepopulatedEngine* const engines_AR[] = {
// Austria
const PrepopulatedEngine* const engines_AT[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&bing,
&duckduckgo, &duckduckgo_light,
&yahoo_at,
@@ -78,7 +78,7 @@ const PrepopulatedEngine* const engines_AT[] = {
// Australia
const PrepopulatedEngine* const engines_AU[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&bing,
&duckduckgo, &duckduckgo_light,
&yahoo_au,
@@ -87,7 +87,7 @@ const PrepopulatedEngine* const engines_AU[] = {
// Bosnia and Herzegovina
const PrepopulatedEngine* const engines_BA[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&bing,
&yahoo,
&duckduckgo, &duckduckgo_light,
@@ -96,7 +96,7 @@ const PrepopulatedEngine* const engines_BA[] = {
// Belgium
const PrepopulatedEngine* const engines_BE[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&bing,
&yahoo,
&ecosia,
@@ -105,7 +105,7 @@ const PrepopulatedEngine* const engines_BE[] = {
// Bulgaria
const PrepopulatedEngine* const engines_BG[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&bing,
&yahoo,
&duckduckgo, &duckduckgo_light,
@@ -114,7 +114,7 @@ const PrepopulatedEngine* const engines_BG[] = {
// Bahrain
const PrepopulatedEngine* const engines_BH[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&bing,
&yahoo,
&duckduckgo, &duckduckgo_light,
@@ -123,7 +123,7 @@ const PrepopulatedEngine* const engines_BH[] = {
// Burundi
const PrepopulatedEngine* const engines_BI[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&bing,
&yahoo,
&duckduckgo, &duckduckgo_light,
@@ -132,7 +132,7 @@ const PrepopulatedEngine* const engines_BI[] = {
// Brunei
const PrepopulatedEngine* const engines_BN[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&bing,
&yahoo,
&duckduckgo, &duckduckgo_light,
@@ -141,7 +141,7 @@ const PrepopulatedEngine* const engines_BN[] = {
// Bolivia
const PrepopulatedEngine* const engines_BO[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&bing,
&yahoo,
&duckduckgo, &duckduckgo_light,
@@ -150,7 +150,7 @@ const PrepopulatedEngine* const engines_BO[] = {
// Brazil
const PrepopulatedEngine* const engines_BR[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&bing,
&yahoo_br,
&duckduckgo, &duckduckgo_light,
@@ -159,7 +159,7 @@ const PrepopulatedEngine* const engines_BR[] = {
// Belarus
const PrepopulatedEngine* const engines_BY[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&yandex_by,
&mail_ru,
&bing,
@@ -168,7 +168,7 @@ const PrepopulatedEngine* const engines_BY[] = {
// Belize
const PrepopulatedEngine* const engines_BZ[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&bing,
&yahoo,
&duckduckgo, &duckduckgo_light,
@@ -177,7 +177,7 @@ const PrepopulatedEngine* const engines_BZ[] = {
// Canada
const PrepopulatedEngine* const engines_CA[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&bing,
&yahoo_ca,
&duckduckgo, &duckduckgo_light,
@@ -186,7 +186,7 @@ const PrepopulatedEngine* const engines_CA[] = {
// Switzerland
const PrepopulatedEngine* const engines_CH[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&bing,
&duckduckgo, &duckduckgo_light,
&yahoo_ch,
@@ -195,7 +195,7 @@ const PrepopulatedEngine* const engines_CH[] = {
// Chile
const PrepopulatedEngine* const engines_CL[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&bing,
&yahoo_cl,
&duckduckgo, &duckduckgo_light,
@@ -206,14 +206,14 @@ const PrepopulatedEngine* const engines_CL[] = {
const PrepopulatedEngine* const engines_CN[] = {
&baidu,
&sogou,
- &googleen, &google,
+ &googleen, &google, &qwant,
&so_360,
&bing,
};
// Colombia
const PrepopulatedEngine* const engines_CO[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&bing,
&yahoo_co,
&ecosia,
@@ -222,7 +222,7 @@ const PrepopulatedEngine* const engines_CO[] = {
// Costa Rica
const PrepopulatedEngine* const engines_CR[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&bing,
&yahoo,
&duckduckgo, &duckduckgo_light,
@@ -231,7 +231,7 @@ const PrepopulatedEngine* const engines_CR[] = {
// Czech Republic
const PrepopulatedEngine* const engines_CZ[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&seznam_cz,
&bing,
&yahoo,
@@ -240,7 +240,7 @@ const PrepopulatedEngine* const engines_CZ[] = {
// Germany
const PrepopulatedEngine* const engines_DE[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&bing,
&yahoo_de,
&duckduckgo, &duckduckgo_light,
@@ -249,7 +249,7 @@ const PrepopulatedEngine* const engines_DE[] = {
// Denmark
const PrepopulatedEngine* const engines_DK[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&bing,
&yahoo_dk,
&duckduckgo, &duckduckgo_light,
@@ -258,7 +258,7 @@ const PrepopulatedEngine* const engines_DK[] = {
// Dominican Republic
const PrepopulatedEngine* const engines_DO[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&bing,
&yahoo,
&duckduckgo, &duckduckgo_light,
@@ -267,7 +267,7 @@ const PrepopulatedEngine* const engines_DO[] = {
// Algeria
const PrepopulatedEngine* const engines_DZ[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&yahoo,
&bing,
&yandex_ru,
@@ -276,7 +276,7 @@ const PrepopulatedEngine* const engines_DZ[] = {
// Ecuador
const PrepopulatedEngine* const engines_EC[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&bing,
&yahoo,
&ecosia,
@@ -285,7 +285,7 @@ const PrepopulatedEngine* const engines_EC[] = {
// Estonia
const PrepopulatedEngine* const engines_EE[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&bing,
&yandex_ru,
&yahoo,
@@ -294,7 +294,7 @@ const PrepopulatedEngine* const engines_EE[] = {
// Egypt
const PrepopulatedEngine* const engines_EG[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&yahoo,
&bing,
&yandex_ru,
@@ -303,7 +303,7 @@ const PrepopulatedEngine* const engines_EG[] = {
// Spain
const PrepopulatedEngine* const engines_ES[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&bing,
&yahoo_es,
&duckduckgo, &duckduckgo_light,
@@ -312,7 +312,7 @@ const PrepopulatedEngine* const engines_ES[] = {
// Finland
const PrepopulatedEngine* const engines_FI[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&bing,
&yahoo_fi,
&duckduckgo, &duckduckgo_light,
@@ -321,7 +321,7 @@ const PrepopulatedEngine* const engines_FI[] = {
// Faroe Islands
const PrepopulatedEngine* const engines_FO[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&bing,
&yahoo_dk,
&duckduckgo, &duckduckgo_light,
@@ -330,7 +330,7 @@ const PrepopulatedEngine* const engines_FO[] = {
// France
const PrepopulatedEngine* const engines_FR[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&bing,
&yahoo_fr,
&qwant,
@@ -339,7 +339,7 @@ const PrepopulatedEngine* const engines_FR[] = {
// United Kingdom
const PrepopulatedEngine* const engines_GB[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&bing,
&yahoo_uk,
&duckduckgo, &duckduckgo_light,
@@ -348,7 +348,7 @@ const PrepopulatedEngine* const engines_GB[] = {
// Greece
const PrepopulatedEngine* const engines_GR[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&bing,
&yahoo,
&duckduckgo, &duckduckgo_light,
@@ -357,7 +357,7 @@ const PrepopulatedEngine* const engines_GR[] = {
// Guatemala
const PrepopulatedEngine* const engines_GT[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&bing,
&yahoo,
&ecosia,
@@ -366,7 +366,7 @@ const PrepopulatedEngine* const engines_GT[] = {
// Hong Kong
const PrepopulatedEngine* const engines_HK[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&yahoo_hk,
&bing,
&yandex_com,
@@ -375,7 +375,7 @@ const PrepopulatedEngine* const engines_HK[] = {
// Honduras
const PrepopulatedEngine* const engines_HN[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&bing,
&yahoo,
&yandex_ru,
@@ -384,7 +384,7 @@ const PrepopulatedEngine* const engines_HN[] = {
// Croatia
const PrepopulatedEngine* const engines_HR[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&bing,
&yahoo,
&duckduckgo, &duckduckgo_light,
@@ -393,7 +393,7 @@ const PrepopulatedEngine* const engines_HR[] = {
// Hungary
const PrepopulatedEngine* const engines_HU[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&bing,
&yahoo,
&duckduckgo, &duckduckgo_light,
@@ -402,7 +402,7 @@ const PrepopulatedEngine* const engines_HU[] = {
// Indonesia
const PrepopulatedEngine* const engines_ID[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&yahoo_id,
&bing,
&duckduckgo, &duckduckgo_light,
@@ -411,7 +411,7 @@ const PrepopulatedEngine* const engines_ID[] = {
// Ireland
const PrepopulatedEngine* const engines_IE[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&bing,
&yahoo,
&duckduckgo, &duckduckgo_light,
@@ -420,7 +420,7 @@ const PrepopulatedEngine* const engines_IE[] = {
// Israel
const PrepopulatedEngine* const engines_IL[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&bing,
&yahoo,
&yandex_ru,
@@ -429,7 +429,7 @@ const PrepopulatedEngine* const engines_IL[] = {
// India
const PrepopulatedEngine* const engines_IN[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&yahoo_in,
&bing,
&duckduckgo, &duckduckgo_light,
@@ -438,7 +438,7 @@ const PrepopulatedEngine* const engines_IN[] = {
// Iraq
const PrepopulatedEngine* const engines_IQ[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&yahoo,
&bing,
&yandex_ru,
@@ -447,7 +447,7 @@ const PrepopulatedEngine* const engines_IQ[] = {
// Iran
const PrepopulatedEngine* const engines_IR[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&bing,
&yahoo,
&yandex_ru,
@@ -456,7 +456,7 @@ const PrepopulatedEngine* const engines_IR[] = {
// Iceland
const PrepopulatedEngine* const engines_IS[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&bing,
&duckduckgo, &duckduckgo_light,
&yahoo,
@@ -465,7 +465,7 @@ const PrepopulatedEngine* const engines_IS[] = {
// Italy
const PrepopulatedEngine* const engines_IT[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&bing,
&yahoo,
&duckduckgo, &duckduckgo_light,
@@ -474,7 +474,7 @@ const PrepopulatedEngine* const engines_IT[] = {
// Jamaica
const PrepopulatedEngine* const engines_JM[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&bing,
&yahoo,
&duckduckgo, &duckduckgo_light,
@@ -483,7 +483,7 @@ const PrepopulatedEngine* const engines_JM[] = {
// Jordan
const PrepopulatedEngine* const engines_JO[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&bing,
&yahoo,
&duckduckgo, &duckduckgo_light,
@@ -492,7 +492,7 @@ const PrepopulatedEngine* const engines_JO[] = {
// Japan
const PrepopulatedEngine* const engines_JP[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&yahoo_jp,
&bing,
&baidu,
@@ -501,7 +501,7 @@ const PrepopulatedEngine* const engines_JP[] = {
// Kenya
const PrepopulatedEngine* const engines_KE[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&bing,
&yahoo,
&duckduckgo, &duckduckgo_light,
@@ -510,7 +510,7 @@ const PrepopulatedEngine* const engines_KE[] = {
// South Korea
const PrepopulatedEngine* const engines_KR[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&naver,
&bing,
&daum,
@@ -519,7 +519,7 @@ const PrepopulatedEngine* const engines_KR[] = {
// Kuwait
const PrepopulatedEngine* const engines_KW[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&bing,
&yahoo,
&duckduckgo, &duckduckgo_light,
@@ -528,7 +528,7 @@ const PrepopulatedEngine* const engines_KW[] = {
// Kazakhstan
const PrepopulatedEngine* const engines_KZ[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&yandex_kz,
&mail_ru,
&bing,
@@ -537,7 +537,7 @@ const PrepopulatedEngine* const engines_KZ[] = {
// Lebanon
const PrepopulatedEngine* const engines_LB[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&bing,
&yahoo,
&duckduckgo, &duckduckgo_light,
@@ -546,7 +546,7 @@ const PrepopulatedEngine* const engines_LB[] = {
// Liechtenstein
const PrepopulatedEngine* const engines_LI[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&bing,
&duckduckgo, &duckduckgo_light,
&yahoo,
@@ -555,7 +555,7 @@ const PrepopulatedEngine* const engines_LI[] = {
// Lithuania
const PrepopulatedEngine* const engines_LT[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&bing,
&yahoo,
&yandex_ru,
@@ -564,7 +564,7 @@ const PrepopulatedEngine* const engines_LT[] = {
// Luxembourg
const PrepopulatedEngine* const engines_LU[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&bing,
&duckduckgo, &duckduckgo_light,
&yahoo,
@@ -573,7 +573,7 @@ const PrepopulatedEngine* const engines_LU[] = {
// Latvia
const PrepopulatedEngine* const engines_LV[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&yandex_ru,
&bing,
&yahoo,
@@ -582,7 +582,7 @@ const PrepopulatedEngine* const engines_LV[] = {
// Libya
const PrepopulatedEngine* const engines_LY[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&yahoo,
&bing,
&yandex_com,
@@ -591,7 +591,7 @@ const PrepopulatedEngine* const engines_LY[] = {
// Morocco
const PrepopulatedEngine* const engines_MA[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&yahoo,
&bing,
&duckduckgo, &duckduckgo_light,
@@ -600,7 +600,7 @@ const PrepopulatedEngine* const engines_MA[] = {
// Monaco
const PrepopulatedEngine* const engines_MC[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&bing,
&duckduckgo, &duckduckgo_light,
&yahoo,
@@ -609,7 +609,7 @@ const PrepopulatedEngine* const engines_MC[] = {
// Moldova
const PrepopulatedEngine* const engines_MD[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&yandex_ru,
&mail_ru,
&duckduckgo, &duckduckgo_light,
@@ -618,7 +618,7 @@ const PrepopulatedEngine* const engines_MD[] = {
// Montenegro
const PrepopulatedEngine* const engines_ME[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&bing,
&yahoo,
&yandex_ru,
@@ -627,7 +627,7 @@ const PrepopulatedEngine* const engines_ME[] = {
// Macedonia
const PrepopulatedEngine* const engines_MK[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&bing,
&yahoo,
&duckduckgo, &duckduckgo_light,
@@ -636,7 +636,7 @@ const PrepopulatedEngine* const engines_MK[] = {
// Mexico
const PrepopulatedEngine* const engines_MX[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&bing,
&yahoo_mx,
&ecosia,
@@ -645,7 +645,7 @@ const PrepopulatedEngine* const engines_MX[] = {
// Malaysia
const PrepopulatedEngine* const engines_MY[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&bing,
&yahoo_my,
&duckduckgo, &duckduckgo_light,
@@ -654,7 +654,7 @@ const PrepopulatedEngine* const engines_MY[] = {
// Nicaragua
const PrepopulatedEngine* const engines_NI[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&bing,
&yahoo,
&duckduckgo, &duckduckgo_light,
@@ -664,7 +664,7 @@ const PrepopulatedEngine* const engines_NI[] = {
// Netherlands
const PrepopulatedEngine* const engines_NL[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&bing,
&yahoo_nl,
&duckduckgo, &duckduckgo_light,
@@ -673,7 +673,7 @@ const PrepopulatedEngine* const engines_NL[] = {
// Norway
const PrepopulatedEngine* const engines_NO[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&bing,
&yahoo,
&duckduckgo, &duckduckgo_light,
@@ -682,7 +682,7 @@ const PrepopulatedEngine* const engines_NO[] = {
// New Zealand
const PrepopulatedEngine* const engines_NZ[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&bing,
&duckduckgo, &duckduckgo_light,
&yahoo_nz,
@@ -691,7 +691,7 @@ const PrepopulatedEngine* const engines_NZ[] = {
// Oman
const PrepopulatedEngine* const engines_OM[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&bing,
&yahoo,
&duckduckgo, &duckduckgo_light,
@@ -700,7 +700,7 @@ const PrepopulatedEngine* const engines_OM[] = {
// Panama
const PrepopulatedEngine* const engines_PA[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&bing,
&yahoo,
&duckduckgo, &duckduckgo_light,
@@ -709,7 +709,7 @@ const PrepopulatedEngine* const engines_PA[] = {
// Peru
const PrepopulatedEngine* const engines_PE[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&bing,
&yahoo_pe,
&ecosia,
@@ -718,7 +718,7 @@ const PrepopulatedEngine* const engines_PE[] = {
// Philippines
const PrepopulatedEngine* const engines_PH[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&yahoo_ph,
&bing,
&ecosia,
@@ -727,7 +727,7 @@ const PrepopulatedEngine* const engines_PH[] = {
// Pakistan
const PrepopulatedEngine* const engines_PK[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&yahoo,
&bing,
&duckduckgo, &duckduckgo_light,
@@ -736,7 +736,7 @@ const PrepopulatedEngine* const engines_PK[] = {
// Poland
const PrepopulatedEngine* const engines_PL[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&bing,
&yahoo,
&duckduckgo, &duckduckgo_light,
@@ -745,7 +745,7 @@ const PrepopulatedEngine* const engines_PL[] = {
// Puerto Rico
const PrepopulatedEngine* const engines_PR[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&bing,
&yahoo,
&duckduckgo, &duckduckgo_light,
@@ -754,7 +754,7 @@ const PrepopulatedEngine* const engines_PR[] = {
// Portugal
const PrepopulatedEngine* const engines_PT[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&bing,
&yahoo,
&duckduckgo, &duckduckgo_light,
@@ -763,7 +763,7 @@ const PrepopulatedEngine* const engines_PT[] = {
// Paraguay
const PrepopulatedEngine* const engines_PY[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&bing,
&yahoo,
&duckduckgo, &duckduckgo_light,
@@ -772,7 +772,7 @@ const PrepopulatedEngine* const engines_PY[] = {
// Qatar
const PrepopulatedEngine* const engines_QA[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&bing,
&yahoo,
&duckduckgo, &duckduckgo_light,
@@ -781,7 +781,7 @@ const PrepopulatedEngine* const engines_QA[] = {
// Romania
const PrepopulatedEngine* const engines_RO[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&bing,
&yahoo,
&duckduckgo, &duckduckgo_light,
@@ -790,7 +790,7 @@ const PrepopulatedEngine* const engines_RO[] = {
// Serbia
const PrepopulatedEngine* const engines_RS[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&yahoo,
&bing,
&duckduckgo, &duckduckgo_light,
@@ -799,7 +799,7 @@ const PrepopulatedEngine* const engines_RS[] = {
// Russia
const PrepopulatedEngine* const engines_RU[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&yandex_ru,
&mail_ru,
&bing,
@@ -808,7 +808,7 @@ const PrepopulatedEngine* const engines_RU[] = {
// Rwanda
const PrepopulatedEngine* const engines_RW[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&bing,
&yahoo,
&duckduckgo, &duckduckgo_light,
@@ -817,7 +817,7 @@ const PrepopulatedEngine* const engines_RW[] = {
// Saudi Arabia
const PrepopulatedEngine* const engines_SA[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&bing,
&yahoo,
&yandex_com,
@@ -826,7 +826,7 @@ const PrepopulatedEngine* const engines_SA[] = {
// Sweden
const PrepopulatedEngine* const engines_SE[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&bing,
&yahoo_se,
&duckduckgo, &duckduckgo_light,
@@ -835,7 +835,7 @@ const PrepopulatedEngine* const engines_SE[] = {
// Singapore
const PrepopulatedEngine* const engines_SG[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&bing,
&yandex_com,
&yahoo_sg,
@@ -844,7 +844,7 @@ const PrepopulatedEngine* const engines_SG[] = {
// Slovenia
const PrepopulatedEngine* const engines_SI[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&bing,
&duckduckgo, &duckduckgo_light,
&yahoo,
@@ -853,7 +853,7 @@ const PrepopulatedEngine* const engines_SI[] = {
// Slovakia
const PrepopulatedEngine* const engines_SK[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&bing,
&yahoo,
&duckduckgo, &duckduckgo_light,
@@ -862,7 +862,7 @@ const PrepopulatedEngine* const engines_SK[] = {
// El Salvador
const PrepopulatedEngine* const engines_SV[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&bing,
&yahoo,
&duckduckgo, &duckduckgo_light,
@@ -871,7 +871,7 @@ const PrepopulatedEngine* const engines_SV[] = {
// Syria
const PrepopulatedEngine* const engines_SY[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&bing,
&yahoo,
&yandex_ru,
@@ -880,7 +880,7 @@ const PrepopulatedEngine* const engines_SY[] = {
// Thailand
const PrepopulatedEngine* const engines_TH[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&yahoo_th,
&bing,
&duckduckgo, &duckduckgo_light,
@@ -889,7 +889,7 @@ const PrepopulatedEngine* const engines_TH[] = {
// Tunisia
const PrepopulatedEngine* const engines_TN[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&yahoo,
&bing,
&yandex_ru,
@@ -898,7 +898,7 @@ const PrepopulatedEngine* const engines_TN[] = {
// Turkey
const PrepopulatedEngine* const engines_TR[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&yandex_tr,
&yahoo_tr,
&bing,
@@ -907,7 +907,7 @@ const PrepopulatedEngine* const engines_TR[] = {
// Trinidad and Tobago
const PrepopulatedEngine* const engines_TT[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&bing,
&yahoo,
&duckduckgo, &duckduckgo_light,
@@ -916,7 +916,7 @@ const PrepopulatedEngine* const engines_TT[] = {
// Taiwan
const PrepopulatedEngine* const engines_TW[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&yahoo_tw,
&bing,
&baidu,
@@ -925,7 +925,7 @@ const PrepopulatedEngine* const engines_TW[] = {
// Tanzania
const PrepopulatedEngine* const engines_TZ[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&bing,
&yahoo,
&duckduckgo, &duckduckgo_light,
@@ -934,7 +934,7 @@ const PrepopulatedEngine* const engines_TZ[] = {
// Ukraine
const PrepopulatedEngine* const engines_UA[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&yandex_ua,
&bing,
&mail_ru,
@@ -943,7 +943,7 @@ const PrepopulatedEngine* const engines_UA[] = {
// United States
const PrepopulatedEngine* const engines_US[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&bing,
&yahoo,
&duckduckgo, &duckduckgo_light,
@@ -952,7 +952,7 @@ const PrepopulatedEngine* const engines_US[] = {
// Uruguay
const PrepopulatedEngine* const engines_UY[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&bing,
&yahoo,
&duckduckgo, &duckduckgo_light,
@@ -961,7 +961,7 @@ const PrepopulatedEngine* const engines_UY[] = {
// Venezuela
const PrepopulatedEngine* const engines_VE[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&yahoo_ve,
&bing,
&duckduckgo, &duckduckgo_light,
@@ -970,7 +970,7 @@ const PrepopulatedEngine* const engines_VE[] = {
// Vietnam
const PrepopulatedEngine* const engines_VN[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&coccoc,
&yahoo,
&bing,
@@ -979,7 +979,7 @@ const PrepopulatedEngine* const engines_VN[] = {
// Yemen
const PrepopulatedEngine* const engines_YE[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&bing,
&yahoo,
&yandex_ru,
@@ -988,7 +988,7 @@ const PrepopulatedEngine* const engines_YE[] = {
// South Africa
const PrepopulatedEngine* const engines_ZA[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&bing,
&yahoo,
&duckduckgo, &duckduckgo_light,
@@ -997,7 +997,7 @@ const PrepopulatedEngine* const engines_ZA[] = {
// Zimbabwe
const PrepopulatedEngine* const engines_ZW[] = {
- &googleen, &google,
+ &googleen, &google, &qwant,
&bing,
&yahoo,
&ask,
--
2.17.1

View file

@ -13,8 +13,7 @@ Subject: Block gateway attacks via websockets
.../websockets/websocket_channel_impl.cc | 5 +++
.../modules/websockets/websocket_common.cc | 27 +++++++++++++++
.../modules/websockets/websocket_common.h | 4 +++
.../platform/runtime_enabled_features.json5 | 2 +-
11 files changed, 94 insertions(+), 20 deletions(-)
10 files changed, 93 insertions(+), 19 deletions(-)
diff --git a/services/network/public/cpp/features.cc b/services/network/public/cpp/features.cc
--- a/services/network/public/cpp/features.cc
@ -249,18 +248,6 @@ diff --git a/third_party/blink/renderer/modules/websockets/websocket_common.h b/
// The following methods are public for testing.
// Returns true if |protocol| is a valid WebSocket subprotocol name.
diff --git a/third_party/blink/renderer/platform/runtime_enabled_features.json5 b/third_party/blink/renderer/platform/runtime_enabled_features.json5
--- a/third_party/blink/renderer/platform/runtime_enabled_features.json5
+++ b/third_party/blink/renderer/platform/runtime_enabled_features.json5
@@ -385,7 +385,7 @@
name: "CooperativeScheduling"
},
{
- name: "CorsRFC1918",
+ name: "CorsRFC1918"
},
{
name: "CSS3Text",
--
2.17.1

View file

@ -0,0 +1,96 @@
From: Michael Gilbert <mgilbert@debian.org>
Date: Wed, 21 Nov 2018 02:37:35 +0000
Subject: Disable support for RAR files inspection
---
.../download_protection/file_analyzer.cc | 2 +-
chrome/common/safe_browsing/BUILD.gn | 33 -------------------
.../file_util/safe_archive_analyzer.cc | 4 +--
3 files changed, 2 insertions(+), 37 deletions(-)
diff --git a/chrome/browser/safe_browsing/download_protection/file_analyzer.cc b/chrome/browser/safe_browsing/download_protection/file_analyzer.cc
--- a/chrome/browser/safe_browsing/download_protection/file_analyzer.cc
+++ b/chrome/browser/safe_browsing/download_protection/file_analyzer.cc
@@ -87,7 +87,7 @@ void FileAnalyzer::Start(const base::FilePath& target_path,
if (inspection_type == DownloadFileType::ZIP) {
StartExtractZipFeatures();
} else if (inspection_type == DownloadFileType::RAR) {
- StartExtractRarFeatures();
+ LOG(WARNING) << "Safebrowser inspection of rar files is disabled in this build";
#if defined(OS_MACOSX)
} else if (inspection_type == DownloadFileType::DMG) {
StartExtractDmgFeatures();
diff --git a/chrome/common/safe_browsing/BUILD.gn b/chrome/common/safe_browsing/BUILD.gn
--- a/chrome/common/safe_browsing/BUILD.gn
+++ b/chrome/common/safe_browsing/BUILD.gn
@@ -52,38 +52,6 @@ if (safe_browsing_mode == 1) {
public_deps = [ "//components/safe_browsing/core:csd_proto" ]
}
- source_set("rar_analyzer") {
- sources = [
- "rar_analyzer.cc",
- "rar_analyzer.h",
- ]
-
- deps = [
- ":archive_analyzer_results",
- ":download_type_util",
- "//base",
- "//base:i18n",
- "//components/safe_browsing/core:features",
- "//third_party/unrar:unrar",
- ]
-
- defines = [
- "_FILE_OFFSET_BITS=64",
- "LARGEFILE_SOURCE",
- "RAR_SMP",
- "SILENT",
-
- # The following is set to disable certain macro definitions in the unrar
- # source code.
- "CHROMIUM_UNRAR",
-
- # Disables exceptions in unrar, replaces them with process termination.
- "UNRAR_NO_EXCEPTIONS",
- ]
-
- public_deps = [ "//components/safe_browsing/core:csd_proto" ]
- }
-
source_set("disk_image_type_sniffer_mac") {
sources = [
"disk_image_type_sniffer_mac.cc",
@@ -150,7 +118,6 @@ source_set("safe_browsing") {
":archive_analyzer_results",
":binary_feature_extractor",
":download_type_util",
- ":rar_analyzer",
"//components/safe_browsing/core:features",
]
diff --git a/chrome/services/file_util/safe_archive_analyzer.cc b/chrome/services/file_util/safe_archive_analyzer.cc
--- a/chrome/services/file_util/safe_archive_analyzer.cc
+++ b/chrome/services/file_util/safe_archive_analyzer.cc
@@ -7,7 +7,6 @@
#include "base/macros.h"
#include "build/build_config.h"
#include "chrome/common/safe_browsing/archive_analyzer_results.h"
-#include "chrome/common/safe_browsing/rar_analyzer.h"
#include "chrome/common/safe_browsing/zip_analyzer.h"
#include "mojo/public/cpp/bindings/strong_binding.h"
@@ -48,8 +47,7 @@ void SafeArchiveAnalyzer::AnalyzeRarFile(base::File rar_file,
AnalyzeRarFileCallback callback) {
DCHECK(rar_file.IsValid());
+ LOG(FATAL) << "AnalyzeRarFile is disabled in this build";
safe_browsing::ArchiveAnalyzerResults results;
- safe_browsing::rar_analyzer::AnalyzeRarFile(
- std::move(rar_file), std::move(temporary_file), &results);
std::move(callback).Run(results);
}
--
2.17.1

View file

@ -0,0 +1,32 @@
From: csagan5 <32685696+csagan5@users.noreply.github.com>
Date: Fri, 7 Aug 2020 13:41:21 +0200
Subject: Enable improved cookie controls by default
---
components/content_settings/core/common/features.cc | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/components/content_settings/core/common/features.cc b/components/content_settings/core/common/features.cc
--- a/components/content_settings/core/common/features.cc
+++ b/components/content_settings/core/common/features.cc
@@ -11,7 +11,7 @@ namespace content_settings {
// Enables an improved UI for third-party cookie blocking in incognito mode.
const base::Feature kImprovedCookieControls{"ImprovedCookieControls",
- base::FEATURE_DISABLED_BY_DEFAULT};
+ base::FEATURE_ENABLED_BY_DEFAULT};
// Default setting for improved cookie controls.
const base::FeatureParam<bool> kImprovedCookieControlsDefaultInIncognito{
@@ -20,5 +20,5 @@ const base::FeatureParam<bool> kImprovedCookieControlsDefaultInIncognito{
// Enables an improved UI for existing third-party cookie blocking users.
const base::Feature kImprovedCookieControlsForThirdPartyCookieBlocking{
"ImprovedCookieControlsForThirdPartyCookieBlocking",
- base::FEATURE_DISABLED_BY_DEFAULT};
-}
\ No newline at end of file
+ base::FEATURE_ENABLED_BY_DEFAULT};
+}
--
2.17.1

View file

@ -0,0 +1,708 @@
From: uazo <uazo@users.noreply.github.com>
Date: Thu, 6 Aug 2020 14:02:57 +0000
Subject: Session-only cookies support
---
base/android/application_status_listener.cc | 1 +
base/android/application_status_listener.h | 3 +-
.../org/chromium/base/ApplicationStatus.java | 4 ++
.../chrome/browser/ApplicationLifetime.java | 3 ++
.../availability/availability_prober.cc | 1 +
.../four_state_cookie_settings_preference.xml | 7 ++++
.../ContentSettingsResources.java | 9 +++++
.../FourStateCookieSettingsPreference.java | 17 +++++++-
.../site_settings/SingleCategorySettings.java | 30 ++++++++++++++
.../site_settings/SingleWebsiteSettings.java | 40 ++++++++++++++-----
.../site_settings/SiteSettings.java | 9 +++++
.../strings/android/site_settings.grdp | 8 +++-
.../translations/browser_ui_strings_it.xtb | 2 +
.../core/browser/content_settings_registry.cc | 0
.../scheduler/responsiveness/calculator.cc | 1 +
.../base/application_state_mojom_traits.cc | 7 +++-
.../public/mojom/base/application_state.mojom | 1 +
services/network/cookie_manager.cc | 14 +++++++
services/network/cookie_manager.h | 3 ++
services/network/network_context.cc | 17 ++++++++
.../network/public/mojom/cookie_manager.mojom | 3 ++
.../network/session_cleanup_cookie_store.cc | 39 ++++++++++++++++++
.../network/session_cleanup_cookie_store.h | 9 +++++
23 files changed, 212 insertions(+), 16 deletions(-)
mode change 100644 => 100755 base/android/application_status_listener.cc
mode change 100644 => 100755 base/android/application_status_listener.h
mode change 100644 => 100755 base/android/java/src/org/chromium/base/ApplicationStatus.java
mode change 100644 => 100755 chrome/android/java/src/org/chromium/chrome/browser/ApplicationLifetime.java
mode change 100644 => 100755 chrome/browser/availability/availability_prober.cc
mode change 100644 => 100755 components/browser_ui/site_settings/android/java/res/layout/four_state_cookie_settings_preference.xml
mode change 100644 => 100755 components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/ContentSettingsResources.java
mode change 100644 => 100755 components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/FourStateCookieSettingsPreference.java
mode change 100644 => 100755 components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SingleCategorySettings.java
mode change 100644 => 100755 components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SingleWebsiteSettings.java
mode change 100644 => 100755 components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SiteSettings.java
mode change 100644 => 100755 components/browser_ui/strings/android/site_settings.grdp
mode change 100644 => 100755 components/browser_ui/strings/android/translations/browser_ui_strings_it.xtb
mode change 100644 => 100755 components/content_settings/core/browser/content_settings_registry.cc
mode change 100644 => 100755 content/browser/scheduler/responsiveness/calculator.cc
mode change 100644 => 100755 mojo/public/cpp/base/application_state_mojom_traits.cc
mode change 100644 => 100755 mojo/public/mojom/base/application_state.mojom
mode change 100644 => 100755 services/network/cookie_manager.cc
mode change 100644 => 100755 services/network/cookie_manager.h
mode change 100644 => 100755 services/network/network_context.cc
mode change 100644 => 100755 services/network/public/mojom/cookie_manager.mojom
mode change 100644 => 100755 services/network/session_cleanup_cookie_store.cc
mode change 100644 => 100755 services/network/session_cleanup_cookie_store.h
diff --git a/base/android/application_status_listener.cc b/base/android/application_status_listener.cc
old mode 100644
new mode 100755
--- a/base/android/application_status_listener.cc
+++ b/base/android/application_status_listener.cc
@@ -84,6 +84,7 @@ void ApplicationStatusListener::NotifyApplicationStateChange(
switch (state) {
case APPLICATION_STATE_UNKNOWN:
case APPLICATION_STATE_HAS_DESTROYED_ACTIVITIES:
+ case APPLICATION_STATE_EXITING:
break;
case APPLICATION_STATE_HAS_RUNNING_ACTIVITIES:
RecordAction(UserMetricsAction("Android.LifeCycle.HasRunningActivities"));
diff --git a/base/android/application_status_listener.h b/base/android/application_status_listener.h
old mode 100644
new mode 100755
--- a/base/android/application_status_listener.h
+++ b/base/android/application_status_listener.h
@@ -30,7 +30,8 @@ enum ApplicationState {
APPLICATION_STATE_HAS_RUNNING_ACTIVITIES = 1,
APPLICATION_STATE_HAS_PAUSED_ACTIVITIES = 2,
APPLICATION_STATE_HAS_STOPPED_ACTIVITIES = 3,
- APPLICATION_STATE_HAS_DESTROYED_ACTIVITIES = 4
+ APPLICATION_STATE_HAS_DESTROYED_ACTIVITIES = 4,
+ APPLICATION_STATE_EXITING = 5
};
// A native helper class to listen to state changes of the Android
diff --git a/base/android/java/src/org/chromium/base/ApplicationStatus.java b/base/android/java/src/org/chromium/base/ApplicationStatus.java
old mode 100644
new mode 100755
--- a/base/android/java/src/org/chromium/base/ApplicationStatus.java
+++ b/base/android/java/src/org/chromium/base/ApplicationStatus.java
@@ -661,6 +661,10 @@ public class ApplicationStatus {
return ApplicationState.HAS_DESTROYED_ACTIVITIES;
}
+ public static void sendOnApplicationStateChange(int newState) {
+ ApplicationStatusJni.get().onApplicationStateChange(newState);
+ }
+
@NativeMethods
interface Natives {
// Called to notify the native side of state changes.
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ApplicationLifetime.java b/chrome/android/java/src/org/chromium/chrome/browser/ApplicationLifetime.java
old mode 100644
new mode 100755
--- a/chrome/android/java/src/org/chromium/chrome/browser/ApplicationLifetime.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/ApplicationLifetime.java
@@ -6,6 +6,7 @@ package org.chromium.chrome.browser;
import org.chromium.base.ObserverList;
import org.chromium.base.annotations.CalledByNative;
+import org.chromium.base.ApplicationStatus;
/**
* Watches for when Chrome is told to restart itself.
@@ -42,6 +43,8 @@ public class ApplicationLifetime {
@CalledByNative
public static void terminate(boolean restart) {
+ ApplicationStatus.sendOnApplicationStateChange(org.chromium.mojo_base.mojom.ApplicationState.APPLICATION_STATE_EXITING);
+
for (Observer observer : sObservers) {
observer.onTerminate(restart);
}
diff --git a/chrome/browser/availability/availability_prober.cc b/chrome/browser/availability/availability_prober.cc
old mode 100644
new mode 100755
--- a/chrome/browser/availability/availability_prober.cc
+++ b/chrome/browser/availability/availability_prober.cc
@@ -205,6 +205,7 @@ bool IsInForeground(base::android::ApplicationState state) {
case base::android::APPLICATION_STATE_HAS_PAUSED_ACTIVITIES:
case base::android::APPLICATION_STATE_HAS_STOPPED_ACTIVITIES:
case base::android::APPLICATION_STATE_HAS_DESTROYED_ACTIVITIES:
+ case base::android::APPLICATION_STATE_EXITING:
return false;
}
}
diff --git a/components/browser_ui/site_settings/android/java/res/layout/four_state_cookie_settings_preference.xml b/components/browser_ui/site_settings/android/java/res/layout/four_state_cookie_settings_preference.xml
old mode 100644
new mode 100755
--- a/components/browser_ui/site_settings/android/java/res/layout/four_state_cookie_settings_preference.xml
+++ b/components/browser_ui/site_settings/android/java/res/layout/four_state_cookie_settings_preference.xml
@@ -39,6 +39,13 @@
app:primaryText="@string/website_settings_category_cookie_block_third_party_title"
app:descriptionText="@string/website_settings_category_cookie_block_third_party_addition" />
+ <org.chromium.components.browser_ui.widget.RadioButtonWithDescription
+ android:id="@+id/session_only"
+ android:layout_width="match_parent"
+ android:layout_height="wrap_content"
+ app:primaryText="@string/website_settings_category_cookie_session_only_title"
+ app:descriptionText="@string/website_settings_category_cookie_session_only_addition" />
+
<org.chromium.components.browser_ui.widget.RadioButtonWithDescription
android:id="@+id/block"
android:layout_width="match_parent"
diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/ContentSettingsResources.java b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/ContentSettingsResources.java
old mode 100644
new mode 100755
--- a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/ContentSettingsResources.java
+++ b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/ContentSettingsResources.java
@@ -325,6 +325,8 @@ public class ContentSettingsResources {
return R.string.website_settings_permissions_allow;
case ContentSettingValues.BLOCK:
return R.string.website_settings_permissions_block;
+ case ContentSettingValues.SESSION_ONLY:
+ return R.string.website_settings_category_cookie_session_only_title;
default:
return 0; // We never show Ask as an option on individual permissions.
}
@@ -412,4 +414,11 @@ public class ContentSettingsResources {
assert false;
return null;
}
+
+ /**
+ * Returns the summary for Cookie content settings when it is session only
+ */
+ public static int getCookieSessionOnlySummary() {
+ return R.string.website_settings_category_cookie_session_only_title;
+ }
}
diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/FourStateCookieSettingsPreference.java b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/FourStateCookieSettingsPreference.java
old mode 100644
new mode 100755
--- a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/FourStateCookieSettingsPreference.java
+++ b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/FourStateCookieSettingsPreference.java
@@ -30,7 +30,8 @@ public class FourStateCookieSettingsPreference
ALLOW,
BLOCK_THIRD_PARTY_INCOGNITO,
BLOCK_THIRD_PARTY,
- BLOCK
+ BLOCK,
+ SESSION_ONLY
}
/**
@@ -48,6 +49,9 @@ public class FourStateCookieSettingsPreference
public boolean cookiesContentSettingEnforced;
// Whether third-party blocking is enforced.
public boolean thirdPartyBlockingEnforced;
+
+ // Whether session-only cookies are enabled.
+ public boolean sessionOnlyCookies;
}
// Keeps the params that are applied to the UI if the params are set before the UI is ready.
@@ -55,6 +59,7 @@ public class FourStateCookieSettingsPreference
// UI Elements.
private RadioButtonWithDescription mAllowButton;
+ private RadioButtonWithDescription mSessionOnlyButton;
private RadioButtonWithDescription mBlockThirdPartyIncognitoButton;
private RadioButtonWithDescription mBlockThirdPartyButton;
private RadioButtonWithDescription mBlockButton;
@@ -98,6 +103,8 @@ public class FourStateCookieSettingsPreference
if (mAllowButton.isChecked()) {
return CookieSettingsState.ALLOW;
+ } else if (mSessionOnlyButton.isChecked()) {
+ return CookieSettingsState.SESSION_ONLY;
} else if (mBlockThirdPartyIncognitoButton.isChecked()) {
return CookieSettingsState.BLOCK_THIRD_PARTY_INCOGNITO;
} else if (mBlockThirdPartyButton.isChecked()) {
@@ -118,6 +125,7 @@ public class FourStateCookieSettingsPreference
super.onBindViewHolder(holder);
mAllowButton = (RadioButtonWithDescription) holder.findViewById(R.id.allow);
+ mSessionOnlyButton = (RadioButtonWithDescription) holder.findViewById(R.id.session_only);
mBlockThirdPartyIncognitoButton =
(RadioButtonWithDescription) holder.findViewById(R.id.block_third_party_incognito);
mBlockThirdPartyButton =
@@ -144,7 +152,9 @@ public class FourStateCookieSettingsPreference
// reflect the only possible states you can be in
// (Allow/BlockThirdPartyIncognito/BlockThirdParty/Block), instead of using this
// combination of multiple signals.
- if (!params.allowCookies) {
+ if (params.sessionOnlyCookies) {
+ return CookieSettingsState.SESSION_ONLY;
+ } else if (!params.allowCookies) {
return CookieSettingsState.BLOCK;
} else if (params.blockThirdPartyCookies
|| params.cookieControlsMode == CookieControlsMode.BLOCK_THIRD_PARTY) {
@@ -159,6 +169,7 @@ public class FourStateCookieSettingsPreference
private void configureRadioButtons(Params params) {
assert (mRadioGroup != null);
mAllowButton.setEnabled(true);
+ mSessionOnlyButton.setEnabled(true);
mBlockThirdPartyIncognitoButton.setEnabled(true);
mBlockThirdPartyButton.setEnabled(true);
mBlockButton.setEnabled(true);
@@ -189,6 +200,8 @@ public class FourStateCookieSettingsPreference
switch (state) {
case ALLOW:
return mAllowButton;
+ case SESSION_ONLY:
+ return mSessionOnlyButton;
case BLOCK_THIRD_PARTY_INCOGNITO:
return mBlockThirdPartyIncognitoButton;
case BLOCK_THIRD_PARTY:
diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SingleCategorySettings.java b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SingleCategorySettings.java
old mode 100644
new mode 100755
--- a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SingleCategorySettings.java
+++ b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SingleCategorySettings.java
@@ -568,6 +568,7 @@ public class SingleCategorySettings extends SiteSettingsPreferenceFragment
private void setCookieSettingsPreference(CookieSettingsState state) {
boolean allowCookies;
+ boolean sessionOnly;
@CookieControlsMode
int mode;
@@ -575,28 +576,50 @@ public class SingleCategorySettings extends SiteSettingsPreferenceFragment
case ALLOW:
allowCookies = true;
mode = CookieControlsMode.OFF;
+ sessionOnly = false;
+ break;
+ case SESSION_ONLY:
+ allowCookies = true;
+ sessionOnly = true;
+ mode = CookieControlsMode.BLOCK_THIRD_PARTY;
break;
case BLOCK_THIRD_PARTY_INCOGNITO:
allowCookies = true;
mode = CookieControlsMode.INCOGNITO_ONLY;
+ sessionOnly = false;
break;
case BLOCK_THIRD_PARTY:
allowCookies = true;
mode = CookieControlsMode.BLOCK_THIRD_PARTY;
+ sessionOnly = false;
break;
case BLOCK:
allowCookies = false;
mode = CookieControlsMode.BLOCK_THIRD_PARTY;
+ sessionOnly = false;
break;
default:
return;
}
+ // reset default
+ WebsitePreferenceBridge.setContentSetting(
+ getSiteSettingsClient().getBrowserContextHandle(), ContentSettingsType.COOKIES,
+ ContentSettingValues.DEFAULT);
+
WebsitePreferenceBridge.setCategoryEnabled(
getSiteSettingsClient().getBrowserContextHandle(), ContentSettingsType.COOKIES,
allowCookies);
getPrefs().setCookieControlsMode(mode);
getPrefs().setBlockThirdPartyCookies(mode == CookieControlsMode.BLOCK_THIRD_PARTY);
+
+ // set sessiononly content setting for cookies
+ if(sessionOnly)
+ {
+ WebsitePreferenceBridge.setContentSetting(
+ getSiteSettingsClient().getBrowserContextHandle(), ContentSettingsType.COOKIES,
+ ContentSettingValues.SESSION_ONLY);
+ }
}
private boolean cookieSettingsExceptionShouldBlock() {
@@ -1079,6 +1102,13 @@ public class SingleCategorySettings extends SiteSettingsPreferenceFragment
params.cookieControlsMode = getPrefs().getCookieControlsMode();
params.cookiesContentSettingEnforced = mCategory.isManaged();
params.thirdPartyBlockingEnforced = getPrefs().isBlockThirdPartyCookiesManaged();
+
+ if (WebsitePreferenceBridge.getContentSetting(
+ getSiteSettingsClient().getBrowserContextHandle(),
+ mCategory.getContentSettingsType()) == ContentSettingValues.SESSION_ONLY) {
+ params.sessionOnlyCookies = true;
+ }
+
fourStateCookieToggle.setState(params);
}
diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SingleWebsiteSettings.java b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SingleWebsiteSettings.java
old mode 100644
new mode 100755
--- a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SingleWebsiteSettings.java
+++ b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SingleWebsiteSettings.java
@@ -69,6 +69,7 @@ public class SingleWebsiteSettings extends SiteSettingsPreferenceFragment
public static final String PREF_RESET_SITE = "reset_site_button";
public static final String TAG = "SingleWebsitePreferences";
+
// Website permissions (if adding new, see hasPermissionsPreferences and resetSite below)
// All permissions from the permissions preference category must be listed here.
private static final String[] PERMISSION_PREFERENCE_KEYS = {
@@ -746,19 +747,36 @@ public class SingleWebsiteSettings extends SiteSettingsPreferenceFragment
setUpPreferenceCommon(preference);
ListPreference listPreference = (ListPreference) preference;
- CharSequence[] keys = new String[2];
- CharSequence[] descriptions = new String[2];
- keys[0] = ContentSetting.toString(ContentSettingValues.ALLOW);
- keys[1] = ContentSetting.toString(ContentSettingValues.BLOCK);
- descriptions[0] =
- getString(ContentSettingsResources.getSiteSummary(ContentSettingValues.ALLOW));
- descriptions[1] =
- getString(ContentSettingsResources.getSiteSummary(ContentSettingValues.BLOCK));
- listPreference.setEntryValues(keys);
- listPreference.setEntries(descriptions);
+ if(getContentSettingsTypeFromPreferenceKey(preference.getKey()) == ContentSettingsType.COOKIES) {
+ CharSequence[] keys = new String[3];
+ CharSequence[] descriptions = new String[3];
+ keys[0] = ContentSetting.toString(ContentSettingValues.ALLOW);
+ keys[1] = ContentSetting.toString(ContentSettingValues.BLOCK);
+ keys[2] = ContentSetting.toString(ContentSettingValues.SESSION_ONLY);
+ descriptions[0] =
+ getString(ContentSettingsResources.getSiteSummary(ContentSettingValues.ALLOW));
+ descriptions[1] =
+ getString(ContentSettingsResources.getSiteSummary(ContentSettingValues.BLOCK));
+ descriptions[2] =
+ getString(ContentSettingsResources.getSiteSummary(ContentSettingValues.SESSION_ONLY));
+ listPreference.setEntryValues(keys);
+ listPreference.setEntries(descriptions);
+ } else {
+ CharSequence[] keys = new String[2];
+ CharSequence[] descriptions = new String[2];
+ keys[0] = ContentSetting.toString(ContentSettingValues.ALLOW);
+ keys[1] = ContentSetting.toString(ContentSettingValues.BLOCK);
+ descriptions[0] =
+ getString(ContentSettingsResources.getSiteSummary(ContentSettingValues.ALLOW));
+ descriptions[1] =
+ getString(ContentSettingsResources.getSiteSummary(ContentSettingValues.BLOCK));
+ listPreference.setEntryValues(keys);
+ listPreference.setEntries(descriptions);
+ }
+
// TODO(crbug.com/735110): Figure out if this is the correct thing to do - here we are
// effectively treating non-ALLOW values as BLOCK.
- int index = (value == ContentSettingValues.ALLOW ? 0 : 1);
+ int index = (value == ContentSettingValues.SESSION_ONLY ? 2 : (value == ContentSettingValues.ALLOW ? 0 : 1));
listPreference.setValueIndex(index);
listPreference.setOnPreferenceChangeListener(this);
listPreference.setSummary("%s");
diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SiteSettings.java b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SiteSettings.java
old mode 100644
new mode 100755
--- a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SiteSettings.java
+++ b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SiteSettings.java
@@ -67,6 +67,8 @@ public class SiteSettings
}
boolean requiresTriStateSetting =
WebsitePreferenceBridge.requiresTriStateContentSetting(contentType);
+ boolean requiresFourStateContentSetting =
+ WebsitePreferenceBridge.requiresFourStateContentSetting(contentType);
boolean checked = false;
@ContentSettingValues
@@ -78,6 +80,11 @@ public class SiteSettings
} else if (requiresTriStateSetting) {
setting = WebsitePreferenceBridge.getContentSetting(
browserContextHandle, contentType);
+ } else if (requiresFourStateContentSetting) {
+ setting = WebsitePreferenceBridge.getContentSetting(
+ browserContextHandle, contentType);
+ checked = WebsitePreferenceBridge.isCategoryEnabled(
+ browserContextHandle, contentType);
} else {
checked = WebsitePreferenceBridge.isCategoryEnabled(
browserContextHandle, contentType);
@@ -95,6 +102,8 @@ public class SiteSettings
.showPermissionBlockedMessage(getActivity())) {
// Show 'disabled' message when permission is not granted in Android.
p.setSummary(ContentSettingsResources.getCategorySummary(contentType, false));
+ } else if (Type.COOKIES == prefCategory && requiresFourStateContentSetting && setting == ContentSettingValues.SESSION_ONLY) {
+ p.setSummary(ContentSettingsResources.getCookieSessionOnlySummary());
} else if (Type.COOKIES == prefCategory && checked
&& getSiteSettingsClient()
.getSiteSettingsPrefClient()
diff --git a/components/browser_ui/strings/android/site_settings.grdp b/components/browser_ui/strings/android/site_settings.grdp
old mode 100644
new mode 100755
--- a/components/browser_ui/strings/android/site_settings.grdp
+++ b/components/browser_ui/strings/android/site_settings.grdp
@@ -333,8 +333,14 @@
Cookies are files created by websites you visit. Sites use them to remember your preferences. Third-party cookies are created by other sites. These sites own some of the content, like ads or images, that you see on the webpage you visit.
</message>
- <!-- JavaScript -->
+ <message name="IDS_WEBSITE_SETTINGS_CATEGORY_COOKIE_SESSION_ONLY_TITLE" desc="Text used to explain the session-only cookies in settings">
+ Session-only cookies
+ </message>
+ <message name="IDS_WEBSITE_SETTINGS_CATEGORY_COOKIE_SESSION_ONLY_ADDITION" desc="Additional text used to explain the session-only cookies option in settings">
+ Cookies are availables only until the browser is closed. Third-party cookies will be blocked.
+ </message>
+ <!-- JavaScript -->
<message name="IDS_WEBSITE_SETTINGS_CATEGORY_JAVASCRIPT_ALLOWED" desc="Summary text explaining that sites are allowed to run Javascript and that it is the recommended setting.">
Allow sites to run JavaScript (recommended)
</message>
diff --git a/components/browser_ui/strings/android/translations/browser_ui_strings_it.xtb b/components/browser_ui/strings/android/translations/browser_ui_strings_it.xtb
old mode 100644
new mode 100755
--- a/components/browser_ui/strings/android/translations/browser_ui_strings_it.xtb
+++ b/components/browser_ui/strings/android/translations/browser_ui_strings_it.xtb
@@ -238,4 +238,6 @@
<translation id="9019902583201351841">Gestito dai genitori</translation>
<translation id="945632385593298557">Accesso al microfono</translation>
<translation id="965817943346481315">Blocca se il sito mostra annunci invasivi o fuorvianti (consigliato)</translation>
+<translation id="1709693995511170330">Solo cookies di sessione</translation>
+<translation id="1835270207120366221">Mantieni i cookies per la sessione corrente.</translation>
</translationbundle>
\ No newline at end of file
diff --git a/components/content_settings/core/browser/content_settings_registry.cc b/components/content_settings/core/browser/content_settings_registry.cc
old mode 100644
new mode 100755
diff --git a/content/browser/scheduler/responsiveness/calculator.cc b/content/browser/scheduler/responsiveness/calculator.cc
old mode 100644
new mode 100755
--- a/content/browser/scheduler/responsiveness/calculator.cc
+++ b/content/browser/scheduler/responsiveness/calculator.cc
@@ -331,6 +331,7 @@ void Calculator::OnApplicationStateChanged(
is_application_visible_ = false;
break;
case base::android::APPLICATION_STATE_UNKNOWN:
+ case base::android::APPLICATION_STATE_EXITING:
break; // Keep in previous state.
}
}
diff --git a/mojo/public/cpp/base/application_state_mojom_traits.cc b/mojo/public/cpp/base/application_state_mojom_traits.cc
old mode 100644
new mode 100755
--- a/mojo/public/cpp/base/application_state_mojom_traits.cc
+++ b/mojo/public/cpp/base/application_state_mojom_traits.cc
@@ -22,6 +22,8 @@ mojo_base::mojom::ApplicationState EnumTraits<
return mojo_base::mojom::ApplicationState::HAS_STOPPED_ACTIVITIES;
case base::android::APPLICATION_STATE_HAS_DESTROYED_ACTIVITIES:
return mojo_base::mojom::ApplicationState::HAS_DESTROYED_ACTIVITIES;
+ case base::android::APPLICATION_STATE_EXITING:
+ return mojo_base::mojom::ApplicationState::APPLICATION_STATE_EXITING;
}
NOTREACHED();
return mojo_base::mojom::ApplicationState::UNKNOWN;
@@ -52,7 +54,10 @@ bool EnumTraits<mojo_base::mojom::ApplicationState,
*output = base::android::ApplicationState::
APPLICATION_STATE_HAS_DESTROYED_ACTIVITIES;
return true;
- }
+ case mojo_base::mojom::ApplicationState::APPLICATION_STATE_EXITING:
+ *output = base::android::ApplicationState::
+ APPLICATION_STATE_EXITING;
+ return true; }
return false;
}
diff --git a/mojo/public/mojom/base/application_state.mojom b/mojo/public/mojom/base/application_state.mojom
old mode 100644
new mode 100755
--- a/mojo/public/mojom/base/application_state.mojom
+++ b/mojo/public/mojom/base/application_state.mojom
@@ -11,4 +11,5 @@ enum ApplicationState {
HAS_PAUSED_ACTIVITIES,
HAS_STOPPED_ACTIVITIES,
HAS_DESTROYED_ACTIVITIES,
+ APPLICATION_STATE_EXITING
};
diff --git a/services/network/cookie_manager.cc b/services/network/cookie_manager.cc
old mode 100644
new mode 100755
--- a/services/network/cookie_manager.cc
+++ b/services/network/cookie_manager.cc
@@ -60,6 +60,10 @@ CookieManager::CookieManager(
cookie_store_->SetCookieAccessDelegate(
std::make_unique<CookieAccessDelegateImpl>(cookie_access_delegate_type,
&cookie_settings_));
+ if(session_cleanup_cookie_store_) {
+ session_cleanup_cookie_store_->SetDefaultDeleteCookiePredicate(
+ cookie_settings_.CreateDeleteCookieOnExitPredicate());
+ }
}
CookieManager::~CookieManager() {
@@ -73,6 +77,16 @@ CookieManager::~CookieManager() {
cookie_store_->SetCookieAccessDelegate(nullptr);
}
+void CookieManager::DeleteSessionCookies()
+{
+ // anonymous profile doesn't have a session_cleanup_cookie_store
+ if (session_cleanup_cookie_store_) {
+ session_cleanup_cookie_store_->DeleteSessionCookies(
+ cookie_settings_.CreateDeleteCookieOnExitPredicate());
+ }
+}
+
+
void CookieManager::AddReceiver(
mojo::PendingReceiver<mojom::CookieManager> receiver) {
receivers_.Add(this, std::move(receiver));
diff --git a/services/network/cookie_manager.h b/services/network/cookie_manager.h
old mode 100644
new mode 100755
--- a/services/network/cookie_manager.h
+++ b/services/network/cookie_manager.h
@@ -101,6 +101,9 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) CookieManager
// Causes the next call to GetCookieList to crash the process.
static void CrashOnGetCookieList();
+ // launch session_cleanup_cookie_store_()
+ void DeleteSessionCookies() override;
+
private:
// State associated with a CookieChangeListener.
struct ListenerRegistration {
diff --git a/services/network/network_context.cc b/services/network/network_context.cc
old mode 100644
new mode 100755
--- a/services/network/network_context.cc
+++ b/services/network/network_context.cc
@@ -289,12 +289,23 @@ class NetworkContextApplicationStatusListener
}
void Notify(base::android::ApplicationState state) override {
+ if(cookie_manager_) {
+ if(state == base::android::APPLICATION_STATE_EXITING) {
+ cookie_manager_->DeleteSessionCookies();
+ }
+ }
+
if (callback_)
callback_.Run(state);
}
+ void SetCookieManager(CookieManager* cookie_manager) {
+ cookie_manager_ = cookie_manager;
+ }
+
private:
ApplicationStateChangeCallback callback_;
+ CookieManager* cookie_manager_;
};
#endif
@@ -2106,6 +2117,12 @@ URLRequestContextOwner NetworkContext::MakeURLRequestContext() {
std::move(session_cleanup_cookie_store),
std::move(params_->cookie_manager_params));
+#if defined(OS_ANDROID)
+
+ (static_cast<NetworkContextApplicationStatusListener*>(app_status_listener_.get()))->SetCookieManager(cookie_manager_.get());
+
+#endif
+
if (cert_net_fetcher_)
cert_net_fetcher_->SetURLRequestContext(result.url_request_context.get());
diff --git a/services/network/public/mojom/cookie_manager.mojom b/services/network/public/mojom/cookie_manager.mojom
old mode 100644
new mode 100755
--- a/services/network/public/mojom/cookie_manager.mojom
+++ b/services/network/public/mojom/cookie_manager.mojom
@@ -361,4 +361,7 @@ interface CookieManager {
// the caller with a callback when settings have been updated.
SetStorageAccessGrantSettings(
array<content_settings.mojom.ContentSettingPatternSource> settings) => ();
+
+ // launch session_cleanup_cookie_store_()
+ DeleteSessionCookies();
};
diff --git a/services/network/session_cleanup_cookie_store.cc b/services/network/session_cleanup_cookie_store.cc
old mode 100644
new mode 100755
--- a/services/network/session_cleanup_cookie_store.cc
+++ b/services/network/session_cleanup_cookie_store.cc
@@ -49,6 +49,11 @@ SessionCleanupCookieStore::~SessionCleanupCookieStore() {
"SessionCleanupCookieStore");
}
+void SessionCleanupCookieStore::SetDefaultDeleteCookiePredicate(DeleteCookiePredicate delete_cookie_predicate)
+{
+ delete_cookie_predicate_ = delete_cookie_predicate;
+}
+
void SessionCleanupCookieStore::DeleteSessionCookies(
DeleteCookiePredicate delete_cookie_predicate) {
using CookieOrigin = net::SQLitePersistentCookieStore::CookieOrigin;
@@ -137,6 +142,40 @@ void SessionCleanupCookieStore::OnLoad(
++cookies_per_origin_[origin];
}
+#if defined(OS_ANDROID)
+ // In android delete session cookies is never called because it's in dtor(), launch now at restart
+ using CookieOrigin = net::SQLitePersistentCookieStore::CookieOrigin;
+ if (!force_keep_session_state_ && delete_cookie_predicate_)
+ {
+ std::list<CookieOrigin> session_only_cookies;
+
+ auto cookies_filtered =
+ std::remove_if(
+ cookies.begin(),
+ cookies.end(),
+ [this,&session_only_cookies](const auto& entry) {
+ bool mustRemoved = false;
+ CookieOrigin origin(entry->Domain(), entry->IsSecure());
+ if(cookies_per_origin_cleared_[origin] == false)
+ {
+ mustRemoved = delete_cookie_predicate_.Run(origin.first, origin.second);
+ }
+ if( mustRemoved ) session_only_cookies.push_back(origin);
+ return mustRemoved;
+ });
+
+ cookies.erase(cookies_filtered, cookies.end());
+
+ // We need to remove session by origin once
+ for (const auto& cookie : cookies) {
+ CookieOrigin origin(cookie->Domain(), cookie->IsSecure());
+ cookies_per_origin_cleared_[origin] = true;
+ }
+
+ persistent_store_->DeleteAllInList(session_only_cookies);
+ }
+#endif
+
std::move(loaded_callback).Run(std::move(cookies));
}
diff --git a/services/network/session_cleanup_cookie_store.h b/services/network/session_cleanup_cookie_store.h
old mode 100644
new mode 100755
--- a/services/network/session_cleanup_cookie_store.h
+++ b/services/network/session_cleanup_cookie_store.h
@@ -59,6 +59,11 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) SessionCleanupCookieStore
// |delete_cookie_predicate| returns true for.
void DeleteSessionCookies(DeleteCookiePredicate delete_cookie_predicate);
+ // Used on android to force deletion of session cookies
+ using CookiesPerOriginClearedMap =
+ std::map<net::SQLitePersistentCookieStore::CookieOrigin, bool>;
+ void SetDefaultDeleteCookiePredicate(DeleteCookiePredicate delete_cookie_predicate);
+
protected:
~SessionCleanupCookieStore() override;
@@ -80,6 +85,10 @@ class COMPONENT_EXPORT(NETWORK_SERVICE) SessionCleanupCookieStore
net::NetLogWithSource net_log_;
+ // Used on android to force deletion of session cookies
+ DeleteCookiePredicate delete_cookie_predicate_;
+ CookiesPerOriginClearedMap cookies_per_origin_cleared_;
+
DISALLOW_COPY_AND_ASSIGN(SessionCleanupCookieStore);
};
--
2.17.1

View file

@ -1,24 +1,12 @@
From: mars <gzhqyz@gmail.com>
Date: Wed, 13 May 2020 11:28:04 +0800
Date: Sun, 2 Aug 2020 00:37:49 +0800
Subject: Update i18n zh_CN support
---
.../app/resources/chromium_strings_zh-CN.xtb | 3 ++-
.../resources/generated_resources_zh-CN.xtb | 6 +++++-
.../android_chrome_strings_zh-CN.xtb | 18 ++++++++++++++++++
3 files changed, 25 insertions(+), 2 deletions(-)
.../resources/generated_resources_zh-CN.xtb | 6 +++++-
.../android_chrome_strings_zh-CN.xtb | 19 +++++++++++++++++++
2 files changed, 24 insertions(+), 1 deletion(-)
diff --git a/chrome/app/resources/chromium_strings_zh-CN.xtb b/chrome/app/resources/chromium_strings_zh-CN.xtb
--- a/chrome/app/resources/chromium_strings_zh-CN.xtb
+++ b/chrome/app/resources/chromium_strings_zh-CN.xtb
@@ -245,4 +245,5 @@ Chromium 无法恢复您的设置。</translation>
<translation id="93478295209880648">Chromium 可能无法正常运行,因为它不再支持 Windows XP 和 Windows Vista</translation>
<translation id="95514773681268843"><ph name="DOMAIN" /> 要求您必须先阅读并接受以下服务条款,才能使用此设备。这些条款不会扩大、修改或限制 Chromium 操作系统条款。</translation>
<translation id="985602178874221306">The Chromium Authors</translation>
-</translationbundle>
\ No newline at end of file
+<translation id="9090881409075599658">关于 Bromite</translation>
+</translationbundle>
diff --git a/chrome/app/resources/generated_resources_zh-CN.xtb b/chrome/app/resources/generated_resources_zh-CN.xtb
--- a/chrome/app/resources/generated_resources_zh-CN.xtb
+++ b/chrome/app/resources/generated_resources_zh-CN.xtb
@ -36,10 +24,11 @@ diff --git a/chrome/app/resources/generated_resources_zh-CN.xtb b/chrome/app/res
diff --git a/chrome/browser/ui/android/strings/translations/android_chrome_strings_zh-CN.xtb b/chrome/browser/ui/android/strings/translations/android_chrome_strings_zh-CN.xtb
--- a/chrome/browser/ui/android/strings/translations/android_chrome_strings_zh-CN.xtb
+++ b/chrome/browser/ui/android/strings/translations/android_chrome_strings_zh-CN.xtb
@@ -1011,4 +1011,22 @@
@@ -1011,4 +1011,23 @@
<translation id="666268767214822976">当您在地址栏中输入查询内容时,使用联想查询服务显示相关查询和热门网站</translation>
<translation id="8283853025636624853">正在同步到 <ph name="SYNC_ACCOUNT_USER_NAME" /></translation>
<translation id="8981454092730389528">Google 活动控件</translation>
+<translation id="5334844597069022743">查看源代码</translation>
+<translation id="9090881409075599658">关于 Bromite</translation>
+<translation id="9148058034647219655">退出</translation>
+<translation id="6544149167512551709">保留 Cookies 直到您退出浏览器</translation>