diff --git a/patches/helium/core/add-updater-preference.patch b/patches/helium/core/add-updater-preference.patch index 67aa5868..de1d7cc5 100644 --- a/patches/helium/core/add-updater-preference.patch +++ b/patches/helium/core/add-updater-preference.patch @@ -1,5 +1,3 @@ -TODO: guard services_page.html with is_mac - --- a/components/helium_services/pref_names.h +++ b/components/helium_services/pref_names.h @@ -33,6 +33,9 @@ inline constexpr char kHeliumExtProxyEna @@ -78,17 +76,15 @@ TODO: guard services_page.html with is_mac registrar.Add(prefs::kHeliumServicesEnabled, observer); --- a/chrome/browser/resources/settings/privacy_page/services_page.html +++ b/chrome/browser/resources/settings/privacy_page/services_page.html -@@ -101,6 +101,13 @@ +@@ -101,6 +101,11 @@ sub-label="$i18n{heliumSpellcheckToggleDescription}"> -+ -+ -+ -+ ++ ++ @@ -128,16 +124,23 @@ TODO: guard services_page.html with is_mac registry->RegisterBooleanPref( --- a/chrome/app/settings_strings.grdp +++ b/chrome/app/settings_strings.grdp -@@ -2002,6 +2002,12 @@ +@@ -2002,6 +2002,19 @@ Helium will fetch dictionary files used for spell checking when requested. When disabled, spell checking will not work. + -+ Allow automatic browser updates -+ -+ -+ Helium will automatically download and install browser updates as they become available. We recommend keeping this setting enabled to ensure you get the latest security patches and features. ++ Allow automatic browser and component updates + ++ ++ ++ Helium will automatically download and install browser and component updates as they become available. We recommend keeping this setting enabled to ensure you get the latest features and security updates. ++ ++ ++ ++ ++ Helium will automatically download and install browser and component updates as they become available. We recommend keeping this setting enabled to ensure you get the latest features and security updates. Automatic core browser updates are not available on this platform yet, but component updates are. Please use external software to keep Helium up to date. ++ ++ Use your own instance of Helium services diff --git a/patches/helium/core/component-updates.patch b/patches/helium/core/component-updates.patch new file mode 100644 index 00000000..8e53fe32 --- /dev/null +++ b/patches/helium/core/component-updates.patch @@ -0,0 +1,129 @@ +--- a/components/component_updater/component_updater_url_constants.cc ++++ b/components/component_updater/component_updater_url_constants.cc +@@ -15,9 +15,9 @@ namespace component_updater { + // The value of |kDefaultUrlSource| can be overridden with + // --component-updater=url-source=someurl. + const char kUpdaterJSONDefaultUrl[] = +- "https://update.googleapis.com/service/update2/json"; ++ "trk:345:https://update.googleapis.com/service/update2/json"; + + const char kUpdaterJSONFallbackUrl[] = +- "http://update.googleapis.com/service/update2/json"; ++ "trk:346:http://update.googleapis.com/service/update2/json"; + + } // namespace component_updater +--- a/components/helium_services/helium_services_helpers.cc ++++ b/components/helium_services/helium_services_helpers.cc +@@ -9,6 +9,7 @@ + #include "base/functional/bind.h" + #include "base/strings/stringprintf.h" + #include "components/helium_services/pref_names.h" ++#include "components/helium_services/schema.h" + #include "components/prefs/pref_service.h" + #include "net/base/url_util.h" + #include "url/gurl.h" +@@ -88,6 +89,12 @@ bool ShouldAccessUpdateService(const Pre + prefs.GetBoolean(prefs::kHeliumUpdateFetchingEnabled); + } + ++bool ShouldAccessComponentUpdateService(const PrefService& prefs) { ++ return ShouldAccessServices(prefs) && ++ HasAcceptedSchema(prefs, 1) && ++ prefs.GetBoolean(prefs::kHeliumUpdateFetchingEnabled); ++} ++ + bool ShouldAccessUBlockAssets(const PrefService& prefs) { + return ShouldAccessServices(prefs) && + prefs.GetBoolean(prefs::kHeliumUBlockAssetsEnabled); +@@ -132,6 +139,14 @@ GURL GetBrowserUpdateURL(const PrefServi + #endif + } + ++GURL GetComponentUpdateURL(const PrefService* prefs) { ++ if (!prefs || !ShouldAccessComponentUpdateService(*prefs)) { ++ return GetDummyURL(); ++ } ++ ++ return GetServicesBaseURL(*prefs).Resolve("/com"); ++} ++ + GURL GetUBlockAssetsURL(const PrefService& prefs) { + if (!ShouldAccessUBlockAssets(prefs)) { + return GetDummyURL(); +--- a/components/helium_services/helium_services_helpers.h ++++ b/components/helium_services/helium_services_helpers.h +@@ -23,6 +23,7 @@ bool ShouldAccessServices(const PrefServ + COMPONENT_EXPORT(HELIUM) bool ShouldFetchBangs(const PrefService& prefs); + COMPONENT_EXPORT(HELIUM) bool ShouldAccessExtensionService(const PrefService& prefs); + COMPONENT_EXPORT(HELIUM) bool ShouldAccessUpdateService(const PrefService& prefs); ++COMPONENT_EXPORT(HELIUM) bool ShouldAccessComponentUpdateService(const PrefService& prefs); + COMPONENT_EXPORT(HELIUM) bool ShouldAccessUBlockAssets(const PrefService& prefs); + COMPONENT_EXPORT(HELIUM) GURL GetServicesBaseURL(const PrefService& prefs); + COMPONENT_EXPORT(HELIUM) GURL GetDummyURL(); +@@ -30,6 +31,7 @@ COMPONENT_EXPORT(HELIUM) GURL GetExtensi + COMPONENT_EXPORT(HELIUM) GURL GetWebstoreSnippetURL(const PrefService& prefs, std::string_view id); + COMPONENT_EXPORT(HELIUM) GURL GetSpellcheckURL(const PrefService& prefs); + COMPONENT_EXPORT(HELIUM) GURL GetBrowserUpdateURL(const PrefService& prefs); ++COMPONENT_EXPORT(HELIUM) GURL GetComponentUpdateURL(const PrefService* prefs); + COMPONENT_EXPORT(HELIUM) GURL GetUBlockAssetsURL(const PrefService& prefs); + COMPONENT_EXPORT(HELIUM) std::optional GetValidUserOverridenURL(std::string_view user_url_); + COMPONENT_EXPORT(HELIUM) void ConfigurePrefChangeRegistrarFor(std::string_view pref_name, +--- a/chrome/browser/component_updater/chrome_component_updater_configurator.cc ++++ b/chrome/browser/component_updater/chrome_component_updater_configurator.cc +@@ -26,11 +26,14 @@ + #include "chrome/browser/component_updater/component_updater_utils.h" + #include "chrome/browser/component_updater/updater_state.h" + #include "chrome/browser/net/system_network_context_manager.h" ++#include "chrome/browser/profiles/profile.h" ++#include "chrome/browser/profiles/profile_manager.h" + #include "chrome/browser/update_client/chrome_update_query_params_delegate.h" + #include "chrome/common/channel_info.h" + #include "chrome/common/chrome_paths.h" + #include "components/component_updater/component_updater_command_line_config_policy.h" + #include "components/component_updater/configurator_impl.h" ++#include "components/helium_services/helium_services_helpers.h" + #include "components/prefs/pref_service.h" + #include "components/services/patch/content/patch_service.h" + #include "components/services/unzip/content/unzip_service.h" +@@ -55,6 +58,26 @@ + namespace component_updater { + namespace { + ++PrefService* GetProfilePrefs() { ++ // Browser process and profile manager are usually ++ // not null, but they may be during tests. ++ if (!g_browser_process) { ++ return nullptr; ++ } ++ ++ ProfileManager* pm = g_browser_process->profile_manager(); ++ if (!pm) { ++ return nullptr; ++ } ++ ++ Profile* profile = pm->GetLastUsedProfileIfLoaded(); ++ if (!profile) { ++ return nullptr; ++ } ++ ++ return profile->GetPrefs(); ++} ++ + class ChromeConfigurator : public update_client::Configurator { + public: + ChromeConfigurator(const base::CommandLine* cmdline, +@@ -154,12 +177,12 @@ base::TimeDelta ChromeConfigurator::Upda + + std::vector ChromeConfigurator::UpdateUrl() const { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); +- return configurator_impl_.UpdateUrl(); ++ return {helium::GetComponentUpdateURL(GetProfilePrefs())}; + } + + std::vector ChromeConfigurator::PingUrl() const { + DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); +- return configurator_impl_.PingUrl(); ++ return {helium::GetComponentUpdateURL(GetProfilePrefs())}; + } + + std::string ChromeConfigurator::GetProdId() const { diff --git a/patches/helium/core/reenable-update-checks.patch b/patches/helium/core/reenable-update-checks.patch index 4cfb3a79..7ee66e55 100644 --- a/patches/helium/core/reenable-update-checks.patch +++ b/patches/helium/core/reenable-update-checks.patch @@ -19,15 +19,6 @@ DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); if (url_source_override_.is_valid()) { return {GURL(url_source_override_)}; -@@ -123,7 +125,7 @@ bool ConfiguratorImpl::EnabledDeltas() c - - bool ConfiguratorImpl::EnabledComponentUpdates() const { - DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_); -- return true; -+ return false; - } - - bool ConfiguratorImpl::EnabledBackgroundDownloader() const { @@ -133,7 +135,7 @@ bool ConfiguratorImpl::EnabledBackground bool ConfiguratorImpl::EnabledCupSigning() const { diff --git a/patches/helium/core/ublock-helium-services.patch b/patches/helium/core/ublock-helium-services.patch index fa316857..9c6559b6 100644 --- a/patches/helium/core/ublock-helium-services.patch +++ b/patches/helium/core/ublock-helium-services.patch @@ -217,10 +217,10 @@ if ( bin.assetSourceRegistry instanceof Object ) { --- a/chrome/app/settings_strings.grdp +++ b/chrome/app/settings_strings.grdp -@@ -2008,6 +2008,12 @@ - - Helium will automatically download and install browser updates as they become available. We recommend keeping this setting enabled to ensure you get the latest security patches and features. - +@@ -2015,6 +2015,12 @@ + Helium will automatically download and install browser and component updates as they become available. We recommend keeping this setting enabled to ensure you get the latest features and security updates. Automatic core browser updates are not available on this platform yet, but component updates are. Please use external software to keep Helium up to date. + + + + Allow downloading filter lists for uBlock Origin + @@ -232,10 +232,10 @@ --- a/chrome/browser/resources/settings/privacy_page/services_page.html +++ b/chrome/browser/resources/settings/privacy_page/services_page.html -@@ -108,6 +108,11 @@ - sub-label="$i18n{heliumUpdatesToggleDescription}"> - - +@@ -106,6 +106,11 @@ + label="$i18n{heliumUpdatesToggle}" + sub-label="$i18n{heliumUpdatesToggleDescription}"> + + Learn more about Do Not Track -@@ -3213,6 +3216,9 @@ +@@ -3220,6 +3223,9 @@ Affects the sites listed here. Inserting “[*.]” before a domain name creates an exception for the entire domain. For example, adding “[*.]google.com” means that third-party cookies can also be active for mail.google.com, because it’s part of google.com. diff --git a/patches/helium/ui/ublock-show-in-settings.patch b/patches/helium/ui/ublock-show-in-settings.patch index 5405c5a9..eeda88a8 100644 --- a/patches/helium/ui/ublock-show-in-settings.patch +++ b/patches/helium/ui/ublock-show-in-settings.patch @@ -87,7 +87,7 @@ }; --- a/chrome/app/generated_resources.grd +++ b/chrome/app/generated_resources.grd -@@ -13441,6 +13441,9 @@ Check your passwords anytime in Installed because of dependent extension(s). diff --git a/patches/series b/patches/series index 5facae40..d20c5bd0 100644 --- a/patches/series +++ b/patches/series @@ -191,6 +191,7 @@ helium/core/webrtc-default-handling-policy.patch helium/core/browser-window-context-menu.patch helium/core/disable-ntp-footer.patch helium/core/tab-cycling-mru.patch +helium/core/component-updates.patch helium/settings/settings-page-icons.patch helium/settings/move-search-suggest.patch