diff --git a/build/bromite_patches_list.txt b/build/bromite_patches_list.txt index 872581ac..eb1dd7b7 100644 --- a/build/bromite_patches_list.txt +++ b/build/bromite_patches_list.txt @@ -146,6 +146,7 @@ Disable-the-DIAL-repeating-discovery.patch Block-all-connection-requests-with-qjz9zk-in-the-domain-name-or-with-a-trk-scheme.patch Hardening-against-incognito-mode-detection.patch Remove-weblayer-dependency-on-Play-Services.patch +Timezone-customization.patch Move-some-account-settings-back-to-privacy-settings.patch Flag-for-always-desktop-mode.patch Restore-Simplified-NTP-launch.patch diff --git a/build/patches/Add-a-proxy-configuration-page.patch b/build/patches/Add-a-proxy-configuration-page.patch index 00672e5a..ec69c8f8 100644 --- a/build/patches/Add-a-proxy-configuration-page.patch +++ b/build/patches/Add-a-proxy-configuration-page.patch @@ -37,7 +37,7 @@ Offer auto-complete for the proxy page URL. diff --git a/chrome/android/java/res/values/values.xml b/chrome/android/java/res/values/values.xml --- a/chrome/android/java/res/values/values.xml +++ b/chrome/android/java/res/values/values.xml -@@ -38,6 +38,9 @@ +@@ -32,6 +32,9 @@ 0 1 @@ -69,7 +69,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/privacy/setting private static final String PREF_ALWAYS_INCOGNITO = "always_incognito"; public static final String PREF_ALLOW_CUSTOM_TAB_INTENTS = "allow_custom_tab_intents"; + private static final String PREF_PROXY_OPTIONS = "proxy"; -+ ++ private static final String[] NEW_PRIVACY_PREFERENCE_ORDER = {PREF_CLEAR_BROWSING_DATA, PREF_CAN_MAKE_PAYMENT, PREF_NETWORK_PREDICTIONS, PREF_SECURE_DNS, PREF_DO_NOT_TRACK, @@ -77,7 +77,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/privacy/setting PREF_ALLOW_CUSTOM_TAB_INTENTS, - PREF_CLOSE_TABS_ON_EXIT + PREF_CLOSE_TABS_ON_EXIT, -+ PREF_PROXY_OPTIONS ++ PREF_PROXY_OPTIONS }; private ManagedPreferenceDelegate mManagedPreferenceDelegate; diff --git a/build/patches/Add-an-always-incognito-mode.patch b/build/patches/Add-an-always-incognito-mode.patch index 4b65d59a..7332d40f 100644 --- a/build/patches/Add-an-always-incognito-mode.patch +++ b/build/patches/Add-an-always-incognito-mode.patch @@ -44,7 +44,7 @@ diff --git a/chrome/android/java/res/xml/privacy_preferences.xml b/chrome/androi android:summary="@string/preload_pages_summary" android:persistent="false" android:order="1"/> -+ 0.5 - 0.5 - -+ Allow custom tab intents from applications -+ When disabled, all custom tab intents will be processed as regular navigation instead -+ - - 5 - diff --git a/chrome/android/java/res/xml/privacy_preferences.xml b/chrome/android/java/res/xml/privacy_preferences.xml --- a/chrome/android/java/res/xml/privacy_preferences.xml +++ b/chrome/android/java/res/xml/privacy_preferences.xml @@ -30,7 +16,7 @@ diff --git a/chrome/android/java/res/xml/privacy_preferences.xml b/chrome/androi android:key="do_not_track" android:title="@string/do_not_track_title" android:order="3"/> -+ -+ GetBrowserContext()); + +#if defined(OS_ANDROID) -+ if(profile->GetOriginalProfile()->GetPrefs()->GetBoolean(prefs::kIncognitoTabHistoryEnabled)) { -+ return HistoryServiceFactory::GetForProfile(profile, ServiceAccessType::IMPLICIT_ACCESS); -+ } ++ if(profile->GetOriginalProfile()->GetPrefs()->GetBoolean(prefs::kIncognitoTabHistoryEnabled)) { ++ return HistoryServiceFactory::GetForProfile(profile, ServiceAccessType::IMPLICIT_ACCESS); ++ } +#endif + if (profile->IsOffTheRecord()) @@ -193,18 +187,6 @@ diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chro Clears history and autocompletions in the address bar. Your Google Account may have other forms of browsing history at <link>myactivity.google.com</link>. -diff --git a/chrome/browser/ui/android/strings/translations/android_chrome_strings_it.xtb b/chrome/browser/ui/android/strings/translations/android_chrome_strings_it.xtb ---- a/chrome/browser/ui/android/strings/translations/android_chrome_strings_it.xtb -+++ b/chrome/browser/ui/android/strings/translations/android_chrome_strings_it.xtb -@@ -1142,4 +1142,6 @@ I dati della sessione in incognito vengono cancellati da Chrome soltanto quando - Chiudi tutte le schede - Generali - Menu scheda feed chiuso -- -\ No newline at end of file -+Abilita la cronologia nelle sessioni in incognito -+Abilita la registrazione della navigazione nella cronologia anche per le sessioni in incognito -+ diff --git a/chrome/common/pref_names.cc b/chrome/common/pref_names.cc --- a/chrome/common/pref_names.cc +++ b/chrome/common/pref_names.cc @@ -234,4 +216,3 @@ diff --git a/chrome/common/pref_names.h b/chrome/common/pref_names.h #endif // CHROME_COMMON_PREF_NAMES_H_ -- 2.17.1 - diff --git a/build/patches/Add-option-to-configure-the-ad-blocker-filters-URL.patch b/build/patches/Add-option-to-configure-the-ad-blocker-filters-URL.patch index 65dd5546..acaa5514 100644 --- a/build/patches/Add-option-to-configure-the-ad-blocker-filters-URL.patch +++ b/build/patches/Add-option-to-configure-the-ad-blocker-filters-URL.patch @@ -139,7 +139,7 @@ new file mode 100644 diff --git a/chrome/android/java/res/values/values.xml b/chrome/android/java/res/values/values.xml --- a/chrome/android/java/res/values/values.xml +++ b/chrome/android/java/res/values/values.xml -@@ -38,6 +38,8 @@ +@@ -32,6 +32,8 @@ 0 1 diff --git a/build/patches/Add-option-to-not-persist-tabs-across-sessions.patch b/build/patches/Add-option-to-not-persist-tabs-across-sessions.patch index 740141b4..ab876b8f 100644 --- a/build/patches/Add-option-to-not-persist-tabs-across-sessions.patch +++ b/build/patches/Add-option-to-not-persist-tabs-across-sessions.patch @@ -3,26 +3,12 @@ Date: Sat, 7 Sep 2019 15:07:42 +0200 Subject: Add option to not persist tabs across sessions --- - chrome/android/java/res/values/values.xml | 3 +++ chrome/android/java/res/xml/privacy_preferences.xml | 5 +++++ .../chrome/browser/ChromeTabbedActivity.java | 4 +++- .../browser/privacy/settings/PrivacySettings.java | 12 ++++++++++-- .../ui/android/strings/android_chrome_strings.grd | 6 ++++++ - 5 files changed, 27 insertions(+), 3 deletions(-) + 4 files changed, 24 insertions(+), 3 deletions(-) -diff --git a/chrome/android/java/res/values/values.xml b/chrome/android/java/res/values/values.xml ---- a/chrome/android/java/res/values/values.xml -+++ b/chrome/android/java/res/values/values.xml -@@ -31,6 +31,9 @@ - - 15 - -+ Close tabs on exit -+ Don\'t persist tabs between browsing sessions -+ - - 0 - 1 diff --git a/chrome/android/java/res/xml/privacy_preferences.xml b/chrome/android/java/res/xml/privacy_preferences.xml --- a/chrome/android/java/res/xml/privacy_preferences.xml +++ b/chrome/android/java/res/xml/privacy_preferences.xml @@ -30,7 +16,7 @@ diff --git a/chrome/android/java/res/xml/privacy_preferences.xml b/chrome/androi android:title="@string/always_incognito_title" android:summary="@string/always_incognito_summary" android:defaultValue="false" /> -+ ', - '', -+ '', starred ? starCat : '', '', docTitle, '', @@ -4107,7 +4107,7 @@ diff --git a/chrome/common/extensions/docs/templates/articles/app_codelab_images -

If you want to show an external image in your app, you need to request it via XMLHttpRequest, -transform it into a Blob, and create an ObjectURL. This ObjectURL can be added to the DOM -+

If you want to show an external image in your app, you need to request it via XMLHttpRequest, ++

If you want to show an external image in your app, you need to request it via XMLHttpRequest, +transform it into a Blob, and create an ObjectURL. This ObjectURL can be added to the DOM because it refers to an in-memory item in the context of the app.

@@ -7072,7 +7072,7 @@ diff --git a/chrome/common/extensions/docs/templates/articles/single_purpose.htm we launched a policy requiring Chrome extensions to have a single purpose. In addition, starting with the May 2014 release of Chrome, we -started requiring -+started requiring ++started requiring that extensions in Chrome for Windows be hosted in the Chrome Web Store. Starting in Chrome 44 in July 2015, extensions in Mac were also @@ -18134,9 +18134,9 @@ diff --git a/tools/perf/page_sets/alexa1-10000-urls.json b/tools/perf/page_sets/ - "http://www.facebook.com/", - "http://www.google.com/", - "http://www.youtube.com/", -+ "http://www.f8c3b00k.qjz9zk/", -+ "http://www.9oo91e.qjz9zk/", -+ "http://www.y0u1ub3.qjz9zk/", ++ "http://www.f8c3b00k.qjz9zk/", ++ "http://www.9oo91e.qjz9zk/", ++ "http://www.y0u1ub3.qjz9zk/", "http://www.yahoo.com/", "http://baidu.com/", "http://www.amazon.com/", @@ -18145,18 +18145,18 @@ diff --git a/tools/perf/page_sets/alexa1-10000-urls.json b/tools/perf/page_sets/ "http://www.tumblr.com/", "http://163.com/", - "http://www.google.com.hk/", -+ "http://www.9oo91e.qjz9zk.hk/", ++ "http://www.9oo91e.qjz9zk.hk/", "http://www.mail.ru/", "http://www.google.co.uk/", "http://hao123.com/", - "http://www.google.com.br/", -+ "http://www.9oo91e.qjz9zk.br/", ++ "http://www.9oo91e.qjz9zk.br/", "http://www.amazon.co.jp/", "http://www.weibo.com/", "http://www.xvideos.com/", "http://www.google.co.jp/", - "http://www.microsoft.com/", -+ "http://www.m1cr050ft.qjz9zk/", ++ "http://www.m1cr050ft.qjz9zk/", "http://www.delta-search.com/", "http://www.google.fr/", "http://www.conduit.com/", @@ -18165,7 +18165,7 @@ diff --git a/tools/perf/page_sets/alexa1-10000-urls.json b/tools/perf/page_sets/ "http://www.soso.com/", "http://www.pornhub.com/", - "http://www.google.com.mx/", -+ "http://www.9oo91e.qjz9zk.mx/", ++ "http://www.9oo91e.qjz9zk.mx/", "http://www.blogger.com/", "http://www.neobux.com/", "http://www.amazon.co.uk/", @@ -18174,12 +18174,12 @@ diff --git a/tools/perf/page_sets/alexa1-10000-urls.json b/tools/perf/page_sets/ "http://www.alipay.com/", "http://www.vube.com/", - "http://www.google.com.tr/", -+ "http://www.9oo91e.qjz9zk.tr/", ++ "http://www.9oo91e.qjz9zk.tr/", "http://www.youku.com/", "http://www.redtube.com/", "http://www.dailymotion.com/", - "http://www.google.com.au/", -+ "http://www.9oo91e.qjz9zk.au/", ++ "http://www.9oo91e.qjz9zk.au/", "http://www.adf.ly/", "http://www.netflix.com/", "http://www.adcash.com/", @@ -18188,19 +18188,19 @@ diff --git a/tools/perf/page_sets/alexa1-10000-urls.json b/tools/perf/page_sets/ "http://www.weather.com/", "http://www.pixnet.net/", - "http://www.google.com.sa/", -+ "http://www.9oo91e.qjz9zk.sa/", ++ "http://www.9oo91e.qjz9zk.sa/", "http://www.clkmon.com/", "http://www.reddit.com/", "http://www.amazon.it/", - "http://www.google.com.eg/", -+ "http://www.9oo91e.qjz9zk.eg/", ++ "http://www.9oo91e.qjz9zk.eg/", "http://www.booking.com/", "http://www.google.nl/", "http://www.douban.com/", "http://www.amazon.cn/", "http://www.slideshare.net/", - "http://www.google.com.ar/", -+ "http://www.9oo91e.qjz9zk.ar/", ++ "http://www.9oo91e.qjz9zk.ar/", "http://www.badoo.com/", "http://www.dailymail.co.uk/", "http://www.google.co.th/", @@ -18208,12 +18208,12 @@ diff --git a/tools/perf/page_sets/alexa1-10000-urls.json b/tools/perf/page_sets/ "http://www.wikia.com/", "http://www.godaddy.com/", - "http://www.google.com.tw/", -+ "http://www.9oo91e.qjz9zk.tw/", ++ "http://www.9oo91e.qjz9zk.tw/", "http://www.xinhuanet.com/", "http://www.mediafire.com/", "http://www.deviantart.com/", - "http://www.google.com.pk/", -+ "http://www.9oo91e.qjz9zk.pk/", ++ "http://www.9oo91e.qjz9zk.pk/", "http://www.bankofamerica.com/", "http://www.amazon.es/", "http://www.blogfa.com/", @@ -18222,7 +18222,7 @@ diff --git a/tools/perf/page_sets/alexa1-10000-urls.json b/tools/perf/page_sets/ "http://www.google.co.ve/", "http://www.56.com/", - "http://www.google.com.vn/", -+ "http://www.9oo91e.qjz9zk.vn/", ++ "http://www.9oo91e.qjz9zk.vn/", "http://www.google.gr/", "http://www.comcast.net/", "http://www.torrentz.eu/", @@ -18231,7 +18231,7 @@ diff --git a/tools/perf/page_sets/alexa1-10000-urls.json b/tools/perf/page_sets/ "http://www.answers.com/", "http://www.amazon.ca/", - "http://www.mozilla.org/", -+ "http://www.m0z111a.qjz9zk/", ++ "http://www.m0z111a.qjz9zk/", "http://www.guardian.co.uk/", "http://www.stumbleupon.com/", "http://www.hardsextube.com/", @@ -18240,12 +18240,12 @@ diff --git a/tools/perf/page_sets/alexa1-10000-urls.json b/tools/perf/page_sets/ "http://www.search-results.com/", "http://www.fiverr.com/", - "http://www.google.com.ua/", -+ "http://www.9oo91e.qjz9zk.ua/", ++ "http://www.9oo91e.qjz9zk.ua/", "http://www.files.wordpress.com/", "http://www.onlineaway.net/", "http://www.nbcnews.com/", - "http://www.google.com.co/", -+ "http://www.9oo91e.qjz9zk.co/", ++ "http://www.9oo91e.qjz9zk.co/", "http://www.hootsuite.com/", "http://www.4dsply.com/", "http://www.google.ro/", @@ -18254,11 +18254,11 @@ diff --git a/tools/perf/page_sets/alexa1-10000-urls.json b/tools/perf/page_sets/ "http://www.addthis.com/", "http://zol.com.cn/", - "http://www.google.com.ng/", -+ "http://www.9oo91e.qjz9zk.ng/", ++ "http://www.9oo91e.qjz9zk.ng/", "http://www.soundcloud.com/", "http://www.onclickads.net/", - "http://www.google.com.ph/", -+ "http://www.9oo91e.qjz9zk.ph/", ++ "http://www.9oo91e.qjz9zk.ph/", "http://www.dmm.co.jp/", "http://www.reference.com/", "http://www.google.be/", @@ -18267,7 +18267,7 @@ diff --git a/tools/perf/page_sets/alexa1-10000-urls.json b/tools/perf/page_sets/ "http://www.sweetim.com/", "http://www.aweber.com/", - "http://www.google.com.my/", -+ "http://www.9oo91e.qjz9zk.my/", ++ "http://www.9oo91e.qjz9zk.my/", "http://www.pandora.com/", "http://www.w3schools.com/", "http://www.pengyou.com/", @@ -18276,7 +18276,7 @@ diff --git a/tools/perf/page_sets/alexa1-10000-urls.json b/tools/perf/page_sets/ "http://www.warriorforum.com/", "http://www.statcounter.com/", - "http://www.google.com.pe/", -+ "http://www.9oo91e.qjz9zk.pe/", ++ "http://www.9oo91e.qjz9zk.pe/", "http://www.libero.it/", "http://www.thefreedictionary.com/", "http://www.soku.com/", @@ -18285,7 +18285,7 @@ diff --git a/tools/perf/page_sets/alexa1-10000-urls.json b/tools/perf/page_sets/ "http://www.uploaded.net/", "http://www.bild.de/", - "http://www.google.com.bd/", -+ "http://www.9oo91e.qjz9zk.bd/", ++ "http://www.9oo91e.qjz9zk.bd/", "http://www.google.at/", "http://www.webcrawler.com/", "http://www.t-online.de/", @@ -18294,7 +18294,7 @@ diff --git a/tools/perf/page_sets/alexa1-10000-urls.json b/tools/perf/page_sets/ "http://www.salesforce.com/", "http://www.scribd.com/", - "http://www.google.com.sg/", -+ "http://www.9oo91e.qjz9zk.sg/", ++ "http://www.9oo91e.qjz9zk.sg/", "http://it168.com/", "http://www.goodreads.com/", "http://www.target.com/", @@ -18303,7 +18303,7 @@ diff --git a/tools/perf/page_sets/alexa1-10000-urls.json b/tools/perf/page_sets/ "http://www.narod.ru/", "http://www.china.com/", - "http://www.doubleclick.com/", -+ "http://www.60u613cl1c4.c0m.qjz9zk/", ++ "http://www.60u613cl1c4.c0m.qjz9zk/", "http://www.cam4.com/", "http://www.google.ie/", "http://dangdang.com/", @@ -18312,7 +18312,7 @@ diff --git a/tools/perf/page_sets/alexa1-10000-urls.json b/tools/perf/page_sets/ "http://www.admagnet.net/", "http://rottentomatoes.com/", - "http://google.com.kw/", -+ "http://9oo91e.qjz9zk.kw/", ++ "http://9oo91e.qjz9zk.kw/", "http://www.cloob.com/", "http://www.nokia.com/", "http://wetter.com/", @@ -18321,7 +18321,7 @@ diff --git a/tools/perf/page_sets/alexa1-10000-urls.json b/tools/perf/page_sets/ "http://immobilienscout24.de/", "http://www.google.kz/", - "http://goo.gl/", -+ "http://goo.gl.qjz9zk/", ++ "http://goo.gl.qjz9zk/", "http://zwaar.net/", "http://www.bankmellat.ir/", "http://alphaporno.com/", @@ -18330,7 +18330,7 @@ diff --git a/tools/perf/page_sets/alexa1-10000-urls.json b/tools/perf/page_sets/ "http://www.sky.com/", "http://www.marketwatch.com/", - "http://www.google.com.ec/", -+ "http://www.9oo91e.qjz9zk.ec/", ++ "http://www.9oo91e.qjz9zk.ec/", "http://www.cbslocal.com/", "http://www.zhihu.com/", "http://www.888poker.com/", @@ -18339,7 +18339,7 @@ diff --git a/tools/perf/page_sets/alexa1-10000-urls.json b/tools/perf/page_sets/ "http://www.drom.ru/", "http://www.weather.gov/", - "http://gstatic.com/", -+ "http://95tat1c.qjz9zk/", ++ "http://95tat1c.qjz9zk/", "http://www.amung.us/", "http://www.traidnt.net/", "http://www.ovh.net/", @@ -18348,7 +18348,7 @@ diff --git a/tools/perf/page_sets/alexa1-10000-urls.json b/tools/perf/page_sets/ "http://www.bannersbroker.com/", "http://www.kohls.com/", - "http://www.google.com.do/", -+ "http://www.9oo91e.qjz9zk.do/", ++ "http://www.9oo91e.qjz9zk.do/", "http://www.dealfish.co.th/", "http://19lou.com/", "http://www.okwave.jp/", @@ -18357,7 +18357,7 @@ diff --git a/tools/perf/page_sets/alexa1-10000-urls.json b/tools/perf/page_sets/ "http://sanook.com/", "http://ria.ru/", - "http://google.com.qa/", -+ "http://9oo91e.qjz9zk.qa/", ++ "http://9oo91e.qjz9zk.qa/", "http://jquery.com/", "http://pinshan.com/", "http://onlylady.com/", @@ -18366,7 +18366,7 @@ diff --git a/tools/perf/page_sets/alexa1-10000-urls.json b/tools/perf/page_sets/ "http://www.webalta.ru/", "http://www.usbank.com/", - "http://www.google.com.ly/", -+ "http://www.9oo91e.qjz9zk.ly/", ++ "http://www.9oo91e.qjz9zk.ly/", "http://www.pantip.com/", "http://aftonbladet.se/", "http://scoop.it/", @@ -18375,7 +18375,7 @@ diff --git a/tools/perf/page_sets/alexa1-10000-urls.json b/tools/perf/page_sets/ "http://www.tinypic.com/", "http://www.meilishuo.com/", - "http://googleadservices.com/", -+ "http://9oo91eadservices.qjz9zk/", ++ "http://9oo91eadservices.qjz9zk/", "http://www.boston.com/", "http://www.chron.com/", "http://www.breitbart.com/", @@ -18384,7 +18384,7 @@ diff --git a/tools/perf/page_sets/alexa1-10000-urls.json b/tools/perf/page_sets/ "http://www.allocine.fr/", "http://www.slutload.com/", - "http://www.google.com.gt/", -+ "http://www.9oo91e.qjz9zk.gt/", ++ "http://www.9oo91e.qjz9zk.gt/", "http://www.santabanta.com/", "http://www.stardoll.com/", "http://www.polyvore.com/", @@ -18393,7 +18393,7 @@ diff --git a/tools/perf/page_sets/alexa1-10000-urls.json b/tools/perf/page_sets/ "http://www.kbb.com/", "http://www.seasonvar.ru/", - "http://www.android.com/", -+ "http://www.8n6r01d.qjz9zk/", ++ "http://www.8n6r01d.qjz9zk/", "http://www.egrana.com.br/", "http://www.ettoday.net/", "http://www.webstatsdomain.net/", @@ -18402,7 +18402,7 @@ diff --git a/tools/perf/page_sets/alexa1-10000-urls.json b/tools/perf/page_sets/ "http://www.planetminecraft.com/", "http://www.optimum.net/", - "http://www.google.com.pr/", -+ "http://www.9oo91e.qjz9zk.pr/", ++ "http://www.9oo91e.qjz9zk.pr/", "http://mthai.com/", "http://www.onlinecreditcenter6.com/", "http://www.tharunaya.co.uk/", @@ -18411,7 +18411,7 @@ diff --git a/tools/perf/page_sets/alexa1-10000-urls.json b/tools/perf/page_sets/ "http://www.heise.de/", "http://www.wikispaces.com/", - "http://www.google.com.bo/", -+ "http://www.9oo91e.qjz9zk.bo/", ++ "http://www.9oo91e.qjz9zk.bo/", "http://www.skyscrapercity.com/", "http://www.zaobao.com/", "http://www.pirateproxy.net/", @@ -18420,12 +18420,12 @@ diff --git a/tools/perf/page_sets/alexa1-10000-urls.json b/tools/perf/page_sets/ "http://www.mobileaziende.it/", "http://www.officialsurvey.org/", - "http://googleapis.com/", -+ "http://9oo91eapis.qjz9zk/", ++ "http://9oo91eapis.qjz9zk/", "http://www.mufg.jp/", "http://www.jobsdb.com/", "http://www.yahoo.com.cn/", - "http://www.google.com.sv/", -+ "http://www.9oo91e.qjz9zk.sv/", ++ "http://www.9oo91e.qjz9zk.sv/", "http://www.freejobalert.com/", "http://www.walla.co.il/", "http://www.hollywoodreporter.com/", @@ -18434,7 +18434,7 @@ diff --git a/tools/perf/page_sets/alexa1-10000-urls.json b/tools/perf/page_sets/ "http://www.nownews.com/", "http://www.bc.vc/", - "http://www.google.com.af/", -+ "http://www.9oo91e.qjz9zk.af/", ++ "http://www.9oo91e.qjz9zk.af/", "http://www.ulmart.ru/", "http://www.estadao.com.br/", "http://www.politico.com/", @@ -18443,7 +18443,7 @@ diff --git a/tools/perf/page_sets/alexa1-10000-urls.json b/tools/perf/page_sets/ "http://www.seobuilding.ru/", "http://www.t411.me/", - "http://googlesyndication.com/", -+ "http://9oo91esyndication.qjz9zk/", ++ "http://9oo91esyndication.qjz9zk/", "http://delfi.lt/", "http://www.eqla3.com/", "http://www.ali213.net/", @@ -18452,7 +18452,7 @@ diff --git a/tools/perf/page_sets/alexa1-10000-urls.json b/tools/perf/page_sets/ "http://www.economist.com/", "http://www.zeit.de/", - "http://www.google.com.uy/", -+ "http://www.9oo91e.qjz9zk.uy/", ++ "http://www.9oo91e.qjz9zk.uy/", "http://www.pinoy-ako.info/", "http://www.lazada.co.id/", "http://www.filgoal.com/", @@ -18461,7 +18461,7 @@ diff --git a/tools/perf/page_sets/alexa1-10000-urls.json b/tools/perf/page_sets/ "http://www.hawaaworld.com/", "http://www.freeonlinegames.com/", - "http://www.google.com.lb/", -+ "http://www.9oo91e.qjz9zk.lb/", ++ "http://www.9oo91e.qjz9zk.lb/", "http://www.oricon.co.jp/", "http://www.apple.com.cn/", "http://www.ab-in-den-urlaub.de/", @@ -18470,7 +18470,7 @@ diff --git a/tools/perf/page_sets/alexa1-10000-urls.json b/tools/perf/page_sets/ "http://www.avangate.com/", "http://www.gandul.info/", - "http://www.google.com.gh/", -+ "http://www.9oo91e.qjz9zk.gh/", ++ "http://www.9oo91e.qjz9zk.gh/", "http://www.mybigcommerce.com/", "http://www.homeaway.com/", "http://www.wikitravel.org/", @@ -18479,7 +18479,7 @@ diff --git a/tools/perf/page_sets/alexa1-10000-urls.json b/tools/perf/page_sets/ "http://www.mint.com/", "http://www.gorillavid.in/", - "http://www.google.com.om/", -+ "http://www.9oo91e.qjz9zk.om/", ++ "http://www.9oo91e.qjz9zk.om/", "http://www.blogbigtime.com/", "http://www.books.com.tw/", "http://www.korrespondent.net/", @@ -18488,7 +18488,7 @@ diff --git a/tools/perf/page_sets/alexa1-10000-urls.json b/tools/perf/page_sets/ "http://www.8684.cn/", "http://www.rajasthan.gov.in/", - "http://www.youtube.com/user/PewDiePie/", -+ "http://www.y0u1ub3.qjz9zk/user/PewDiePie/", ++ "http://www.y0u1ub3.qjz9zk/user/PewDiePie/", "http://www.zonealarm.com/", "http://www.locaweb.com.br/", "http://logme.in/", @@ -18497,7 +18497,7 @@ diff --git a/tools/perf/page_sets/alexa1-10000-urls.json b/tools/perf/page_sets/ "http://www.myhabit.com/", "http://www.kinomaniak.tv/", - "http://www.googlecode.com/", -+ "http://www.9oo91ecode.qjz9zk/", ++ "http://www.9oo91ecode.qjz9zk/", "http://www.kddi.com/", "http://www.wyborcza.biz/", "http://www.gtbank.com/", @@ -18506,7 +18506,7 @@ diff --git a/tools/perf/page_sets/alexa1-10000-urls.json b/tools/perf/page_sets/ "http://www.longtailvideo.com/", "http://www.yengo.com/", - "http://www.listentoyoutube.com/", -+ "http://www.listentoy0u1ub3.qjz9zk/", ++ "http://www.listentoy0u1ub3.qjz9zk/", "http://www.dreamhost.com/", "http://www.cari.com.my/", "http://www.sergeymavrodi.com/", @@ -18515,7 +18515,7 @@ diff --git a/tools/perf/page_sets/alexa1-10000-urls.json b/tools/perf/page_sets/ "http://www.seoclerks.com/", "http://www.yootheme.com/", - "http://www.google.com.py/", -+ "http://www.9oo91e.qjz9zk.py/", ++ "http://www.9oo91e.qjz9zk.py/", "http://www.beemp3.com/", "http://www.yepme.com/", "http://www.alef.ir/", @@ -18524,7 +18524,7 @@ diff --git a/tools/perf/page_sets/alexa1-10000-urls.json b/tools/perf/page_sets/ "http://www.28tui.com/", "http://www.shopzilla.com/", - "http://www.google.com.ni/", -+ "http://www.9oo91e.qjz9zk.ni/", ++ "http://www.9oo91e.qjz9zk.ni/", "http://www.lycos.com/", "http://www.gucheng.com/", "http://www.rajanews.com/", @@ -18533,12 +18533,12 @@ diff --git a/tools/perf/page_sets/alexa1-10000-urls.json b/tools/perf/page_sets/ "http://www.redorbit.com/", "http://www.inboxdollars.com/", - "http://www.google.com.bh/", -+ "http://www.9oo91e.qjz9zk.bh/", ++ "http://www.9oo91e.qjz9zk.bh/", "http://www.pcanalysis.net/", "http://www.acer.com/", "http://www.jizzbell.com/", - "http://www.google.com.kh/", -+ "http://www.9oo91e.qjz9zk.kh/", ++ "http://www.9oo91e.qjz9zk.kh/", "http://www.mappy.com/", "http://www.day.az/", "http://www.euronews.com/", @@ -18547,7 +18547,7 @@ diff --git a/tools/perf/page_sets/alexa1-10000-urls.json b/tools/perf/page_sets/ "http://www.filesonar.com/", "http://www.hsbccreditcard.com/", - "http://www.google.com.np/", -+ "http://www.9oo91e.qjz9zk.np/", ++ "http://www.9oo91e.qjz9zk.np/", "http://www.parperfeito.com.br/", "http://www.sciencedaily.com/", "http://www.realgfporn.com/", @@ -18556,7 +18556,7 @@ diff --git a/tools/perf/page_sets/alexa1-10000-urls.json b/tools/perf/page_sets/ "http://www.pornbb.org/", "http://www.formspring.me/", - "http://www.google.com.cy/", -+ "http://www.9oo91e.qjz9zk.cy/", ++ "http://www.9oo91e.qjz9zk.cy/", "http://www.purepeople.com/", "http://www.epnet.com/", "http://www.penny-arcade.com/", @@ -18565,7 +18565,7 @@ diff --git a/tools/perf/page_sets/alexa1-10000-urls.json b/tools/perf/page_sets/ "http://www.gungho.jp/", "http://www.mk.co.kr/", - "http://www.googlegroups.com/", -+ "http://www.9oo91egroups.qjz9zk/", ++ "http://www.9oo91egroups.qjz9zk/", "http://www.animoto.com/", "http://www.alquds.co.uk/", "http://www.newsday.com/", @@ -18574,7 +18574,7 @@ diff --git a/tools/perf/page_sets/alexa1-10000-urls.json b/tools/perf/page_sets/ "http://www.farecompare.com/", "http://www.xinjunshi.com/", - "http://www.youtube.com/user/SkyDoesMinecraft/", -+ "http://www.y0u1ub3.qjz9zk/user/SkyDoesMinecraft/", ++ "http://www.y0u1ub3.qjz9zk/user/SkyDoesMinecraft/", "http://www.vidxden.com/", "http://www.pvrcinemas.com/", "http://chachaba.com/", @@ -18583,7 +18583,7 @@ diff --git a/tools/perf/page_sets/alexa1-10000-urls.json b/tools/perf/page_sets/ "http://www.oszone.net/", "http://www.teamtreehouse.com/", - "http://www.youtube.com/user/BlueXephos/", -+ "http://www.y0u1ub3.qjz9zk/user/BlueXephos/", ++ "http://www.y0u1ub3.qjz9zk/user/BlueXephos/", "http://www.humanservices.gov.au/", "http://www.bostonherald.com/", "http://www.kafeteria.pl/", @@ -18592,7 +18592,7 @@ diff --git a/tools/perf/page_sets/alexa1-10000-urls.json b/tools/perf/page_sets/ "http://www.iafd.com/", "http://www.casertex.com/", - "http://www.gmail.com/", -+ "http://www.9ma1l.qjz9zk/", ++ "http://www.9ma1l.qjz9zk/", "http://www.modhoster.de/", "http://www.post-gazette.com/", "http://www.digikey.com/", @@ -18601,7 +18601,7 @@ diff --git a/tools/perf/page_sets/alexa1-10000-urls.json b/tools/perf/page_sets/ "http://www.ok-porn.com/", "http://www.tutorialzine.com/", - "http://www.google.com.bn/", -+ "http://www.9oo91e.qjz9zk.bn/", ++ "http://www.9oo91e.qjz9zk.bn/", "http://www.site5.com/", "http://www.trafficjunky.net/", "http://www.xueqiu.com/", @@ -18610,7 +18610,7 @@ diff --git a/tools/perf/page_sets/alexa1-10000-urls.json b/tools/perf/page_sets/ "http://leiting001.com/", "http://www.ifttt.com/", - "http://www.google.com.mm/", -+ "http://www.9oo91e.qjz9zk.mm/", ++ "http://www.9oo91e.qjz9zk.mm/", "http://www.gizbot.com/", "http://www.games2win.com/", "http://www.stiforp.com/", @@ -18619,7 +18619,7 @@ diff --git a/tools/perf/page_sets/alexa1-10000-urls.json b/tools/perf/page_sets/ "http://www.newindianexpress.com/", "http://www.washingtonexaminer.com/", - "http://www.mozillazine.org/", -+ "http://www.m0z111azine.qjz9zk/", ++ "http://www.m0z111azine.qjz9zk/", "http://www.mg.co.za/", "http://www.newalbumreleases.net/", "http://www.trombi.com/", @@ -18628,7 +18628,7 @@ diff --git a/tools/perf/page_sets/alexa1-10000-urls.json b/tools/perf/page_sets/ "http://www.tweepi.com/", "http://www.bobfilm.net/", - "http://www.phandroid.com/", -+ "http://www.ph8n6r01d.qjz9zk/", ++ "http://www.ph8n6r01d.qjz9zk/", "http://www.obozrevatel.com/", "http://www.elitedaily.com/", "http://www.tcfexpress.com/", diff --git a/build/patches/Disable-safe-browsing.patch b/build/patches/Disable-safe-browsing.patch index 8162fd4f..90a831ab 100644 --- a/build/patches/Disable-safe-browsing.patch +++ b/build/patches/Disable-safe-browsing.patch @@ -9,7 +9,10 @@ Disable CrowdDeny feature .../res/xml/google_services_preferences.xml | 20 ------ .../java/res/xml/privacy_preferences.xml | 11 --- .../res/xml/sync_and_services_preferences.xml | 20 ------ + .../EnhancedProtectionPromoController.java | 8 --- + .../EnhancedProtectionPromoUtils.java | 3 +- .../privacy/settings/PrivacySettings.java | 55 ++------------ + .../SafeBrowsingSettingsLauncher.java | 9 --- .../sync/settings/GoogleServicesSettings.java | 10 +-- .../settings/SyncAndServicesSettings.java | 9 +-- .../android/chrome_main_delegate_android.cc | 1 + @@ -19,6 +22,7 @@ Disable CrowdDeny feature chrome/browser/browser_process.h | 7 -- chrome/browser/browser_process_impl.cc | 29 -------- chrome/browser/browser_process_impl.h | 4 -- + .../chrome_browsing_data_remover_delegate.cc | 2 + .../browser/chrome_content_browser_client.cc | 28 ++++---- ...ontent_browser_client_receiver_bindings.cc | 2 + .../file_type_policies_component_installer.cc | 16 +---- @@ -41,6 +45,7 @@ Disable CrowdDeny feature ...me_native_file_system_permission_context.h | 3 + ...ial_comparison_cert_verifier_controller.cc | 3 - .../chrome_password_manager_client.cc | 2 + + ...ve_origin_permission_revocation_request.cc | 2 + .../permissions/chrome_permissions_client.cc | 8 --- .../permissions/chrome_permissions_client.h | 3 - ...hrome_browser_main_extra_parts_profiles.cc | 1 - @@ -52,10 +57,11 @@ Disable CrowdDeny feature .../android/safe_browsing_bridge.cc | 51 ------------- .../download_protection_service.cc | 7 -- .../download_protection_service.h | 5 -- + .../url_lookup_service_factory.cc | 4 ++ .../safety_check/SafetyCheckMediator.java | 25 ------- .../ssl/sct_reporting_service_factory.cc | 11 +-- .../browser/ssl/security_state_tab_helper.cc | 2 + - .../chrome_subresource_filter_client.cc | 1 + + .../chrome_subresource_filter_client.cc | 4 ++ chrome/browser/ui/BUILD.gn | 1 - .../strings/android_chrome_strings.grd | 21 ------ chrome/browser/ui/tab_helpers.cc | 8 --- @@ -64,13 +70,14 @@ Disable CrowdDeny feature .../chrome_content_renderer_client.cc | 2 + .../permissions/permission_request_manager.cc | 28 ++++++-- components/safe_browsing/core/features.cc | 2 +- + .../safe_browsing/core/file_type_policies.cc | 3 +- .../content/captive_portal_blocking_page.cc | 7 -- .../content/cert_report_helper.cc | 2 - .../unified_consent_service.cc | 2 +- .../native_file_system_file_writer_impl.cc | 50 +------------ .../native_file_system_file_writer_impl.h | 14 +--- .../native_file_system_permission_context.h | 6 -- - 64 files changed, 180 insertions(+), 660 deletions(-) + 71 files changed, 193 insertions(+), 681 deletions(-) diff --git a/chrome/android/java/res/xml/google_services_preferences.xml b/chrome/android/java/res/xml/google_services_preferences.xml --- a/chrome/android/java/res/xml/google_services_preferences.xml @@ -168,6 +175,44 @@ diff --git a/chrome/android/java/res/xml/sync_and_services_preferences.xml b/chr subresource_filter_ruleset_service_; +diff --git a/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.cc b/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.cc +--- a/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.cc ++++ b/chrome/browser/browsing_data/chrome_browsing_data_remover_delegate.cc +@@ -658,10 +658,12 @@ void ChromeBrowsingDataRemoverDelegate::RemoveEmbedderData( + base::RecordAction(UserMetricsAction("ClearBrowsingData_Cookies")); + + network::mojom::NetworkContext* safe_browsing_context = nullptr; ++#if BUILDFLAG(FULL_SAFE_BROWSING) + safe_browsing::SafeBrowsingService* sb_service = + g_browser_process->safe_browsing_service(); + if (sb_service) + safe_browsing_context = sb_service->GetNetworkContext(profile_); ++#endif + + browsing_data::RemoveEmbedderCookieData( + delete_begin, delete_end, filter_builder, host_content_settings_map_, diff --git a/chrome/browser/chrome_content_browser_client.cc b/chrome/browser/chrome_content_browser_client.cc --- a/chrome/browser/chrome_content_browser_client.cc +++ b/chrome/browser/chrome_content_browser_client.cc @@ -1589,6 +1675,25 @@ diff --git a/chrome/browser/password_manager/chrome_password_manager_client.cc b if (log_manager_->IsLoggingActive()) { password_manager::BrowserSavePasswordProgressLogger logger( +diff --git a/chrome/browser/permissions/abusive_origin_permission_revocation_request.cc b/chrome/browser/permissions/abusive_origin_permission_revocation_request.cc +--- a/chrome/browser/permissions/abusive_origin_permission_revocation_request.cc ++++ b/chrome/browser/permissions/abusive_origin_permission_revocation_request.cc +@@ -122,6 +122,7 @@ void AbusiveOriginPermissionRevocationRequest::CheckAndRevokeIfAbusive() { + return; + } + ++#if BUILDFLAG(FULL_SAFE_BROWSING) + CrowdDenyPreloadData* crowd_deny = CrowdDenyPreloadData::GetInstance(); + permissions::PermissionUmaUtil::RecordCrowdDenyIsLoadedAtAbuseCheckTime( + crowd_deny->is_loaded_from_disk()); +@@ -147,6 +148,7 @@ void AbusiveOriginPermissionRevocationRequest::CheckAndRevokeIfAbusive() { + return; + } + } ++#endif + + std::move(callback_).Run(Outcome::PERMISSION_NOT_REVOKED); + } diff --git a/chrome/browser/permissions/chrome_permissions_client.cc b/chrome/browser/permissions/chrome_permissions_client.cc --- a/chrome/browser/permissions/chrome_permissions_client.cc +++ b/chrome/browser/permissions/chrome_permissions_client.cc @@ -1930,6 +2035,27 @@ diff --git a/chrome/browser/safe_browsing/download_protection/download_protectio SafeBrowsingService* sb_service_; // These pointers may be NULL if SafeBrowsing is disabled. scoped_refptr ui_manager_; +diff --git a/chrome/browser/safe_browsing/url_lookup_service_factory.cc b/chrome/browser/safe_browsing/url_lookup_service_factory.cc +--- a/chrome/browser/safe_browsing/url_lookup_service_factory.cc ++++ b/chrome/browser/safe_browsing/url_lookup_service_factory.cc +@@ -50,6 +50,7 @@ RealTimeUrlLookupServiceFactory::RealTimeUrlLookupServiceFactory() + + KeyedService* RealTimeUrlLookupServiceFactory::BuildServiceInstanceFor( + content::BrowserContext* context) const { ++#if BUILDFLAG(FULL_SAFE_BROWSING) + if (!g_browser_process->safe_browsing_service()) { + return nullptr; + } +@@ -74,6 +75,9 @@ KeyedService* RealTimeUrlLookupServiceFactory::BuildServiceInstanceFor( + GetProfileManagementStatus(browser_policy_connector), + is_under_advanced_protection, profile->IsOffTheRecord(), + g_browser_process->variations_service()); ++#else ++ return nullptr; ++#endif + } + + } // namespace safe_browsing diff --git a/chrome/browser/safety_check/android/java/src/org/chromium/chrome/browser/safety_check/SafetyCheckMediator.java b/chrome/browser/safety_check/android/java/src/org/chromium/chrome/browser/safety_check/SafetyCheckMediator.java --- a/chrome/browser/safety_check/android/java/src/org/chromium/chrome/browser/safety_check/SafetyCheckMediator.java +++ b/chrome/browser/safety_check/android/java/src/org/chromium/chrome/browser/safety_check/SafetyCheckMediator.java @@ -2022,14 +2148,21 @@ diff --git a/chrome/browser/ssl/security_state_tab_helper.cc b/chrome/browser/ss diff --git a/chrome/browser/subresource_filter/chrome_subresource_filter_client.cc b/chrome/browser/subresource_filter/chrome_subresource_filter_client.cc --- a/chrome/browser/subresource_filter/chrome_subresource_filter_client.cc +++ b/chrome/browser/subresource_filter/chrome_subresource_filter_client.cc -@@ -97,6 +97,7 @@ ChromeSubresourceFilterClient::OnPageActivationComputed( - subresource_filter::mojom::ActivationLevel::kEnabled; - *decision = subresource_filter::ActivationDecision::FORCED_ACTIVATION; - } +@@ -167,10 +167,14 @@ void ChromeSubresourceFilterClient::AllowlistByContentSettings( + + const scoped_refptr + ChromeSubresourceFilterClient::GetSafeBrowsingDatabaseManager() { ++#if BUILDFLAG(FULL_SAFE_BROWSING) + safe_browsing::SafeBrowsingService* safe_browsing_service = + g_browser_process->safe_browsing_service(); + return safe_browsing_service ? safe_browsing_service->database_manager() + : nullptr; ++#else ++ return nullptr; +#endif + } - const GURL& url(navigation_handle->GetURL()); - + void ChromeSubresourceFilterClient::ToggleForceActivationInCurrentWebContents( diff --git a/chrome/browser/ui/BUILD.gn b/chrome/browser/ui/BUILD.gn --- a/chrome/browser/ui/BUILD.gn +++ b/chrome/browser/ui/BUILD.gn @@ -2276,6 +2409,19 @@ diff --git a/components/safe_browsing/core/features.cc b/components/safe_browsin const base::Feature kThreatDomDetailsTagAndAttributeFeature{ "ThreatDomDetailsTagAttributes", base::FEATURE_DISABLED_BY_DEFAULT}; +diff --git a/components/safe_browsing/core/file_type_policies.cc b/components/safe_browsing/core/file_type_policies.cc +--- a/components/safe_browsing/core/file_type_policies.cc ++++ b/components/safe_browsing/core/file_type_policies.cc +@@ -49,8 +49,7 @@ FileTypePolicies::~FileTypePolicies() { + } + + std::string FileTypePolicies::ReadResourceBundle() { +- ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance(); +- return bundle.LoadDataResourceString(IDR_DOWNLOAD_FILE_TYPES_PB); ++ return nullptr; + } + + void FileTypePolicies::RecordUpdateMetrics(UpdateResult result, diff --git a/components/security_interstitials/content/captive_portal_blocking_page.cc b/components/security_interstitials/content/captive_portal_blocking_page.cc --- a/components/security_interstitials/content/captive_portal_blocking_page.cc +++ b/components/security_interstitials/content/captive_portal_blocking_page.cc diff --git a/build/patches/Disable-sync-services-menu-entry.patch b/build/patches/Disable-sync-services-menu-entry.patch index 52355404..28667269 100644 --- a/build/patches/Disable-sync-services-menu-entry.patch +++ b/build/patches/Disable-sync-services-menu-entry.patch @@ -3,9 +3,10 @@ Date: Mon, 11 Nov 2019 23:09:48 +0100 Subject: Disable sync services menu entry --- - chrome/android/java/res/xml/main_preferences.xml | 11 ++--------- - chrome/android/java/res/xml/privacy_preferences.xml | 5 ----- - 2 files changed, 2 insertions(+), 14 deletions(-) + .../android/java/res/xml/main_preferences.xml | 11 ++--------- + .../java/res/xml/privacy_preferences.xml | 5 ----- + .../sync/settings/SyncSettingsUtils.java | 17 ----------------- + 3 files changed, 2 insertions(+), 31 deletions(-) diff --git a/chrome/android/java/res/xml/main_preferences.xml b/chrome/android/java/res/xml/main_preferences.xml --- a/chrome/android/java/res/xml/main_preferences.xml @@ -48,6 +49,33 @@ diff --git a/chrome/android/java/res/xml/privacy_preferences.xml b/chrome/androi - app:allowDividerBelow="false" - android:order="7"/> +diff --git a/chrome/android/java/src/org/chromium/chrome/browser/sync/settings/SyncSettingsUtils.java b/chrome/android/java/src/org/chromium/chrome/browser/sync/settings/SyncSettingsUtils.java +--- a/chrome/android/java/src/org/chromium/chrome/browser/sync/settings/SyncSettingsUtils.java ++++ b/chrome/android/java/src/org/chromium/chrome/browser/sync/settings/SyncSettingsUtils.java +@@ -256,23 +256,6 @@ public class SyncSettingsUtils { + } + + boolean syncEnabled = AndroidSyncSettings.get().isSyncEnabled(); +- if (syncEnabled) { +- if (!profileSyncService.isSyncActive()) { +- return res.getString(R.string.sync_setup_progress); +- } +- +- if (profileSyncService.isPassphraseRequiredForPreferredDataTypes()) { +- return res.getString(R.string.sync_need_passphrase); +- } +- +- if (profileSyncService.isTrustedVaultKeyRequiredForPreferredDataTypes()) { +- return profileSyncService.isEncryptEverythingEnabled() +- ? context.getString(R.string.sync_error_card_title) +- : context.getString(R.string.sync_passwords_error_card_title); +- } +- +- return context.getString(R.string.sync_and_services_summary_sync_on); +- } + return context.getString(R.string.sync_is_disabled); + } + -- 2.17.1 diff --git a/build/patches/Flag-for-always-desktop-mode.patch b/build/patches/Flag-for-always-desktop-mode.patch index 9570075e..3ad13a08 100644 --- a/build/patches/Flag-for-always-desktop-mode.patch +++ b/build/patches/Flag-for-always-desktop-mode.patch @@ -46,7 +46,7 @@ diff --git a/chrome/android/chrome_java_sources.gni b/chrome/android/chrome_java diff --git a/chrome/android/java/res/xml/main_preferences.xml b/chrome/android/java/res/xml/main_preferences.xml --- a/chrome/android/java/res/xml/main_preferences.xml +++ b/chrome/android/java/res/xml/main_preferences.xml -@@ -105,6 +105,11 @@ +@@ -112,6 +112,11 @@ android:key="content_settings" android:order="20" android:title="@string/prefs_site_settings"/> @@ -104,9 +104,9 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActiv +import org.chromium.chrome.browser.preferences.ChromePreferenceKeys; +import org.chromium.chrome.browser.preferences.SharedPreferencesManager; - import java.util.ArrayList; - import java.util.List; -@@ -2036,11 +2039,19 @@ public abstract class ChromeActivity + import org.chromium.url.GURL; + +@@ -2038,11 +2041,19 @@ public abstract class ChromeActivity } else if (id == R.id.view_source_id) { currentTab.getWebContents().getNavigationController().loadUrl(new LoadUrlParams("view-source:"+currentTab.getUrlString())); } else if (id == R.id.request_desktop_site_id || id == R.id.request_desktop_site_check_id) { @@ -117,7 +117,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActiv - !usingDesktopUserAgent, reloadOnChange); + SharedPreferencesManager.getInstance().writeBoolean( + ChromePreferenceKeys.USERAGENT_ALWAYS_DESKTOP_MODE, !usingDesktopUserAgent); -+ ++ + final boolean stickyDesktopModeEnabled = SharedPreferencesManager.getInstance().readBoolean( + ChromePreferenceKeys.USERAGENT_STICKY_DESKTOP_MODE, false); + if (stickyDesktopModeEnabled) { diff --git a/build/patches/Move-some-account-settings-back-to-privacy-settings.patch b/build/patches/Move-some-account-settings-back-to-privacy-settings.patch index 7753b440..24241a07 100644 --- a/build/patches/Move-some-account-settings-back-to-privacy-settings.patch +++ b/build/patches/Move-some-account-settings-back-to-privacy-settings.patch @@ -54,7 +54,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/privacy/setting */ @@ -54,6 +61,18 @@ public class PrivacySettings private static final String PREF_PROXY_OPTIONS = "proxy"; - public static final String PREF_INCOGNITO_TAB_HISTORY_ENABLED = "incognito_history_enabled"; + public static final String PREF_INCOGNITO_TAB_HISTORY_ENABLED = "incognito_history_enabled"; + // moved from SyncAndServicesSettings.java + private static final String PREF_SERVICES_CATEGORY = "services_category"; @@ -71,7 +71,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/privacy/setting private static final String[] NEW_PRIVACY_PREFERENCE_ORDER = {PREF_CLEAR_BROWSING_DATA, PREF_CAN_MAKE_PAYMENT, PREF_NETWORK_PREDICTIONS, PREF_SECURE_DNS, PREF_DO_NOT_TRACK, -@@ -61,7 +80,8 @@ public class PrivacySettings +@@ -61,7 +80,8 @@ public static final String PREF_INCOGNITO_TAB_HISTORY_ENABLED = "incognito_histo PREF_INCOGNITO_TAB_HISTORY_ENABLED, PREF_ALLOW_CUSTOM_TAB_INTENTS, PREF_CLOSE_TABS_ON_EXIT, @@ -81,7 +81,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/privacy/setting }; private ManagedPreferenceDelegate mManagedPreferenceDelegate; -@@ -87,6 +107,29 @@ public class PrivacySettings +@@ -87,6 +107,29 @@ public static final String PREF_INCOGNITO_TAB_HISTORY_ENABLED = "incognito_histo mManagedPreferenceDelegate = createManagedPreferenceDelegate(); @@ -111,7 +111,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/privacy/setting ChromeSwitchPreference canMakePaymentPref = (ChromeSwitchPreference) findPreference(PREF_CAN_MAKE_PAYMENT); canMakePaymentPref.setOnPreferenceChangeListener(this); -@@ -119,6 +162,11 @@ public class PrivacySettings +@@ -119,6 +162,11 @@ public static final String PREF_INCOGNITO_TAB_HISTORY_ENABLED = "incognito_histo } else if (PREF_CAN_MAKE_PAYMENT.equals(key)) { UserPrefs.get(Profile.getLastUsedRegularProfile()) .setBoolean(Pref.CAN_MAKE_PAYMENT_ENABLED, (boolean) newValue); @@ -123,7 +123,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/privacy/setting } else if (PREF_NETWORK_PREDICTIONS.equals(key)) { PrivacyPreferencesManager.getInstance().setNetworkPredictionEnabled((boolean) newValue); } else if (PREF_ALLOW_CUSTOM_TAB_INTENTS.equals(key)) { -@@ -133,6 +181,16 @@ public class PrivacySettings +@@ -133,6 +181,16 @@ public static final String PREF_INCOGNITO_TAB_HISTORY_ENABLED = "incognito_histo return true; } @@ -140,7 +140,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/privacy/setting @Override public void onResume() { super.onResume(); -@@ -143,7 +201,7 @@ public class PrivacySettings +@@ -143,7 +201,7 @@ public static final String PREF_INCOGNITO_TAB_HISTORY_ENABLED = "incognito_histo * Updates the summaries for several preferences. */ public void updateSummaries() { diff --git a/build/patches/Remove-blocklisted-URLs-upon-bookmark-creation.patch b/build/patches/Remove-blocklisted-URLs-upon-bookmark-creation.patch index 642cdaa9..a87f6224 100644 --- a/build/patches/Remove-blocklisted-URLs-upon-bookmark-creation.patch +++ b/build/patches/Remove-blocklisted-URLs-upon-bookmark-creation.patch @@ -3,8 +3,8 @@ Date: Fri, 21 Aug 2020 22:39:23 +0200 Subject: Remove blocklisted URLs upon bookmark creation --- - .../chrome/browser/app/ChromeActivity.java | 15 +++++++++++++++ - 1 file changed, 15 insertions(+) + .../chrome/browser/app/ChromeActivity.java | 17 +++++++++++++++++ + 1 file changed, 17 insertions(+) diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java --- a/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java @@ -18,7 +18,16 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActiv import org.chromium.chrome.browser.tab.AccessibilityVisibilityHandler; import org.chromium.chrome.browser.tab.Tab; import org.chromium.chrome.browser.tab.TabDelegateFactory; -@@ -251,6 +253,7 @@ public abstract class ChromeActivity +@@ -207,6 +209,8 @@ import org.chromium.ui.widget.Toast; + import org.chromium.url.Origin; + import org.chromium.webapk.lib.client.WebApkNavigationClient; + ++import org.chromium.url.GURL; ++ + import java.util.ArrayList; + import java.util.List; + import java.util.function.Consumer; +@@ -251,6 +255,7 @@ public abstract class ChromeActivity private UmaSessionStats mUmaSessionStats; private ContextReporter mContextReporter; @@ -26,7 +35,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActiv private boolean mPartnerBrowserRefreshNeeded; -@@ -1230,6 +1233,11 @@ public abstract class ChromeActivity +@@ -1230,6 +1235,11 @@ public abstract class ChromeActivity mCompositorViewHolder = null; } @@ -38,7 +47,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActiv onDestroyInternal(); if (mDidAddPolicyChangeListener) { -@@ -1466,6 +1474,13 @@ public abstract class ChromeActivity +@@ -1466,6 +1476,13 @@ public abstract class ChromeActivity return; } @@ -47,7 +56,7 @@ diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActiv + mMostVisitedSites = + SuggestionsDependencyFactory.getInstance().createMostVisitedSites(Profile.getLastUsedRegularProfile()); + } -+ mMostVisitedSites.removeBlocklistedUrl(tabToBookmark.getOriginalUrl()); ++ mMostVisitedSites.removeBlocklistedUrl(new GURL(tabToBookmark.getOriginalUrl())); + // Note we get user bookmark ID over just a bookmark ID here: Managed bookmarks can't be // edited. If the current URL is only bookmarked by managed bookmarks, this will return diff --git a/build/patches/Remove-google_services_gcm.patch b/build/patches/Remove-google_services_gcm.patch index 8c1435b9..a47937f8 100644 --- a/build/patches/Remove-google_services_gcm.patch +++ b/build/patches/Remove-google_services_gcm.patch @@ -3,9 +3,51 @@ Date: Sun, 3 May 2020 12:15:33 +0200 Subject: Remove google_services_gcm --- - third_party/android_deps/BUILD.gn | 18 ------------------ - 1 file changed, 18 deletions(-) + .../browser/language/AppLocaleUtils.java | 19 ------------------- + third_party/android_deps/BUILD.gn | 18 ------------------ + 2 files changed, 37 deletions(-) +diff --git a/chrome/android/java/src/org/chromium/chrome/browser/language/AppLocaleUtils.java b/chrome/android/java/src/org/chromium/chrome/browser/language/AppLocaleUtils.java +--- a/chrome/android/java/src/org/chromium/chrome/browser/language/AppLocaleUtils.java ++++ b/chrome/android/java/src/org/chromium/chrome/browser/language/AppLocaleUtils.java +@@ -8,11 +8,6 @@ import android.content.Context; + import android.preference.PreferenceManager; + import android.text.TextUtils; + +-import com.google.android.play.core.splitcompat.SplitCompat; +-import com.google.android.play.core.splitinstall.SplitInstallManager; +-import com.google.android.play.core.splitinstall.SplitInstallManagerFactory; +-import com.google.android.play.core.splitinstall.SplitInstallRequest; +- + import org.chromium.base.BundleUtils; + import org.chromium.base.ContextUtils; + import org.chromium.chrome.browser.preferences.ChromePreferenceKeys; +@@ -75,25 +70,11 @@ public class AppLocaleUtils { + * @param context Activity context to enable downloaded language splits on. + */ + public static void maybeInstallActivitySplitCompat(Context context) { +- if (GlobalAppLocaleController.getInstance().isOverridden() && BundleUtils.isBundle()) { +- SplitCompat.installActivity(context); +- } + } + + /** + * For bundle builds ensure that the language split for languageName is download. + */ + private static void ensureLaguageSplitInstalled(String languageName) { +- SplitInstallManager splitInstallManager = +- SplitInstallManagerFactory.create(ContextUtils.getApplicationContext()); +- +- // TODO(perrier): check if languageName is already installed. https://crbug.com/1103806 +- if (languageName != null) { +- SplitInstallRequest installRequest = +- SplitInstallRequest.newBuilder() +- .addLanguage(Locale.forLanguageTag(languageName)) +- .build(); +- splitInstallManager.startInstall(installRequest); +- } + } + } diff --git a/third_party/android_deps/BUILD.gn b/third_party/android_deps/BUILD.gn --- a/third_party/android_deps/BUILD.gn +++ b/third_party/android_deps/BUILD.gn diff --git a/build/patches/Revert-the-removal-of-an-option-to-block-autoplay.patch b/build/patches/Revert-the-removal-of-an-option-to-block-autoplay.patch index a7412776..5c77b4ab 100644 --- a/build/patches/Revert-the-removal-of-an-option-to-block-autoplay.patch +++ b/build/patches/Revert-the-removal-of-an-option-to-block-autoplay.patch @@ -13,11 +13,11 @@ Subject: Revert the removal of an option to block autoplay .../res/xml/site_settings_preferences.xml | 4 ++++ .../ContentSettingsResources.java | 5 ++++ .../site_settings/SingleCategorySettings.java | 4 ++++ - .../site_settings/SingleWebsiteSettings.java | 21 +++++++++++++++++ + .../site_settings/SingleWebsiteSettings.java | 22 ++++++++++++++++++ .../site_settings/SiteSettingsCategory.java | 9 +++++-- .../browser_ui/site_settings/Website.java | 8 +++++++ .../WebsitePermissionsFetcher.java | 1 + - .../WebsitePreferenceBridge.java | 12 ++++++++++ + .../WebsitePreferenceBridge.java | 14 +++++++++++ .../android/website_preference_bridge.cc | 22 ++++++++++++++++++ .../strings/android/site_settings.grdp | 9 +++++++ .../core/browser/content_settings_registry.cc | 2 +- @@ -36,7 +36,7 @@ Subject: Revert the removal of an option to block autoplay .../platform/web_content_settings_client.h | 3 +++ .../core/html/media/autoplay_policy.cc | 12 +++++++++- .../core/html/media/autoplay_policy.h | 4 ++++ - 33 files changed, 153 insertions(+), 4 deletions(-) + 33 files changed, 156 insertions(+), 4 deletions(-) create mode 100644 components/browser_ui/site_settings/android/java/res/drawable-hdpi/settings_autoplay.png create mode 100644 components/browser_ui/site_settings/android/java/res/drawable-mdpi/settings_autoplay.png create mode 100644 components/browser_ui/site_settings/android/java/res/drawable-xhdpi/settings_autoplay.png @@ -46,7 +46,7 @@ Subject: Revert the removal of an option to block autoplay diff --git a/components/browser_ui/site_settings/android/BUILD.gn b/components/browser_ui/site_settings/android/BUILD.gn --- a/components/browser_ui/site_settings/android/BUILD.gn +++ b/components/browser_ui/site_settings/android/BUILD.gn -@@ -189,6 +189,11 @@ android_resources("java_resources") { +@@ -190,6 +190,11 @@ android_resources("java_resources") { "java/res/drawable-xxxhdpi/settings_storage.png", "java/res/drawable-xxxhdpi/settings_usb.png", "java/res/drawable-xxxhdpi/web_asset.png", @@ -169,7 +169,7 @@ HcmV?d00001 diff --git a/components/browser_ui/site_settings/android/java/res/xml/single_website_preferences.xml b/components/browser_ui/site_settings/android/java/res/xml/single_website_preferences.xml --- a/components/browser_ui/site_settings/android/java/res/xml/single_website_preferences.xml +++ b/components/browser_ui/site_settings/android/java/res/xml/single_website_preferences.xml -@@ -69,6 +69,8 @@ +@@ -71,6 +71,8 @@ android:key="automatic_downloads_permission_list" /> @@ -181,7 +181,7 @@ diff --git a/components/browser_ui/site_settings/android/java/res/xml/single_web diff --git a/components/browser_ui/site_settings/android/java/res/xml/site_settings_preferences.xml b/components/browser_ui/site_settings/android/java/res/xml/site_settings_preferences.xml --- a/components/browser_ui/site_settings/android/java/res/xml/site_settings_preferences.xml +++ b/components/browser_ui/site_settings/android/java/res/xml/site_settings_preferences.xml -@@ -61,6 +61,10 @@ +@@ -65,6 +65,10 @@ @@ -210,7 +210,7 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c 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 --- 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 -@@ -513,6 +513,8 @@ public class SingleCategorySettings extends SiteSettingsPreferenceFragment +@@ -533,6 +533,8 @@ public class SingleCategorySettings extends SiteSettingsPreferenceFragment int resource = 0; if (mCategory.showSites(SiteSettingsCategory.Type.AUTOMATIC_DOWNLOADS)) { resource = R.string.website_settings_add_site_description_automatic_downloads; @@ -219,7 +219,7 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c } else if (mCategory.showSites(SiteSettingsCategory.Type.BACKGROUND_SYNC)) { resource = R.string.website_settings_add_site_description_background_sync; } else if (mCategory.showSites(SiteSettingsCategory.Type.JAVASCRIPT)) { -@@ -621,6 +623,8 @@ public class SingleCategorySettings extends SiteSettingsPreferenceFragment +@@ -650,6 +652,8 @@ public class SingleCategorySettings extends SiteSettingsPreferenceFragment boolean exception = false; if (mCategory.showSites(SiteSettingsCategory.Type.SOUND)) { exception = true; @@ -240,7 +240,7 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c case ContentSettingsType.IDLE_DETECTION: return "idle_detection_permission_list"; case ContentSettingsType.JAVASCRIPT: -@@ -415,6 +417,8 @@ public class SingleWebsiteSettings extends SiteSettingsPreferenceFragment +@@ -417,6 +419,8 @@ public class SingleWebsiteSettings extends SiteSettingsPreferenceFragment setUpSoundPreference(preference); } else if (type == ContentSettingsType.JAVASCRIPT) { setUpJavascriptPreference(preference); @@ -249,14 +249,15 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c } else if (type == ContentSettingsType.COOKIES) { setUpCookiePreference(preference); } else if (type == ContentSettingsType.GEOLOCATION) { -@@ -872,6 +876,23 @@ public class SingleWebsiteSettings extends SiteSettingsPreferenceFragment +@@ -892,6 +896,24 @@ public class SingleWebsiteSettings extends SiteSettingsPreferenceFragment } } + private void setUpAutoplayPreference(Preference preference) { + @ContentSettingValues + @Nullable -+ Integer currentValue = mSite.getContentSettingPermission(ContentSettingsType.AUTOPLAY); ++ Integer currentValue = mSite.getContentSetting( ++ getSiteSettingsClient().getBrowserContextHandle(), ContentSettingsType.AUTOPLAY); + // In order to always show the autoplay permission, set it up with the default value if it + // doesn't have a current value. + if (currentValue == null) { @@ -280,25 +281,25 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c Type.CLIPBOARD, Type.COOKIES, Type.IDLE_DETECTION, Type.DEVICE_LOCATION, Type.JAVASCRIPT, Type.MICROPHONE, Type.NFC, Type.NOTIFICATIONS, Type.POPUPS, Type.PROTECTED_MEDIA, Type.SENSORS, Type.SOUND, Type.USB, Type.VIRTUAL_REALITY, -- Type.USE_STORAGE}) -+ Type.USE_STORAGE, Type.AUTOPLAY}) +- Type.USE_STORAGE, Type.TIMEZONE_OVERRIDE}) ++ Type.USE_STORAGE, Type.TIMEZONE_OVERRIDE, Type.AUTOPLAY}) @Retention(RetentionPolicy.SOURCE) public @interface Type { // All updates here must also be reflected in {@link #preferenceKey(int) -@@ -71,10 +71,11 @@ public class SiteSettingsCategory { - int BLUETOOTH = 20; +@@ -72,10 +72,11 @@ public class SiteSettingsCategory { int VIRTUAL_REALITY = 21; int USE_STORAGE = 22; -+ int AUTOPLAY = 23; + int TIMEZONE_OVERRIDE = 23; ++ int AUTOPLAY = 24; /** * Number of handled categories used for calculating array sizes. */ -- int NUM_ENTRIES = 23; -+ int NUM_ENTRIES = 24; +- int NUM_ENTRIES = 24; ++ int NUM_ENTRIES = 25; } private final BrowserContextHandle mBrowserContextHandle; -@@ -180,6 +181,8 @@ public class SiteSettingsCategory { +@@ -181,6 +182,8 @@ public class SiteSettingsCategory { return ContentSettingsType.NFC; case Type.NOTIFICATIONS: return ContentSettingsType.NOTIFICATIONS; @@ -307,7 +308,7 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c case Type.POPUPS: return ContentSettingsType.POPUPS; case Type.PROTECTED_MEDIA: -@@ -251,6 +254,8 @@ public class SiteSettingsCategory { +@@ -254,6 +257,8 @@ public class SiteSettingsCategory { return "nfc"; case Type.NOTIFICATIONS: return "notifications"; @@ -348,16 +349,17 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/WebsitePreferenceBridge.java b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/WebsitePreferenceBridge.java --- a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/WebsitePreferenceBridge.java +++ b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/WebsitePreferenceBridge.java -@@ -62,6 +62,8 @@ public class WebsitePreferenceBridge { +@@ -62,6 +62,9 @@ public class WebsitePreferenceBridge { WebsitePreferenceBridgeJni.get().getNfcOrigins(browserContextHandle, list); } else if (type == ContentSettingsType.NOTIFICATIONS) { WebsitePreferenceBridgeJni.get().getNotificationOrigins(browserContextHandle, list); + } else if (type == ContentSettingsType.AUTOPLAY) { -+ WebsitePreferenceBridgeJni.get().getAutoplayOrigins(browserContextHandle, list); ++ WebsitePreferenceBridgeJni.get().getAutoplayOrigins( ++ browserContextHandle, list, false); } else if (type == ContentSettingsType.PROTECTED_MEDIA_IDENTIFIER) { WebsitePreferenceBridgeJni.get().getProtectedMediaIdentifierOrigins( browserContextHandle, list); -@@ -101,6 +103,13 @@ public class WebsitePreferenceBridge { +@@ -101,6 +104,13 @@ public class WebsitePreferenceBridge { ContentSettingsType.MEDIASTREAM_CAMERA, list, origin, embedder, isEmbargoed); } @@ -371,15 +373,16 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c @CalledByNative private static void insertClipboardInfoIntoList( ArrayList list, String origin, String embedder, boolean isEmbargoed) { -@@ -437,6 +446,7 @@ public class WebsitePreferenceBridge { +@@ -447,6 +457,8 @@ public class WebsitePreferenceBridge { BrowserContextHandle browserContextHandle, Object list, boolean managedOnly); void getMidiOrigins(BrowserContextHandle browserContextHandle, Object list); void getNotificationOrigins(BrowserContextHandle browserContextHandle, Object list); -+ void getAutoplayOrigins(BrowserContextHandle browserContextHandle, Object list); ++ void getAutoplayOrigins( ++ BrowserContextHandle browserContextHandle, Object list, boolean managedOnly); void getNfcOrigins(BrowserContextHandle browserContextHandle, Object list); void getProtectedMediaIdentifierOrigins( BrowserContextHandle browserContextHandle, Object list); -@@ -485,6 +495,8 @@ public class WebsitePreferenceBridge { +@@ -495,6 +507,8 @@ public class WebsitePreferenceBridge { String embedder, int value); void setNotificationSettingForOrigin( BrowserContextHandle browserContextHandle, String origin, int value); @@ -469,18 +472,18 @@ diff --git a/components/content_settings/core/browser/content_settings_utils.cc + ResourceIdentifier(), &(rules->autoplay_rules)); map->GetSettingsForOneType(ContentSettingsType::POPUPS, ResourceIdentifier(), &(rules->popup_redirect_rules)); - } + diff --git a/components/content_settings/core/common/content_settings.cc b/components/content_settings/core/common/content_settings.cc --- a/components/content_settings/core/common/content_settings.cc +++ b/components/content_settings/core/common/content_settings.cc -@@ -177,6 +177,7 @@ bool RendererContentSettingRules::IsRendererContentSetting( +@@ -178,6 +178,7 @@ bool RendererContentSettingRules::IsRendererContentSetting( ContentSettingsType content_type) { return content_type == ContentSettingsType::IMAGES || content_type == ContentSettingsType::JAVASCRIPT || + content_type == ContentSettingsType::AUTOPLAY || content_type == ContentSettingsType::CLIENT_HINTS || content_type == ContentSettingsType::POPUPS || - content_type == ContentSettingsType::MIXEDSCRIPT; + content_type == ContentSettingsType::MIXEDSCRIPT || diff --git a/components/content_settings/core/common/content_settings.h b/components/content_settings/core/common/content_settings.h --- a/components/content_settings/core/common/content_settings.h +++ b/components/content_settings/core/common/content_settings.h @@ -491,7 +494,7 @@ diff --git a/components/content_settings/core/common/content_settings.h b/compon + ContentSettingsForOneType autoplay_rules; ContentSettingsForOneType popup_redirect_rules; ContentSettingsForOneType mixed_content_rules; - }; + ContentSettingsForOneType timezone_override_rules; diff --git a/components/content_settings/core/common/content_settings.mojom b/components/content_settings/core/common/content_settings.mojom --- a/components/content_settings/core/common/content_settings.mojom +++ b/components/content_settings/core/common/content_settings.mojom @@ -502,7 +505,7 @@ diff --git a/components/content_settings/core/common/content_settings.mojom b/co + array autoplay_rules; array popup_redirect_rules; array mixed_content_rules; - }; + array timezone_override_rules; diff --git a/components/content_settings/core/common/content_settings_mojom_traits.cc b/components/content_settings/core/common/content_settings_mojom_traits.cc --- a/components/content_settings/core/common/content_settings_mojom_traits.cc +++ b/components/content_settings/core/common/content_settings_mojom_traits.cc @@ -512,8 +515,8 @@ diff --git a/components/content_settings/core/common/content_settings_mojom_trai data.ReadScriptRules(&out->script_rules) && + data.ReadAutoplayRules(&out->autoplay_rules) && data.ReadPopupRedirectRules(&out->popup_redirect_rules) && - data.ReadMixedContentRules(&out->mixed_content_rules); - } + data.ReadMixedContentRules(&out->mixed_content_rules) && + data.ReadTimezoneOverrideRules(&out->timezone_override_rules) && diff --git a/components/content_settings/core/common/content_settings_mojom_traits.h b/components/content_settings/core/common/content_settings_mojom_traits.h --- a/components/content_settings/core/common/content_settings_mojom_traits.h +++ b/components/content_settings/core/common/content_settings_mojom_traits.h @@ -532,7 +535,7 @@ diff --git a/components/content_settings/core/common/content_settings_mojom_trai diff --git a/components/content_settings/renderer/content_settings_agent_impl.cc b/components/content_settings/renderer/content_settings_agent_impl.cc --- a/components/content_settings/renderer/content_settings_agent_impl.cc +++ b/components/content_settings/renderer/content_settings_agent_impl.cc -@@ -429,6 +429,17 @@ bool ContentSettingsAgentImpl::AllowRunningInsecureContent( +@@ -440,6 +440,17 @@ bool ContentSettingsAgentImpl::AllowRunningInsecureContent( return false; } diff --git a/build/patches/Show-site-settings-for-cookies.patch b/build/patches/Show-site-settings-for-cookies.patch index 75843755..4665144a 100644 --- a/build/patches/Show-site-settings-for-cookies.patch +++ b/build/patches/Show-site-settings-for-cookies.patch @@ -4,9 +4,9 @@ Subject: Show site settings for cookies Avoid displaying info about intrusive ads --- - .../site_settings/SingleWebsiteSettings.java | 59 +++++++++---------- - .../browser_ui/site_settings/Website.java | 14 +++-- - 2 files changed, 37 insertions(+), 36 deletions(-) + .../site_settings/SingleWebsiteSettings.java | 47 +++++++++++-------- + .../browser_ui/site_settings/Website.java | 14 ++++-- + 2 files changed, 37 insertions(+), 24 deletions(-) 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 --- a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SingleWebsiteSettings.java @@ -58,8 +58,7 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c + ContentSettingsType.JAVASCRIPT) + ? ContentSettingValues.ALLOW + : ContentSettingValues.BLOCK; - } -- // Not possible to embargo JAVASCRIPT. ++ } + setUpListPreference(preference, currentValue, false); + } + @@ -67,7 +66,7 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c + @ContentSettingValues + @Nullable + Integer currentValue = -+ mSite.getContentSettingPermission(ContentSettingsType.COOKIES); ++ mSite.getContentSetting(getSiteSettingsClient().getBrowserContextHandle(), ContentSettingsType.COOKIES); + // Always show the cookies permission + if (currentValue == null) { + currentValue = WebsitePreferenceBridge.isCategoryEnabled( @@ -75,34 +74,12 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c + ContentSettingsType.COOKIES) + ? ContentSettingValues.ALLOW + : ContentSettingValues.BLOCK; -+ } + } +- // Not possible to embargo JAVASCRIPT. + // Not possible to embargo COOKIES. setUpListPreference(preference, currentValue, false /* isEmbargoed */); } -@@ -932,22 +941,10 @@ public class SingleWebsiteSettings extends SiteSettingsPreferenceFragment - setUpListPreference(preference, null, false); - return; - } -- // If the ad blocker is activated, then this site will have ads blocked unless there is an -- // explicit permission disallowing the blocking. -- boolean activated = WebsitePreferenceBridge.getAdBlockingActivated( -- browserContextHandle, mSite.getAddress().getOrigin()); - @ContentSettingValues - @Nullable - Integer permission = mSite.getContentSetting(browserContextHandle, ContentSettingsType.ADS); - -- // If |permission| is null, there is no explicit (non-default) permission set for this site. -- // If the site is not considered a candidate for blocking, do the standard thing and remove -- // the preference. -- if (permission == null && !activated) { -- setUpListPreference(preference, null, false); -- return; -- } -- - // However, if the blocking is activated, we still want to show the permission, even if it - // is in the default state. - if (permission == null) { diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/Website.java b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/Website.java --- a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/Website.java +++ b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/Website.java diff --git a/build/patches/Timezone-customization.patch b/build/patches/Timezone-customization.patch new file mode 100644 index 00000000..97f0a5f6 --- /dev/null +++ b/build/patches/Timezone-customization.patch @@ -0,0 +1,1359 @@ +From: uazo +Date: Wed, 30 Sep 2020 07:40:01 +0000 +Subject: Timezone customization + +Allow specifying a custom timezone, or using a random one. + +See also: https://github.com/bromite/bromite/wiki/TimezoneOverride +--- + .../ChromeSiteSettingsHelpClient.java | 18 ++ + .../browser_ui/site_settings/android/BUILD.gn | 3 + + .../res/layout/time_zone_select_dialog.xml | 36 ++++ + ...ezoneoverride_site_settings_preference.xml | 68 ++++++ + .../res/xml/single_website_preferences.xml | 2 + + .../res/xml/site_settings_preferences.xml | 4 + + .../java/res/xml/website_preferences.xml | 9 + + .../ContentSettingsResources.java | 29 +++ + .../site_settings/SingleCategorySettings.java | 72 ++++++- + .../site_settings/SingleWebsiteSettings.java | 20 ++ + .../site_settings/SiteSettings.java | 2 +- + .../site_settings/SiteSettingsCategory.java | 9 +- + .../site_settings/SiteSettingsHelpClient.java | 7 + + ...imezoneOverrideSiteSettingsPreference.java | 193 ++++++++++++++++++ + .../browser_ui/site_settings/Website.java | 10 + + .../WebsitePermissionsFetcher.java | 3 + + .../WebsitePreferenceBridge.java | 12 ++ + .../android/website_preference_bridge.cc | 15 ++ + .../strings/android/site_settings.grdp | 35 ++++ + .../browser/content_settings_pref_provider.cc | 16 ++ + .../browser/content_settings_pref_provider.h | 5 + + .../core/browser/content_settings_registry.cc | 12 ++ + .../core/browser/content_settings_utils.cc | 7 + + .../core/browser/host_content_settings_map.cc | 8 + + .../core/browser/host_content_settings_map.h | 3 + + .../core/common/content_settings.cc | 4 +- + .../core/common/content_settings.h | 2 + + .../core/common/content_settings.mojom | 2 + + .../common/content_settings_mojom_traits.cc | 4 +- + .../common/content_settings_mojom_traits.h | 10 + + .../core/common/content_settings_types.h | 3 + + .../core/common/pref_names.cc | 3 + + .../content_settings/core/common/pref_names.h | 2 + + .../renderer/content_settings_agent_impl.cc | 88 ++++++++ + .../renderer/content_settings_agent_impl.h | 4 + + .../WebLayerSiteSettingsClient.java | 3 + + 36 files changed, 713 insertions(+), 10 deletions(-) + create mode 100755 components/browser_ui/site_settings/android/java/res/layout/time_zone_select_dialog.xml + create mode 100755 components/browser_ui/site_settings/android/java/res/layout/timezoneoverride_site_settings_preference.xml + create mode 100755 components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/TimezoneOverrideSiteSettingsPreference.java + +diff --git a/chrome/android/java/src/org/chromium/chrome/browser/site_settings/ChromeSiteSettingsHelpClient.java b/chrome/android/java/src/org/chromium/chrome/browser/site_settings/ChromeSiteSettingsHelpClient.java +--- a/chrome/android/java/src/org/chromium/chrome/browser/site_settings/ChromeSiteSettingsHelpClient.java ++++ b/chrome/android/java/src/org/chromium/chrome/browser/site_settings/ChromeSiteSettingsHelpClient.java +@@ -11,6 +11,12 @@ import org.chromium.chrome.browser.feedback.HelpAndFeedbackLauncherImpl; + import org.chromium.chrome.browser.profiles.Profile; + import org.chromium.components.browser_ui.site_settings.SiteSettingsHelpClient; + ++import android.app.Activity; ++import android.content.Context; ++import android.content.Intent; ++import android.net.Uri; ++import android.provider.Browser; ++ + /** + * A SiteSettingsHelpClient instance that provides Chrome-specific help functionality. + */ +@@ -33,4 +39,16 @@ public class ChromeSiteSettingsHelpClient implements SiteSettingsHelpClient { + currentActivity.getString(R.string.help_context_protected_content), + Profile.getLastUsedRegularProfile(), null); + } ++ ++ // open wiki page for documentation about the timezone override feature ++ @Override ++ public void launchTimeZoneOverrideHelpAndFeedbackActivity(Activity currentActivity) { ++ Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("https://github.com/bromite/bromite/wiki/TimezoneOverride")); ++ // Let Chromium know that this intent is from Chromium, so that it does not close the app when ++ // the user presses 'back' button. ++ intent.putExtra(Browser.EXTRA_APPLICATION_ID, currentActivity.getPackageName()); ++ intent.putExtra(Browser.EXTRA_CREATE_NEW_TAB, true); ++ intent.setPackage(currentActivity.getPackageName()); ++ currentActivity.startActivity(intent); ++ } + } +diff --git a/components/browser_ui/site_settings/android/BUILD.gn b/components/browser_ui/site_settings/android/BUILD.gn +--- a/components/browser_ui/site_settings/android/BUILD.gn ++++ b/components/browser_ui/site_settings/android/BUILD.gn +@@ -74,6 +74,7 @@ android_library("java") { + "java/src/org/chromium/components/browser_ui/site_settings/WebsitePermissionsFetcher.java", + "java/src/org/chromium/components/browser_ui/site_settings/WebsitePreference.java", + "java/src/org/chromium/components/browser_ui/site_settings/WebsitePreferenceBridge.java", ++ "java/src/org/chromium/components/browser_ui/site_settings/TimezoneOverrideSiteSettingsPreference.java" + ] + annotation_processor_deps = [ "//base/android/jni_generator:jni_processor" ] + resources_package = "org.chromium.components.browser_ui.site_settings" +@@ -204,6 +205,8 @@ android_resources("java_resources") { + "java/res/xml/single_website_preferences.xml", + "java/res/xml/site_settings_preferences.xml", + "java/res/xml/website_preferences.xml", ++ "java/res/layout/timezoneoverride_site_settings_preference.xml", ++ "java/res/layout/time_zone_select_dialog.xml", + ] + + deps = [ +diff --git a/components/browser_ui/site_settings/android/java/res/layout/time_zone_select_dialog.xml b/components/browser_ui/site_settings/android/java/res/layout/time_zone_select_dialog.xml +new file mode 100755 +--- /dev/null ++++ b/components/browser_ui/site_settings/android/java/res/layout/time_zone_select_dialog.xml +@@ -0,0 +1,36 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +\ No newline at end of file +diff --git a/components/browser_ui/site_settings/android/java/res/layout/timezoneoverride_site_settings_preference.xml b/components/browser_ui/site_settings/android/java/res/layout/timezoneoverride_site_settings_preference.xml +new file mode 100755 +--- /dev/null ++++ b/components/browser_ui/site_settings/android/java/res/layout/timezoneoverride_site_settings_preference.xml +@@ -0,0 +1,68 @@ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ ++ +diff --git a/components/browser_ui/site_settings/android/java/res/xml/single_website_preferences.xml b/components/browser_ui/site_settings/android/java/res/xml/single_website_preferences.xml +--- a/components/browser_ui/site_settings/android/java/res/xml/single_website_preferences.xml ++++ b/components/browser_ui/site_settings/android/java/res/xml/single_website_preferences.xml +@@ -59,6 +59,8 @@ + android:key="push_notifications_list" /> + ++ + + ++ ++ + + + ++ ++ ++ ++ + + + ++ ++ + + + 0; + return getString(resource); +@@ -576,6 +598,13 @@ public class SingleCategorySettings extends SiteSettingsPreferenceFragment + if (mCategory.showSites(SiteSettingsCategory.Type.COOKIES) && mRequiresFourStateSetting) { + setting = cookieSettingsExceptionShouldBlock() ? ContentSettingValues.BLOCK + : ContentSettingValues.ALLOW; ++ } else if (mRequiresTriStateSetting) { ++ setting = WebsitePreferenceBridge.getContentSetting(browserContextHandle, mCategory.getContentSettingsType()); ++ if (setting == ContentSettingValues.ALLOW) { ++ setting = ContentSettingValues.BLOCK; ++ } else { ++ setting = ContentSettingValues.ALLOW; ++ } + } else { + setting = (WebsitePreferenceBridge.isCategoryEnabled( + browserContextHandle, mCategory.getContentSettingsType())) +@@ -633,6 +662,8 @@ public class SingleCategorySettings extends SiteSettingsPreferenceFragment + && !WebsitePreferenceBridge.isCategoryEnabled( + browserContextHandle, ContentSettingsType.AUTOMATIC_DOWNLOADS)) { + exception = true; ++ } else if (mCategory.showSites(SiteSettingsCategory.Type.TIMEZONE_OVERRIDE)) { ++ exception = true; + } + if (exception) { + getPreferenceScreen().addPreference(new AddExceptionPreference(getStyledContext(), +@@ -806,7 +837,14 @@ public class SingleCategorySettings extends SiteSettingsPreferenceFragment + TriStateSiteSettingsPreference triStateToggle = + (TriStateSiteSettingsPreference) getPreferenceScreen().findPreference( + TRI_STATE_TOGGLE_KEY); +- return (triStateToggle.getCheckedSetting() == ContentSettingValues.BLOCK); ++ if (triStateToggle != null) ++ return (triStateToggle.getCheckedSetting() == ContentSettingValues.BLOCK); ++ ++ TimezoneOverrideSiteSettingsPreference timeOverrideStatePreference = ++ (TimezoneOverrideSiteSettingsPreference) getPreferenceScreen().findPreference( ++ TIMEOVERRIDE_STATE_TOGGLE_KEY); ++ if (timeOverrideStatePreference != null) ++ return (timeOverrideStatePreference.getCheckedSetting() != ContentSettingValues.ALLOW); + } else if (mRequiresFourStateSetting) { + FourStateCookieSettingsPreference fourStateCookieToggle = + (FourStateCookieSettingsPreference) getPreferenceScreen().findPreference( +@@ -835,6 +873,9 @@ public class SingleCategorySettings extends SiteSettingsPreferenceFragment + (FourStateCookieSettingsPreference) screen.findPreference( + FOUR_STATE_COOKIE_TOGGLE_KEY); + // TODO(crbug.com/1104836): Remove the old third-party cookie blocking UI ++ TimezoneOverrideSiteSettingsPreference timeOverrideStatePreference = ++ (TimezoneOverrideSiteSettingsPreference) screen.findPreference( ++ TIMEOVERRIDE_STATE_TOGGLE_KEY); + Preference notificationsVibrate = screen.findPreference(NOTIFICATIONS_VIBRATE_TOGGLE_KEY); + Preference notificationsQuietUi = screen.findPreference(NOTIFICATIONS_QUIET_UI_TOGGLE_KEY); + Preference explainProtectedMediaKey = screen.findPreference(EXPLAIN_PROTECTED_MEDIA_KEY); +@@ -846,20 +887,32 @@ public class SingleCategorySettings extends SiteSettingsPreferenceFragment + if (mRequiresTriStateSetting) { + screen.removePreference(binaryToggle); + screen.removePreference(fourStateCookieToggle); +- configureTriStateToggle(triStateToggle, contentType); ++ if (mCategory.showSites(SiteSettingsCategory.Type.TIMEZONE_OVERRIDE)) { ++ screen.removePreference(triStateToggle); ++ configureTimeOverrideStateToggle(timeOverrideStatePreference); ++ } ++ else { ++ screen.removePreference(timeOverrideStatePreference); ++ configureTriStateToggle(triStateToggle, contentType); ++ } + } else if (mRequiresFourStateSetting) { + screen.removePreference(binaryToggle); + screen.removePreference(triStateToggle); ++ screen.removePreference(timeOverrideStatePreference); + configureFourStateCookieToggle(fourStateCookieToggle); + } else { + screen.removePreference(triStateToggle); + screen.removePreference(fourStateCookieToggle); ++ screen.removePreference(timeOverrideStatePreference); + configureBinaryToggle(binaryToggle, contentType); + } + + if (!mCategory.showSites(SiteSettingsCategory.Type.COOKIES)) { + screen.removePreference(screen.findPreference(COOKIE_INFO_TEXT_KEY)); + } ++ if (!(mCategory.showSites(SiteSettingsCategory.Type.TIMEZONE_OVERRIDE))) { ++ screen.removePreference(screen.findPreference(TIMEOVERRIDE_INFO_TEXT)); ++ } + + if (permissionBlockedByOs) { + maybeShowOsWarning(screen); +@@ -974,6 +1027,15 @@ public class SingleCategorySettings extends SiteSettingsPreferenceFragment + triStateToggle.initialize(setting, descriptionIds); + } + ++ private void configureTimeOverrideStateToggle( ++ TimezoneOverrideSiteSettingsPreference timeOverrideStateToggle) { ++ timeOverrideStateToggle.setOnPreferenceChangeListener(this); ++ @ContentSettingValues ++ int setting = WebsitePreferenceBridge.getContentSetting( ++ getSiteSettingsClient().getBrowserContextHandle(), ContentSettingsType.TIMEZONE_OVERRIDE); ++ timeOverrideStateToggle.initialize(setting, getSiteSettingsClient().getBrowserContextHandle()); ++ } ++ + private void configureBinaryToggle(ChromeSwitchPreference binaryToggle, int contentType) { + binaryToggle.setOnPreferenceChangeListener(this); + binaryToggle.setTitle(ContentSettingsResources.getTitle(contentType)); +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 +--- 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 +@@ -108,6 +108,8 @@ public class SingleWebsiteSettings extends SiteSettingsPreferenceFragment + return "popup_permission_list"; + case ContentSettingsType.SOUND: + return "sound_permission_list"; ++ case ContentSettingsType.TIMEZONE_OVERRIDE: ++ return "timezone_override_permission_list"; + case ContentSettingsType.AR: + return "ar_permission_list"; + case ContentSettingsType.MEDIASTREAM_CAMERA: +@@ -811,6 +813,24 @@ public class SingleWebsiteSettings extends SiteSettingsPreferenceFragment + setUpPreferenceCommon(preference); + ListPreference listPreference = (ListPreference) preference; + ++ if (getContentSettingsTypeFromPreferenceKey(preference.getKey()) == ContentSettingsType.TIMEZONE_OVERRIDE) { ++ CharSequence[] keys = new String[3]; ++ keys[0] = ContentSetting.toString(ContentSettingValues.ALLOW); ++ keys[1] = ContentSetting.toString(ContentSettingValues.ASK); ++ keys[2] = ContentSetting.toString(ContentSettingValues.BLOCK); ++ int[] descriptionsId = ContentSettingsResources.getTriStateSettingDescriptionIDs(ContentSettingsType.TIMEZONE_OVERRIDE); ++ CharSequence[] descriptions = new String[3]; ++ descriptions[0] = getString(descriptionsId[0]); ++ descriptions[1] = getString(descriptionsId[1]); ++ descriptions[2] = getString(descriptionsId[2]); ++ listPreference.setEntryValues(keys); ++ listPreference.setEntries(descriptions); ++ listPreference.setOnPreferenceChangeListener(this); ++ int indexSelected = (value == ContentSettingValues.ASK ? 1 : (value == ContentSettingValues.ALLOW ? 0 : 2)); ++ listPreference.setValueIndex(indexSelected); ++ return; ++ } ++ + CharSequence[] keys = new String[2]; + CharSequence[] descriptions = new String[2]; + keys[0] = ContentSetting.toString(ContentSettingValues.ALLOW); +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 +--- 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 +@@ -113,7 +113,7 @@ public class SiteSettings + } else if (Type.SOUND == prefCategory && !checked) { + p.setSummary(ContentSettingsResources.getSoundBlockedListSummary()); + } else if (requiresTriStateSetting) { +- p.setSummary(ContentSettingsResources.getCategorySummary(setting)); ++ p.setSummary(ContentSettingsResources.getCategorySummary(contentType, setting)); + } else { + p.setSummary(ContentSettingsResources.getCategorySummary(contentType, checked)); + } +diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SiteSettingsCategory.java b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SiteSettingsCategory.java +--- a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SiteSettingsCategory.java ++++ b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SiteSettingsCategory.java +@@ -43,7 +43,7 @@ public class SiteSettingsCategory { + Type.CLIPBOARD, Type.COOKIES, Type.IDLE_DETECTION, Type.DEVICE_LOCATION, + Type.JAVASCRIPT, Type.MICROPHONE, Type.NFC, Type.NOTIFICATIONS, Type.POPUPS, + Type.PROTECTED_MEDIA, Type.SENSORS, Type.SOUND, Type.USB, Type.VIRTUAL_REALITY, +- Type.USE_STORAGE}) ++ Type.USE_STORAGE, Type.TIMEZONE_OVERRIDE}) + @Retention(RetentionPolicy.SOURCE) + public @interface Type { + // All updates here must also be reflected in {@link #preferenceKey(int) +@@ -71,10 +71,11 @@ public class SiteSettingsCategory { + int BLUETOOTH = 20; + int VIRTUAL_REALITY = 21; + int USE_STORAGE = 22; ++ int TIMEZONE_OVERRIDE = 23; + /** + * Number of handled categories used for calculating array sizes. + */ +- int NUM_ENTRIES = 23; ++ int NUM_ENTRIES = 24; + } + + private final BrowserContextHandle mBrowserContextHandle; +@@ -192,6 +193,8 @@ public class SiteSettingsCategory { + return ContentSettingsType.USB_GUARD; + case Type.VIRTUAL_REALITY: + return ContentSettingsType.VR; ++ case Type.TIMEZONE_OVERRIDE: ++ return ContentSettingsType.TIMEZONE_OVERRIDE; + // case Type.ALL_SITES + // case Type.USE_STORAGE + default: +@@ -265,6 +268,8 @@ public class SiteSettingsCategory { + return "use_storage"; + case Type.VIRTUAL_REALITY: + return "virtual_reality"; ++ case Type.TIMEZONE_OVERRIDE: ++ return "timezone_override"; + default: + assert false; + return ""; +diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SiteSettingsHelpClient.java b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SiteSettingsHelpClient.java +--- a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SiteSettingsHelpClient.java ++++ b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/SiteSettingsHelpClient.java +@@ -28,4 +28,11 @@ public interface SiteSettingsHelpClient { + * @see org.chromium.chrome.browser.feedback.HelpAndFeedbackLauncher#show + */ + void launchProtectedContentHelpAndFeedbackActivity(Activity currentActivity); ++ ++ /** ++ * Launches a support page related to timezone override content. ++ * ++ * @see org.chromium.chrome.browser.help.HelpAndFeedback#show ++ */ ++ void launchTimeZoneOverrideHelpAndFeedbackActivity(Activity currentActivity); + } +diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/TimezoneOverrideSiteSettingsPreference.java b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/TimezoneOverrideSiteSettingsPreference.java +new file mode 100755 +--- /dev/null ++++ b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/TimezoneOverrideSiteSettingsPreference.java +@@ -0,0 +1,193 @@ ++/* ++ This file is part of Bromite. ++ ++ Bromite is free software: you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation, either version 3 of the License, or ++ (at your option) any later version. ++ ++ Bromite is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License ++ along with Bromite. If not, see . ++*/ ++ ++package org.chromium.components.browser_ui.site_settings; ++ ++import org.chromium.base.Log; ++import android.content.Context; ++import android.content.Intent; ++import android.content.DialogInterface; ++import android.view.View; ++import android.widget.RadioGroup; ++import android.widget.Button; ++import android.widget.TextView; ++import android.util.AttributeSet; ++import android.widget.ArrayAdapter; ++import android.widget.ListView; ++import android.view.LayoutInflater; ++import android.widget.AdapterView; ++import android.graphics.Color; ++ ++import androidx.preference.Preference; ++import androidx.preference.PreferenceViewHolder; ++import androidx.appcompat.app.AlertDialog; ++ ++import org.chromium.components.content_settings.ContentSettingValues; ++import org.chromium.components.embedder_support.browser_context.BrowserContextHandle; ++import org.chromium.components.browser_ui.site_settings.WebsitePreferenceBridge; ++import org.chromium.components.browser_ui.widget.RadioButtonWithDescription; ++import org.chromium.components.browser_ui.widget.RadioButtonWithEditText; ++import org.chromium.components.browser_ui.widget.TintedDrawable; ++ ++import java.util.ArrayList; ++import java.util.Arrays; ++import java.util.TimeZone; ++ ++/** ++ * TimezoneOverride Preference for SiteSettings. ++ */ ++public class TimezoneOverrideSiteSettingsPreference ++ extends Preference implements RadioGroup.OnCheckedChangeListener, ++ RadioButtonWithEditText.OnTextChangeListener { ++ private @ContentSettingValues int mSetting = ContentSettingValues.DEFAULT; ++ private RadioButtonWithDescription mAllowed; ++ private RadioButtonWithEditText mAsk; ++ private RadioButtonWithDescription mBlocked; ++ private RadioGroup mRadioGroup; ++ private TextView mSelectButton; ++ ++ private String currentSelected; ++ ++ private BrowserContextHandle mBrowserContextHandle; ++ ++ public TimezoneOverrideSiteSettingsPreference(Context context, AttributeSet attrs) { ++ super(context, attrs); ++ ++ setLayoutResource(R.layout.timezoneoverride_site_settings_preference); ++ setSelectable(false); ++ } ++ ++ public void initialize(@ContentSettingValues int setting, BrowserContextHandle browserContextHandle) { ++ mSetting = setting; ++ mBrowserContextHandle = browserContextHandle; ++ } ++ ++ public @ContentSettingValues int getCheckedSetting() { ++ return mSetting; ++ } ++ ++ @Override ++ public void onCheckedChanged(RadioGroup group, int checkedId) { ++ if (mAllowed.isChecked()) { ++ mSetting = ContentSettingValues.ALLOW; ++ } else if (mAsk.isChecked()) { ++ mSetting = ContentSettingValues.ASK; ++ } else if (mBlocked.isChecked()) { ++ mSetting = ContentSettingValues.BLOCK; ++ } ++ ++ callChangeListener(mSetting); ++ } ++ ++ @Override ++ public void onBindViewHolder(PreferenceViewHolder holder) { ++ super.onBindViewHolder(holder); ++ ++ mAllowed = (RadioButtonWithDescription) holder.findViewById(R.id.allowed); ++ mAsk = (RadioButtonWithEditText) holder.findViewById(R.id.ask); ++ mBlocked = (RadioButtonWithDescription) holder.findViewById(R.id.blocked); ++ mRadioGroup = (RadioGroup) holder.findViewById(R.id.radio_button_layout); ++ mRadioGroup.setOnCheckedChangeListener(this); ++ ++ mAsk.setPrimaryText(WebsitePreferenceBridge.getCustomTimezone(mBrowserContextHandle)); ++ mAsk.addTextChangeListener(this); ++ ++ ListView listView = (ListView)holder.findViewById(R.id.listView); ++ ++ mSelectButton = (TextView) holder.findViewById(R.id.select_button); ++ mSelectButton.setOnClickListener(view -> { ++ showSelectTimeZoneDialog(); ++ }); ++ ++ RadioButtonWithDescription radioButton = findRadioButton(mSetting); ++ if (radioButton != null) radioButton.setChecked(true); ++ } ++ ++ private RadioButtonWithDescription findRadioButton(@ContentSettingValues int setting) { ++ if (setting == ContentSettingValues.ALLOW) { ++ return mAllowed; ++ } else if (setting == ContentSettingValues.ASK) { ++ return mAsk; ++ } else if (setting == ContentSettingValues.BLOCK) { ++ return mBlocked; ++ } else { ++ return null; ++ } ++ } ++ ++ public void onTextChanged(CharSequence newText) { ++ WebsitePreferenceBridge.setCustomTimezone(mBrowserContextHandle, newText.toString()); ++ } ++ ++ private void showSelectTimeZoneDialog() { ++ LayoutInflater inflater = ++ (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE); ++ View view = inflater.inflate(R.layout.time_zone_select_dialog, null); ++ ++ ListView listView = view.findViewById(R.id.listView); ++ ArrayList timezones = new ArrayList<>(Arrays.asList(TimeZone.getAvailableIDs())); ++ ArrayAdapter adapter = new ArrayAdapter(getContext(), android.R.layout.simple_list_item_1, android.R.id.text1, timezones); ++ listView.setAdapter(adapter); ++ ++ currentSelected = String.valueOf(mAsk.getPrimaryText()); ++ listView.post(new Runnable() ++ { ++ public void run() ++ { ++ for (int j = 0; j < timezones.size(); j++) { ++ if (currentSelected.equals(timezones.get(j))) { ++ listView.requestFocusFromTouch(); ++ listView.setSelection(j); ++ adapter.notifyDataSetChanged(); ++ break; ++ } ++ } ++ } ++ }); ++ ++ listView.setOnItemClickListener(new AdapterView.OnItemClickListener() { ++ @Override ++ public void onItemClick(AdapterView adapterView, View view, int i, long l) { ++ currentSelected = timezones.get(i); ++ listView.setSelected(true); ++ } ++ }); ++ ++ DialogInterface.OnClickListener onClickListener = new DialogInterface.OnClickListener() { ++ @Override ++ public void onClick(DialogInterface dialog, int button) { ++ if (button == AlertDialog.BUTTON_POSITIVE) { ++ mAsk.setPrimaryText(currentSelected); ++ } else { ++ dialog.dismiss(); ++ } ++ } ++ }; ++ ++ AlertDialog.Builder alert = ++ new AlertDialog.Builder(getContext(), R.style.Theme_Chromium_AlertDialog); ++ AlertDialog alertDialog = ++ alert.setTitle(R.string.website_settings_select_dialog_title) ++ .setView(view) ++ .setPositiveButton( ++ R.string.website_settings_select_dialog_button, onClickListener) ++ .setNegativeButton(R.string.cancel, onClickListener) ++ .create(); ++ alertDialog.getDelegate().setHandleNativeActionModesEnabled(false); ++ alertDialog.show(); ++ } ++} +diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/Website.java b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/Website.java +--- a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/Website.java ++++ b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/Website.java +@@ -229,6 +229,16 @@ public final class Website implements Serializable { + } else { + RecordUserAction.record("SoundContentSetting.UnmuteBy.SiteSettings"); + } ++ } else if (type == ContentSettingsType.TIMEZONE_OVERRIDE) { ++ // It is possible to set the permission without having an existing exception, ++ // because we can show the ALLOW state even when this permission is set to the ++ // default. In that case, just set an exception now to ALLOW to enable changing the ++ // permission. ++ if (exception == null) { ++ exception = new ContentSettingException( ++ ContentSettingsType.TIMEZONE_OVERRIDE, getAddress().getHost(), value, ""); ++ setContentSettingException(type, exception); ++ } + } + // We want to call setContentSetting even after explicitly setting + // mContentSettingException above because this will trigger the actual change +diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/WebsitePermissionsFetcher.java b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/WebsitePermissionsFetcher.java +--- a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/WebsitePermissionsFetcher.java ++++ b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/WebsitePermissionsFetcher.java +@@ -64,6 +64,7 @@ public class WebsitePermissionsFetcher { + case ContentSettingsType.JAVASCRIPT: + case ContentSettingsType.POPUPS: + case ContentSettingsType.SOUND: ++ case ContentSettingsType.TIMEZONE_OVERRIDE: + return WebsitePermissionsType.CONTENT_SETTING_EXCEPTION; + case ContentSettingsType.AR: + case ContentSettingsType.CLIPBOARD_READ_WRITE: +@@ -144,6 +145,8 @@ public class WebsitePermissionsFetcher { + for (@ContentSettingsType int type = 0; type < ContentSettingsType.NUM_TYPES; type++) { + addFetcherForContentSettingsType(queue, type); + } ++ queue.add(new ExceptionInfoFetcher(ContentSettingsType.TIMEZONE_OVERRIDE)); ++ + queue.add(new PermissionsAvailableCallbackRunner(callback)); + queue.next(); + } +diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/WebsitePreferenceBridge.java b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/WebsitePreferenceBridge.java +--- a/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/WebsitePreferenceBridge.java ++++ b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/WebsitePreferenceBridge.java +@@ -323,6 +323,8 @@ public class WebsitePreferenceBridge { + switch (contentSettingsType) { + case ContentSettingsType.PROTECTED_MEDIA_IDENTIFIER: + return true; ++ case ContentSettingsType.TIMEZONE_OVERRIDE: ++ return true; + default: + return false; + } +@@ -424,6 +426,14 @@ public class WebsitePreferenceBridge { + contentSettingType, primaryPattern, secondaryPattern, setting); + } + ++ public static String getCustomTimezone(BrowserContextHandle browserContextHandle) { ++ return WebsitePreferenceBridgeJni.get().getCustomTimezone(browserContextHandle); ++ } ++ ++ public static void setCustomTimezone(BrowserContextHandle browserContextHandle, String timezone) { ++ WebsitePreferenceBridgeJni.get().setCustomTimezone(browserContextHandle, timezone); ++ } ++ + @NativeMethods + public interface Natives { + void getArOrigins(BrowserContextHandle browserContextHandle, Object list); +@@ -533,5 +543,7 @@ public class WebsitePreferenceBridge { + boolean isContentSettingManagedByCustodian( + BrowserContextHandle browserContextHandle, int contentSettingType); + boolean getLocationAllowedByPolicy(BrowserContextHandle browserContextHandle); ++ String getCustomTimezone(BrowserContextHandle browserContextHandle); ++ void setCustomTimezone(BrowserContextHandle browserContextHandle, String timezone); + } + } +diff --git a/components/browser_ui/site_settings/android/website_preference_bridge.cc b/components/browser_ui/site_settings/android/website_preference_bridge.cc +--- a/components/browser_ui/site_settings/android/website_preference_bridge.cc ++++ b/components/browser_ui/site_settings/android/website_preference_bridge.cc +@@ -1214,3 +1214,18 @@ static jboolean JNI_WebsitePreferenceBridge_GetLocationAllowedByPolicy( + nullptr) == CONTENT_SETTING_ALLOW; + } + ++static void JNI_WebsitePreferenceBridge_SetCustomTimezone( ++ JNIEnv* env, ++ const JavaParamRef& jbrowser_context_handle, ++ const JavaParamRef& timezone) { ++ std::string new_timezone = ConvertJavaStringToUTF8(env, timezone); ++ GetHostContentSettingsMap(jbrowser_context_handle)->SetTimezoneOverrideValue(new_timezone); ++} ++ ++static base::android::ScopedJavaLocalRef JNI_WebsitePreferenceBridge_GetCustomTimezone( ++ JNIEnv* env, ++ const JavaParamRef& jbrowser_context_handle) { ++ std::string timezone; ++ GetHostContentSettingsMap(jbrowser_context_handle)->GetTimezoneOverrideValue(timezone); ++ return ConvertUTF8ToJavaString(env, timezone); ++} +diff --git a/components/browser_ui/strings/android/site_settings.grdp b/components/browser_ui/strings/android/site_settings.grdp +--- a/components/browser_ui/strings/android/site_settings.grdp ++++ b/components/browser_ui/strings/android/site_settings.grdp +@@ -69,6 +69,9 @@ + + Virtual reality + ++ ++ Timezone override ++ + + + +@@ -475,6 +478,38 @@ + Block sites from playing protected content + + ++ ++ ++ Override timezone with a custom or random one, or use the system timezone ++ ++ ++ None (use system timezone) ++ ++ ++ Random ++ ++ ++ System timezone ++ ++ ++ Custom timezone ++ ++ ++ Specify a custom timezone (default UTC) ++ ++ ++ Random (for each page) ++ ++ ++ Choose Timezone... ++ ++ ++ Choose Timezone ++ ++ ++ Select ++ ++ + + + +diff --git a/components/content_settings/core/browser/content_settings_pref_provider.cc b/components/content_settings/core/browser/content_settings_pref_provider.cc +--- a/components/content_settings/core/browser/content_settings_pref_provider.cc ++++ b/components/content_settings/core/browser/content_settings_pref_provider.cc +@@ -100,6 +100,8 @@ void PrefProvider::RegisterProfilePrefs( + registry->RegisterDictionaryPref(kDeprecatedNativeFileSystemReadGuardPref); + registry->RegisterDictionaryPref(kDeprecatedNativeFileSystemWriteGuardPref); + #endif // !defined(OS_ANDROID) ++ ++ registry->RegisterStringPref(prefs::kContentSettingsCustomTimezone, std::string()); + } + + PrefProvider::PrefProvider(PrefService* prefs, +@@ -163,6 +165,10 @@ PrefProvider::PrefProvider(PrefService* prefs, + num_exceptions); + } + ++ custom_timezone_ = ++ prefs_->GetString( ++ prefs::kContentSettingsCustomTimezone); ++ + TRACE_EVENT_END1("startup", "PrefProvider::PrefProvider", + "NumberOfExceptions", num_exceptions); + } +@@ -328,4 +334,14 @@ void PrefProvider::SetClockForTesting(base::Clock* clock) { + clock_ = clock; + } + ++void PrefProvider::GetPrefTimezoneOverrideValue(std::string& timezone) const { ++ timezone = custom_timezone_; ++} ++ ++void PrefProvider::SetPrefTimezoneOverrideValue(const std::string& timezone) { ++ prefs_->SetString( ++ prefs::kContentSettingsCustomTimezone, timezone); ++ custom_timezone_ = timezone; ++} ++ + } // namespace content_settings +diff --git a/components/content_settings/core/browser/content_settings_pref_provider.h b/components/content_settings/core/browser/content_settings_pref_provider.h +--- a/components/content_settings/core/browser/content_settings_pref_provider.h ++++ b/components/content_settings/core/browser/content_settings_pref_provider.h +@@ -66,6 +66,9 @@ class PrefProvider : public UserModifiableProvider { + + ContentSettingsPref* GetPref(ContentSettingsType type) const; + ++ void GetPrefTimezoneOverrideValue(std::string& timezone) const; ++ void SetPrefTimezoneOverrideValue(const std::string& timezone); ++ + private: + friend class DeadlockCheckerObserver; // For testing. + +@@ -103,6 +106,8 @@ class PrefProvider : public UserModifiableProvider { + + base::Clock* clock_; + ++ std::string custom_timezone_; ++ + DISALLOW_COPY_AND_ASSIGN(PrefProvider); + }; + +diff --git a/components/content_settings/core/browser/content_settings_registry.cc b/components/content_settings/core/browser/content_settings_registry.cc +--- a/components/content_settings/core/browser/content_settings_registry.cc ++++ b/components/content_settings/core/browser/content_settings_registry.cc +@@ -621,6 +621,18 @@ void ContentSettingsRegistry::Init() { + ContentSettingsInfo::INHERIT_IF_LESS_PERMISSIVE, + ContentSettingsInfo::PERSISTENT, + ContentSettingsInfo::EXCEPTIONS_ON_SECURE_ORIGINS_ONLY); ++ ++ Register(ContentSettingsType::TIMEZONE_OVERRIDE, "timezone-override", CONTENT_SETTING_ALLOW, ++ WebsiteSettingsInfo::SYNCABLE, ++ WhitelistedSchemes(kChromeUIScheme, kChromeDevToolsScheme), ++ ValidSettings(CONTENT_SETTING_ALLOW, // use system time ++ CONTENT_SETTING_ASK, // custom timezone, default UTC ++ CONTENT_SETTING_BLOCK), // random ++ WebsiteSettingsInfo::SINGLE_ORIGIN_WITH_EMBEDDED_EXCEPTIONS_SCOPE, ++ WebsiteSettingsRegistry::PLATFORM_ANDROID, ++ ContentSettingsInfo::INHERIT_IN_INCOGNITO, ++ ContentSettingsInfo::PERSISTENT, ++ ContentSettingsInfo::EXCEPTIONS_ON_SECURE_AND_INSECURE_ORIGINS); + } + + void ContentSettingsRegistry::Register( +diff --git a/components/content_settings/core/browser/content_settings_utils.cc b/components/content_settings/core/browser/content_settings_utils.cc +--- a/components/content_settings/core/browser/content_settings_utils.cc ++++ b/components/content_settings/core/browser/content_settings_utils.cc +@@ -145,6 +145,13 @@ void GetRendererContentSettingRules(const HostContentSettingsMap* map, + ResourceIdentifier(), &(rules->script_rules)); + map->GetSettingsForOneType(ContentSettingsType::POPUPS, ResourceIdentifier(), + &(rules->popup_redirect_rules)); ++ ++ // pass custom timezone rules and value to the render process ++ map->GetSettingsForOneType(ContentSettingsType::TIMEZONE_OVERRIDE, ++ ResourceIdentifier(), &(rules->timezone_override_rules)); ++ std::string timezone; ++ map->GetTimezoneOverrideValue(timezone); ++ rules->timezone_override_value = timezone; + } + + bool IsMorePermissive(ContentSetting a, ContentSetting b) { +diff --git a/components/content_settings/core/browser/host_content_settings_map.cc b/components/content_settings/core/browser/host_content_settings_map.cc +--- a/components/content_settings/core/browser/host_content_settings_map.cc ++++ b/components/content_settings/core/browser/host_content_settings_map.cc +@@ -656,6 +656,14 @@ void HostContentSettingsMap::SetClockForTesting(base::Clock* clock) { + provider->SetClockForTesting(clock); + } + ++void HostContentSettingsMap::GetTimezoneOverrideValue(std::string& timezone) const { ++ GetPrefProvider()->GetPrefTimezoneOverrideValue(timezone); ++} ++ ++void HostContentSettingsMap::SetTimezoneOverrideValue(const std::string& timezone) { ++ GetPrefProvider()->SetPrefTimezoneOverrideValue(timezone); ++} ++ + void HostContentSettingsMap::RecordExceptionMetrics() { + auto* content_setting_registry = + content_settings::ContentSettingsRegistry::GetInstance(); +diff --git a/components/content_settings/core/browser/host_content_settings_map.h b/components/content_settings/core/browser/host_content_settings_map.h +--- a/components/content_settings/core/browser/host_content_settings_map.h ++++ b/components/content_settings/core/browser/host_content_settings_map.h +@@ -345,6 +345,9 @@ class HostContentSettingsMap : public content_settings::Observer, + allow_invalid_secondary_pattern_for_testing_ = allow; + } + ++ void GetTimezoneOverrideValue(std::string& timezone) const; ++ void SetTimezoneOverrideValue(const std::string& timezone); ++ + private: + friend class base::RefCountedThreadSafe; + friend class content_settings::TestUtils; +diff --git a/components/content_settings/core/common/content_settings.cc b/components/content_settings/core/common/content_settings.cc +--- a/components/content_settings/core/common/content_settings.cc ++++ b/components/content_settings/core/common/content_settings.cc +@@ -93,6 +93,7 @@ constexpr HistogramValue kHistogramValue[] = { + {ContentSettingsType::INSECURE_PRIVATE_NETWORK, 70}, + {ContentSettingsType::FONT_ACCESS, 71}, + {ContentSettingsType::PERMISSION_AUTOREVOCATION_DATA, 72}, ++ //{ContentSettingsType::TIMEZONE_OVERRIDE, 73}, should be here + }; + + } // namespace +@@ -179,7 +180,8 @@ bool RendererContentSettingRules::IsRendererContentSetting( + content_type == ContentSettingsType::JAVASCRIPT || + content_type == ContentSettingsType::CLIENT_HINTS || + content_type == ContentSettingsType::POPUPS || +- content_type == ContentSettingsType::MIXEDSCRIPT; ++ content_type == ContentSettingsType::MIXEDSCRIPT || ++ content_type == ContentSettingsType::TIMEZONE_OVERRIDE; + } + + RendererContentSettingRules::RendererContentSettingRules() {} +diff --git a/components/content_settings/core/common/content_settings.h b/components/content_settings/core/common/content_settings.h +--- a/components/content_settings/core/common/content_settings.h ++++ b/components/content_settings/core/common/content_settings.h +@@ -78,6 +78,8 @@ struct RendererContentSettingRules { + ContentSettingsForOneType script_rules; + ContentSettingsForOneType popup_redirect_rules; + ContentSettingsForOneType mixed_content_rules; ++ ContentSettingsForOneType timezone_override_rules; ++ std::string timezone_override_value; + }; + + namespace content_settings { +diff --git a/components/content_settings/core/common/content_settings.mojom b/components/content_settings/core/common/content_settings.mojom +--- a/components/content_settings/core/common/content_settings.mojom ++++ b/components/content_settings/core/common/content_settings.mojom +@@ -77,4 +77,6 @@ struct RendererContentSettingRules { + array script_rules; + array popup_redirect_rules; + array mixed_content_rules; ++ array timezone_override_rules; ++ string timezone_override_value; + }; +diff --git a/components/content_settings/core/common/content_settings_mojom_traits.cc b/components/content_settings/core/common/content_settings_mojom_traits.cc +--- a/components/content_settings/core/common/content_settings_mojom_traits.cc ++++ b/components/content_settings/core/common/content_settings_mojom_traits.cc +@@ -100,7 +100,9 @@ bool StructTraitsimage_rules) && + data.ReadScriptRules(&out->script_rules) && + data.ReadPopupRedirectRules(&out->popup_redirect_rules) && +- data.ReadMixedContentRules(&out->mixed_content_rules); ++ data.ReadMixedContentRules(&out->mixed_content_rules) && ++ data.ReadTimezoneOverrideRules(&out->timezone_override_rules) && ++ data.ReadTimezoneOverrideValue(&out->timezone_override_value); + } + + } // namespace mojo +diff --git a/components/content_settings/core/common/content_settings_mojom_traits.h b/components/content_settings/core/common/content_settings_mojom_traits.h +--- a/components/content_settings/core/common/content_settings_mojom_traits.h ++++ b/components/content_settings/core/common/content_settings_mojom_traits.h +@@ -145,6 +145,16 @@ struct StructTraits< + return r.mixed_content_rules; + } + ++ static const std::vector& timezone_override_rules( ++ const RendererContentSettingRules& r) { ++ return r.timezone_override_rules; ++ } ++ ++ static const std::string& timezone_override_value( ++ const RendererContentSettingRules& r) { ++ return r.timezone_override_value; ++ } ++ + static bool Read( + content_settings::mojom::RendererContentSettingRulesDataView data, + RendererContentSettingRules* out); +diff --git a/components/content_settings/core/common/content_settings_types.h b/components/content_settings/core/common/content_settings_types.h +--- a/components/content_settings/core/common/content_settings_types.h ++++ b/components/content_settings/core/common/content_settings_types.h +@@ -225,6 +225,9 @@ enum class ContentSettingsType : int32_t { + // locally installed font data using the Font Access API. + FONT_ACCESS, + ++ // Content setting for timezone customization functionality. ++ TIMEZONE_OVERRIDE, ++ + // Stores per-origin state for permission auto-revocation (for all permission + // types). + PERMISSION_AUTOREVOCATION_DATA, +diff --git a/components/content_settings/core/common/pref_names.cc b/components/content_settings/core/common/pref_names.cc +--- a/components/content_settings/core/common/pref_names.cc ++++ b/components/content_settings/core/common/pref_names.cc +@@ -127,4 +127,7 @@ const char kEnableQuietNotificationPermissionUi[] = + const char kNotificationsVibrateEnabled[] = "notifications.vibrate_enabled"; + #endif + ++const char kContentSettingsCustomTimezone[] = ++ "profile.content_settings.custom_timezone"; ++ + } // namespace prefs +diff --git a/components/content_settings/core/common/pref_names.h b/components/content_settings/core/common/pref_names.h +--- a/components/content_settings/core/common/pref_names.h ++++ b/components/content_settings/core/common/pref_names.h +@@ -73,6 +73,8 @@ extern const char kEnableQuietNotificationPermissionUi[]; + extern const char kNotificationsVibrateEnabled[]; + #endif + ++extern const char kContentSettingsCustomTimezone[]; ++ + } // namespace prefs + + #endif // COMPONENTS_CONTENT_SETTINGS_CORE_COMMON_PREF_NAMES_H_ +diff --git a/components/content_settings/renderer/content_settings_agent_impl.cc b/components/content_settings/renderer/content_settings_agent_impl.cc +--- a/components/content_settings/renderer/content_settings_agent_impl.cc ++++ b/components/content_settings/renderer/content_settings_agent_impl.cc +@@ -9,6 +9,7 @@ + + #include "base/bind.h" + #include "base/feature_list.h" ++#include "base/logging.h" + #include "base/metrics/histogram_macros.h" + #include "base/strings/string_number_conversions.h" + #include "components/content_settings/core/common/content_settings.h" +@@ -32,6 +33,10 @@ + #include "third_party/blink/public/web/web_local_frame.h" + #include "third_party/blink/public/web/web_local_frame_client.h" + #include "third_party/blink/public/web/web_view.h" ++#include "third_party/blink/renderer/core/inspector/locale_controller.h" ++#include "third_party/blink/renderer/core/timezone/timezone_controller.h" ++#include "third_party/icu/source/common/unicode/strenum.h" ++#include "third_party/icu/source/i18n/unicode/timezone.h" + #include "url/gurl.h" + #include "url/origin.h" + #include "url/url_constants.h" +@@ -45,6 +50,8 @@ using blink::WebURL; + using blink::WebView; + using content::DocumentState; + ++std::unique_ptr timezone_override_; ++ + namespace content_settings { + namespace { + +@@ -377,6 +384,10 @@ bool ContentSettingsAgentImpl::AllowScript(bool enabled_per_settings) { + allow = allow || IsWhitelistedForContentSettings(); + + cached_script_permissions_[frame] = allow; ++ ++ if (allow) ++ UpdateOverrides(); ++ + return allow; + } + +@@ -509,4 +520,81 @@ bool ContentSettingsAgentImpl::IsWhitelistedForContentSettings() const { + return false; + } + ++bool ContentSettingsAgentImpl::UpdateOverrides() { ++ // Evaluate the content setting rules ++ ContentSetting setting = CONTENT_SETTING_ALLOW; ++ ++ if (content_setting_rules_) { ++ blink::WebLocalFrame* frame = render_frame()->GetWebFrame(); ++ ++ setting = GetContentSettingFromRules( ++ content_setting_rules_->timezone_override_rules, frame, ++ url::Origin(frame->GetDocument().GetSecurityOrigin()).GetURL()); ++ } ++ return UpdateTimeZoneOverride( ++ setting, content_setting_rules_->timezone_override_value); ++ //&& UpdateLocaleOverride(setting); ++} ++ ++bool ContentSettingsAgentImpl::UpdateTimeZoneOverride( ++ ContentSetting setting, ++ const std::string& timezone_override_value) { ++ // base/i18n/icu_util.cc # 329 ++ ++ /* timezone_id: third_party/icu/source/i18n/timezone.cpp ++ We first try to lookup the zone ID in our system list. If this ++ * fails, we try to parse it as a custom string GMT[+-]hh:mm. If ++ * all else fails, we return GMT, which is probably not what the ++ * user wants, but at least is a functioning TimeZone object. ++ */ ++ String timezone_id; ++ ++ if (setting == CONTENT_SETTING_ALLOW) { ++ // system time ++ if (timezone_override_) { ++ timezone_override_.reset(); ++ } ++ return true; ++ } else if (setting == CONTENT_SETTING_BLOCK) { ++ // timezone random ++ UErrorCode ec = U_ZERO_ERROR; ++ int32_t rawOffset = ((rand() % 24) - 12) * 3600 * 1000; ++ icu::StringEnumeration* timezones = icu::TimeZone::createEnumeration( ++ rawOffset); // Obtain timezones by GMT timezone offset ++ if (timezones) { ++ const char* tzID; ++ int32_t length; ++ if ((tzID = timezones->next(&length, ec)) != NULL) { ++ timezone_id = String(tzID); ++ } ++ delete timezones; ++ } ++ } else if (setting == CONTENT_SETTING_ASK) { ++ if (timezone_override_value.empty()) ++ timezone_id = "Europe/London"; ++ else ++ timezone_id = String(timezone_override_value.c_str()); ++ } ++ ++ if (blink::TimeZoneController::HasTimeZoneOverride() == false) { ++ timezone_override_.reset(); ++ timezone_override_ = ++ blink::TimeZoneController::SetTimeZoneOverride(timezone_id); ++ if (!timezone_override_) { ++ LOG(WARNING) << "UpdateTimeZoneOverride - Invalid timezone id '" ++ << timezone_id << "'"; ++ return false; ++ } else { ++ LOG(INFO) ++ << "UpdateTimeZoneOverride - setting to '" ++ << timezone_id << "'"; ++ return true; ++ } ++ } else { ++ LOG(INFO) ++ << "UpdateTimeZoneOverride: already set"; ++ return false; ++ } ++} ++ + } // namespace content_settings +diff --git a/components/content_settings/renderer/content_settings_agent_impl.h b/components/content_settings/renderer/content_settings_agent_impl.h +--- a/components/content_settings/renderer/content_settings_agent_impl.h ++++ b/components/content_settings/renderer/content_settings_agent_impl.h +@@ -180,6 +180,10 @@ class ContentSettingsAgentImpl + + mojo::AssociatedReceiverSet receivers_; + ++ bool UpdateOverrides(); ++ bool UpdateTimeZoneOverride(ContentSetting setting, const std::string& timezone_override_value); ++ bool UpdateLocaleOverride(ContentSetting setting); ++ + DISALLOW_COPY_AND_ASSIGN(ContentSettingsAgentImpl); + }; + +diff --git a/weblayer/browser/java/org/chromium/weblayer_private/WebLayerSiteSettingsClient.java b/weblayer/browser/java/org/chromium/weblayer_private/WebLayerSiteSettingsClient.java +--- a/weblayer/browser/java/org/chromium/weblayer_private/WebLayerSiteSettingsClient.java ++++ b/weblayer/browser/java/org/chromium/weblayer_private/WebLayerSiteSettingsClient.java +@@ -147,6 +147,9 @@ public class WebLayerSiteSettingsClient implements SiteSettingsClient, ManagedPr + @Override + public void launchProtectedContentHelpAndFeedbackActivity(Activity currentActivity) {} + ++ @Override ++ public void launchTimeZoneOverrideHelpAndFeedbackActivity(Activity currentActivity) {} ++ + // WebappSettingsClient implementation: + // A no-op since WebLayer doesn't support webapps. + +-- +2.17.1 + diff --git a/build/patches/build-remove-calling-untrusted-hooks.patch b/build/patches/build-remove-calling-untrusted-hooks.patch index 54da7541..866788da 100644 --- a/build/patches/build-remove-calling-untrusted-hooks.patch +++ b/build/patches/build-remove-calling-untrusted-hooks.patch @@ -11,7 +11,7 @@ sysroot. diff --git a/DEPS b/DEPS --- a/DEPS +++ b/DEPS -@@ -94,7 +94,7 @@ vars = { +@@ -93,7 +93,7 @@ vars = { # Check out and download nacl by default. This can be disabled e.g. with # custom_vars. @@ -20,7 +20,7 @@ diff --git a/DEPS b/DEPS # By default, do not check out src-internal. This can be overridden e.g. with # custom_vars. -@@ -124,8 +124,8 @@ vars = { +@@ -123,8 +123,8 @@ vars = { # support for other platforms may be added in the future. 'checkout_openxr' : 'checkout_win', @@ -31,7 +31,7 @@ diff --git a/DEPS b/DEPS # By default bot checkouts the WPR archive files only when this # flag is set True. -@@ -4249,49 +4249,6 @@ hooks = [ +@@ -4248,49 +4248,6 @@ hooks = [ 'sync', '--extract', ], }, @@ -81,7 +81,7 @@ diff --git a/DEPS b/DEPS { # Case-insensitivity for the Win SDK. Must run before win_toolchain below. 'name': 'ciopfs_linux', -@@ -4415,18 +4372,6 @@ hooks = [ +@@ -4414,18 +4371,6 @@ hooks = [ '-s', 'src/buildtools/mac/clang-format.sha1', ], }, @@ -100,7 +100,7 @@ diff --git a/DEPS b/DEPS # Pull rc binaries using checked-in hashes. { 'name': 'rc_win', -@@ -4452,29 +4397,6 @@ hooks = [ +@@ -4451,29 +4396,6 @@ hooks = [ '-s', 'src/build/toolchain/win/rc/mac/rc.sha1', ], }, diff --git a/build/patches/disable-AdsBlockedInfoBar.patch b/build/patches/disable-AdsBlockedInfoBar.patch index bbabd76b..dc5af52d 100644 --- a/build/patches/disable-AdsBlockedInfoBar.patch +++ b/build/patches/disable-AdsBlockedInfoBar.patch @@ -9,7 +9,7 @@ Subject: disable AdsBlockedInfoBar diff --git a/chrome/browser/subresource_filter/chrome_subresource_filter_client.cc b/chrome/browser/subresource_filter/chrome_subresource_filter_client.cc --- a/chrome/browser/subresource_filter/chrome_subresource_filter_client.cc +++ b/chrome/browser/subresource_filter/chrome_subresource_filter_client.cc -@@ -192,11 +192,6 @@ void ChromeSubresourceFilterClient::LogAction(SubresourceFilterAction action) { +@@ -195,11 +195,6 @@ void ChromeSubresourceFilterClient::LogAction(SubresourceFilterAction action) { } void ChromeSubresourceFilterClient::ShowUI(const GURL& url) { diff --git a/build/patches/ungoogled-chromium-Disable-translate-integration.patch b/build/patches/ungoogled-chromium-Disable-translate-integration.patch index 8a9cff96..8c91535c 100644 --- a/build/patches/ungoogled-chromium-Disable-translate-integration.patch +++ b/build/patches/ungoogled-chromium-Disable-translate-integration.patch @@ -4,13 +4,27 @@ Subject: ungoogled-chromium: Disable translate integration Remove translate offer --- + .../xml/languages_detailed_preferences.xml | 5 --- .../java/res/xml/languages_preferences.xml | 5 --- .../language/settings/LanguageSettings.java | 43 ------------------- .../strings/android_chrome_strings.grd | 3 -- .../core/browser/translate_manager.cc | 5 ++- .../core/browser/translate_script.cc | 16 +------ - 5 files changed, 5 insertions(+), 67 deletions(-) + 6 files changed, 5 insertions(+), 72 deletions(-) +diff --git a/chrome/android/java/res/xml/languages_detailed_preferences.xml b/chrome/android/java/res/xml/languages_detailed_preferences.xml +--- a/chrome/android/java/res/xml/languages_detailed_preferences.xml ++++ b/chrome/android/java/res/xml/languages_detailed_preferences.xml +@@ -11,9 +11,4 @@ + android:layout="@layout/languages_preference" + android:widgetLayout="@layout/accept_languages_list" /> + +- +- + diff --git a/chrome/android/java/res/xml/languages_preferences.xml b/chrome/android/java/res/xml/languages_preferences.xml --- a/chrome/android/java/res/xml/languages_preferences.xml +++ b/chrome/android/java/res/xml/languages_preferences.xml