mirror of
https://github.com/imputnet/helium.git
synced 2026-08-20 00:57:32 +02:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 2450f37f62 |
@@ -701,7 +701,7 @@
|
||||
// Sanity check for https://crbug.com/781703.
|
||||
--- a/components/helium_services/helium_services_helpers.cc
|
||||
+++ b/components/helium_services/helium_services_helpers.cc
|
||||
@@ -63,6 +63,11 @@ bool ShouldAccessExtensionService(const
|
||||
@@ -83,6 +83,11 @@ bool ShouldAccessExtensionService(const
|
||||
prefs.GetBoolean(prefs::kHeliumExtProxyEnabled);
|
||||
}
|
||||
|
||||
@@ -715,14 +715,14 @@
|
||||
return GetDummyURL();
|
||||
--- a/components/helium_services/helium_services_helpers.h
|
||||
+++ b/components/helium_services/helium_services_helpers.h
|
||||
@@ -20,6 +20,7 @@ const char kHeliumDummyOrigin[] =
|
||||
|
||||
bool ShouldAccessServices(const PrefService& prefs);
|
||||
@@ -29,6 +29,7 @@ COMPONENT_EXPORT(HELIUM) void ConfigureP
|
||||
COMPONENT_EXPORT(HELIUM) void ConfigurePrefChangeRegistrarFor(std::string_view pref_name,
|
||||
PrefChangeRegistrar& registrar, const base::RepeatingClosure& observer);
|
||||
|
||||
+COMPONENT_EXPORT(HELIUM) bool ShouldFetchBangs(const PrefService& prefs);
|
||||
COMPONENT_EXPORT(HELIUM) bool ShouldAccessExtensionService(const PrefService& prefs);
|
||||
COMPONENT_EXPORT(HELIUM) GURL GetServicesBaseURL(const PrefService& prefs);
|
||||
COMPONENT_EXPORT(HELIUM) GURL GetDummyURL();
|
||||
COMPONENT_EXPORT(HELIUM) GURL GetExtensionUpdateURL(const PrefService& prefs);
|
||||
COMPONENT_EXPORT(HELIUM) GURL GetWebstoreSnippetURL(const PrefService& prefs, std::string_view id);
|
||||
--- a/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
|
||||
+++ b/chrome/browser/ui/webui/settings/settings_localized_strings_provider.cc
|
||||
@@ -2355,6 +2355,9 @@ void AddPrivacyStrings(content::WebUIDat
|
||||
|
||||
@@ -12,20 +12,16 @@
|
||||
|
||||
--- a/components/helium_services/helium_services_helpers.h
|
||||
+++ b/components/helium_services/helium_services_helpers.h
|
||||
@@ -22,11 +22,13 @@ 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) GURL GetServicesBaseURL(const PrefService& prefs);
|
||||
COMPONENT_EXPORT(HELIUM) GURL GetDummyURL();
|
||||
COMPONENT_EXPORT(HELIUM) GURL GetExtensionUpdateURL(const PrefService& prefs);
|
||||
@@ -35,6 +35,9 @@ 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) bool ShouldAccessUpdateService(const PrefService& prefs);
|
||||
+COMPONENT_EXPORT(HELIUM) GURL GetBrowserUpdateURL(const PrefService& prefs);
|
||||
COMPONENT_EXPORT(HELIUM) std::optional<GURL> GetValidUserOverridenURL(std::string_view user_url_);
|
||||
COMPONENT_EXPORT(HELIUM) void ConfigurePrefChangeRegistrarFor(std::string_view pref_name,
|
||||
PrefChangeRegistrar& registrar, const base::RepeatingClosure& observer);
|
||||
+
|
||||
} // namespace helium
|
||||
|
||||
#endif // COMPONENTS_HELIUM_SERVICES_HELIUM_SERVICES_HELPERS_H_
|
||||
--- a/components/helium_services/helium_services_helpers.cc
|
||||
+++ b/components/helium_services/helium_services_helpers.cc
|
||||
@@ -6,6 +6,7 @@
|
||||
@@ -65,7 +61,7 @@
|
||||
|
||||
std::optional<GURL> GetValidUserOverridenURL(std::string_view user_url_) {
|
||||
if (user_url_.empty()) {
|
||||
@@ -73,6 +96,11 @@ bool ShouldFetchBangs(const PrefService&
|
||||
@@ -93,6 +116,11 @@ bool ShouldFetchBangs(const PrefService&
|
||||
prefs.GetBoolean(prefs::kHeliumBangsEnabled);
|
||||
}
|
||||
|
||||
@@ -77,7 +73,7 @@
|
||||
GURL GetExtensionUpdateURL(const PrefService& prefs) {
|
||||
if (!ShouldAccessExtensionService(prefs)) {
|
||||
return GetDummyURL();
|
||||
@@ -98,6 +126,24 @@ GURL GetSpellcheckURL(const PrefService&
|
||||
@@ -118,6 +146,24 @@ GURL GetSpellcheckURL(const PrefService&
|
||||
return GetServicesBaseURL(prefs).Resolve("/dict/");
|
||||
}
|
||||
|
||||
@@ -101,7 +97,7 @@
|
||||
+
|
||||
void ConfigurePrefChangeRegistrarFor(std::string_view pref_name,
|
||||
PrefChangeRegistrar& registrar, const base::RepeatingClosure& observer) {
|
||||
registrar.Add(prefs::kHeliumServicesEnabled, observer);
|
||||
ConfigurePrefChangeRegistrarForServices(registrar, observer);
|
||||
--- a/chrome/browser/resources/settings/privacy_page/services_page.html
|
||||
+++ b/chrome/browser/resources/settings/privacy_page/services_page.html
|
||||
@@ -99,6 +99,11 @@
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
#include "components/prefs/pref_service.h"
|
||||
#include "net/base/url_util.h"
|
||||
#include "url/gurl.h"
|
||||
@@ -101,6 +102,12 @@ bool ShouldAccessUpdateService(const Pre
|
||||
@@ -121,6 +122,12 @@ bool ShouldAccessUpdateService(const Pre
|
||||
prefs.GetBoolean(prefs::kHeliumUpdateFetchingEnabled);
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
bool ShouldAccessUBlockAssets(const PrefService& prefs) {
|
||||
return ShouldAccessServices(prefs) &&
|
||||
prefs.GetBoolean(prefs::kHeliumUBlockAssetsEnabled);
|
||||
@@ -149,6 +156,14 @@ GURL GetBrowserUpdateURL(const PrefServi
|
||||
@@ -169,6 +176,14 @@ GURL GetBrowserUpdateURL(const PrefServi
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -52,22 +52,16 @@
|
||||
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);
|
||||
@@ -41,6 +41,9 @@ COMPONENT_EXPORT(HELIUM) GURL GetBrowser
|
||||
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<GURL> GetValidUserOverridenURL(std::string_view user_url_);
|
||||
COMPONENT_EXPORT(HELIUM) void ConfigurePrefChangeRegistrarFor(std::string_view pref_name,
|
||||
|
||||
+COMPONENT_EXPORT(HELIUM) bool ShouldAccessComponentUpdateService(const PrefService& prefs);
|
||||
+COMPONENT_EXPORT(HELIUM) GURL GetComponentUpdateURL(const PrefService* prefs);
|
||||
+
|
||||
} // namespace helium
|
||||
|
||||
#endif // COMPONENTS_HELIUM_SERVICES_HELIUM_SERVICES_HELPERS_H_
|
||||
--- a/chrome/browser/component_updater/chrome_component_updater_configurator.cc
|
||||
+++ b/chrome/browser/component_updater/chrome_component_updater_configurator.cc
|
||||
@@ -26,11 +26,14 @@
|
||||
|
||||
@@ -0,0 +1,135 @@
|
||||
--- a/components/captive_portal/content/BUILD.gn
|
||||
+++ b/components/captive_portal/content/BUILD.gn
|
||||
@@ -33,6 +33,7 @@ source_set("content") {
|
||||
|
||||
deps = [
|
||||
"//components/embedder_support",
|
||||
+ "//components/helium_services",
|
||||
"//content/public/browser",
|
||||
"//third_party/blink/public/common",
|
||||
]
|
||||
--- a/components/captive_portal/content/captive_portal_service.cc
|
||||
+++ b/components/captive_portal/content/captive_portal_service.cc
|
||||
@@ -14,6 +14,7 @@
|
||||
#include "build/build_config.h"
|
||||
#include "components/captive_portal/core/captive_portal_types.h"
|
||||
#include "components/embedder_support/pref_names.h"
|
||||
+#include "components/helium_services/helium_services_helpers.h"
|
||||
#include "components/prefs/pref_service.h"
|
||||
#include "content/public/browser/browser_context.h"
|
||||
#include "content/public/browser/browser_thread.h"
|
||||
@@ -63,10 +64,11 @@ CaptivePortalService::CaptivePortalServi
|
||||
const base::TickClock* clock_for_testing,
|
||||
network::mojom::URLLoaderFactory* loader_factory_for_testing)
|
||||
: browser_context_(browser_context),
|
||||
+ pref_service_(pref_service),
|
||||
state_(STATE_IDLE),
|
||||
enabled_(false),
|
||||
last_detection_result_(RESULT_INTERNET_CONNECTED),
|
||||
- test_url_(CaptivePortalDetector::GetDefaultUrl()),
|
||||
+ test_url_(helium::GetConnectivityCheckURL(*pref_service)),
|
||||
tick_clock_for_testing_(clock_for_testing) {
|
||||
network::mojom::URLLoaderFactory* loader_factory;
|
||||
if (loader_factory_for_testing) {
|
||||
@@ -87,6 +89,11 @@ CaptivePortalService::CaptivePortalServi
|
||||
embedder_support::kAlternateErrorPagesEnabled, pref_service,
|
||||
base::BindRepeating(&CaptivePortalService::UpdateEnabledState,
|
||||
base::Unretained(this)));
|
||||
+ helium_services_pref_change_registrar_.Init(pref_service);
|
||||
+ helium::ConfigurePrefChangeRegistrarForServices(
|
||||
+ helium_services_pref_change_registrar_,
|
||||
+ base::BindRepeating(&CaptivePortalService::UpdateTestURL,
|
||||
+ base::Unretained(this)));
|
||||
ResetBackoffEntry(last_detection_result_);
|
||||
|
||||
UpdateEnabledState();
|
||||
@@ -260,6 +267,10 @@ void CaptivePortalService::UpdateEnabled
|
||||
}
|
||||
}
|
||||
|
||||
+void CaptivePortalService::UpdateTestURL() {
|
||||
+ test_url_ = helium::GetConnectivityCheckURL(*pref_service_);
|
||||
+}
|
||||
+
|
||||
base::TimeTicks CaptivePortalService::GetCurrentTimeTicks() const {
|
||||
if (tick_clock_for_testing_)
|
||||
return tick_clock_for_testing_->NowTicks();
|
||||
--- a/components/captive_portal/content/captive_portal_service.h
|
||||
+++ b/components/captive_portal/content/captive_portal_service.h
|
||||
@@ -15,6 +15,7 @@
|
||||
#include "components/captive_portal/core/captive_portal_detector.h"
|
||||
#include "components/captive_portal/core/captive_portal_types.h"
|
||||
#include "components/keyed_service/core/keyed_service.h"
|
||||
+#include "components/prefs/pref_change_registrar.h"
|
||||
#include "components/prefs/pref_member.h"
|
||||
#include "net/base/backoff_entry.h"
|
||||
#include "services/network/public/cpp/shared_url_loader_factory.h"
|
||||
@@ -33,6 +34,7 @@ class URLLoaderFactory;
|
||||
class Browser;
|
||||
class CaptivePortalBrowserTest;
|
||||
class HttpsUpgradesBrowserTest;
|
||||
+class PrefService;
|
||||
|
||||
namespace captive_portal {
|
||||
|
||||
@@ -164,6 +166,9 @@ class CaptivePortalService : public Keye
|
||||
// Android, since it lacks the Browser class.
|
||||
void UpdateEnabledState();
|
||||
|
||||
+ // Updates |test_url_| from the active Helium services settings.
|
||||
+ void UpdateTestURL();
|
||||
+
|
||||
base::TimeTicks GetCurrentTimeTicks() const;
|
||||
|
||||
bool DetectionInProgress() const;
|
||||
@@ -180,6 +185,10 @@ class CaptivePortalService : public Keye
|
||||
// The BrowserContext that owns this CaptivePortalService.
|
||||
const raw_ptr<content::BrowserContext> browser_context_;
|
||||
|
||||
+ // Owned by the same BrowserContext/Profile that owns this KeyedService and
|
||||
+ // outlives it.
|
||||
+ const raw_ptr<PrefService> pref_service_;
|
||||
+
|
||||
State state_;
|
||||
|
||||
scoped_refptr<network::SharedURLLoaderFactory> shared_url_loader_factory_;
|
||||
@@ -211,6 +220,8 @@ class CaptivePortalService : public Keye
|
||||
// URL that returns a 204 response code when connected to the Internet.
|
||||
GURL test_url_;
|
||||
|
||||
+ PrefChangeRegistrar helium_services_pref_change_registrar_;
|
||||
+
|
||||
// The pref member for whether navigation errors should be resolved with a web
|
||||
// service. Actually called "alternate_error_pages", since it's also used for
|
||||
// the Link Doctor.
|
||||
--- a/components/helium_services/helium_services_helpers.cc
|
||||
+++ b/components/helium_services/helium_services_helpers.cc
|
||||
@@ -56,6 +56,18 @@ bool ShouldAccessServices(const PrefServ
|
||||
return prefs.GetBoolean(prefs::kHeliumServicesEnabled);
|
||||
}
|
||||
|
||||
+GURL GetConnectivityCheckURL(const PrefService& prefs) {
|
||||
+ if (!ShouldAccessServices(prefs)) {
|
||||
+ return GetDummyURL();
|
||||
+ }
|
||||
+
|
||||
+ GURL::Replacements replacements;
|
||||
+ replacements.SetSchemeStr(url::kHttpScheme);
|
||||
+ return GetServicesBaseURL(prefs)
|
||||
+ .ReplaceComponents(replacements)
|
||||
+ .Resolve("/connectivitycheck");
|
||||
+}
|
||||
+
|
||||
void ConfigurePrefChangeRegistrarForServices(
|
||||
PrefChangeRegistrar& registrar, const base::RepeatingClosure& observer) {
|
||||
registrar.Add(prefs::kHeliumServicesEnabled, observer);
|
||||
--- a/components/helium_services/helium_services_helpers.h
|
||||
+++ b/components/helium_services/helium_services_helpers.h
|
||||
@@ -22,6 +22,7 @@ bool ShouldAccessServices(const PrefServ
|
||||
|
||||
COMPONENT_EXPORT(HELIUM) GURL GetServicesBaseURL(const PrefService& prefs);
|
||||
COMPONENT_EXPORT(HELIUM) GURL GetDummyURL();
|
||||
+COMPONENT_EXPORT(HELIUM) GURL GetConnectivityCheckURL(const PrefService& prefs);
|
||||
COMPONENT_EXPORT(HELIUM) std::optional<GURL> GetValidUserOverridenURL(std::string_view user_url_);
|
||||
COMPONENT_EXPORT(HELIUM) void ConfigurePrefChangeRegistrarForServices(
|
||||
PrefChangeRegistrar& registrar, const base::RepeatingClosure& observer);
|
||||
@@ -498,7 +498,7 @@
|
||||
|
||||
// Changes in the profile name.
|
||||
pref_change_registrar_.Add(
|
||||
@@ -1709,6 +1714,8 @@ void ProfileImpl::UpdateAvatarInStorage(
|
||||
@@ -1713,6 +1718,8 @@ void ProfileImpl::UpdateAvatarInStorage(
|
||||
GetPrefs()->GetBoolean(prefs::kProfileUsingDefaultAvatar));
|
||||
entry->SetIsUsingGAIAPicture(
|
||||
GetPrefs()->GetBoolean(prefs::kProfileUsingGAIAAvatar));
|
||||
|
||||
@@ -608,7 +608,7 @@
|
||||
+#endif // CHROME_BROWSER_UI_WEBUI_ONBOARDING_ONBOARDING_HANDLER_H_
|
||||
--- a/components/helium_services/helium_services_helpers.cc
|
||||
+++ b/components/helium_services/helium_services_helpers.cc
|
||||
@@ -53,12 +53,14 @@ GURL GetDummyURL() {
|
||||
@@ -53,7 +53,8 @@ GURL GetDummyURL() {
|
||||
}
|
||||
|
||||
bool ShouldAccessServices(const PrefService& prefs) {
|
||||
@@ -617,13 +617,15 @@
|
||||
+ prefs.GetBoolean(prefs::kHeliumServicesConsented);
|
||||
}
|
||||
|
||||
void ConfigurePrefChangeRegistrarFor(std::string_view pref_name,
|
||||
GURL GetConnectivityCheckURL(const PrefService& prefs) {
|
||||
@@ -71,6 +72,7 @@ GURL GetConnectivityCheckURL(const PrefS
|
||||
void ConfigurePrefChangeRegistrarForServices(
|
||||
PrefChangeRegistrar& registrar, const base::RepeatingClosure& observer) {
|
||||
registrar.Add(prefs::kHeliumServicesEnabled, observer);
|
||||
+ registrar.Add(prefs::kHeliumServicesConsented, observer);
|
||||
registrar.Add(prefs::kHeliumServicesOrigin, observer);
|
||||
registrar.Add(prefs::kHeliumSchemaVersion, observer);
|
||||
registrar.Add(pref_name, observer);
|
||||
}
|
||||
--- a/chrome/browser/ui/incognito_allowed_url.cc
|
||||
+++ b/chrome/browser/ui/incognito_allowed_url.cc
|
||||
@@ -52,7 +52,8 @@ bool IsHostAllowedInIncognito(const GURL
|
||||
|
||||
@@ -257,8 +257,8 @@
|
||||
#include "components/helium_services/pref_names.h"
|
||||
#include "components/prefs/pref_service.h"
|
||||
#include "net/base/url_util.h"
|
||||
@@ -57,6 +58,28 @@ bool ShouldAccessServices(const PrefServ
|
||||
prefs.GetBoolean(prefs::kHeliumServicesConsented);
|
||||
@@ -77,6 +78,28 @@ void ConfigurePrefChangeRegistrarForServ
|
||||
registrar.Add(prefs::kHeliumSchemaVersion, observer);
|
||||
}
|
||||
|
||||
+bool ShouldAccessExtensionService(const PrefService& prefs) {
|
||||
@@ -285,21 +285,21 @@
|
||||
+
|
||||
void ConfigurePrefChangeRegistrarFor(std::string_view pref_name,
|
||||
PrefChangeRegistrar& registrar, const base::RepeatingClosure& observer) {
|
||||
registrar.Add(prefs::kHeliumServicesEnabled, observer);
|
||||
ConfigurePrefChangeRegistrarForServices(registrar, observer);
|
||||
--- a/components/helium_services/helium_services_helpers.h
|
||||
+++ b/components/helium_services/helium_services_helpers.h
|
||||
@@ -20,8 +20,11 @@ const char kHeliumDummyOrigin[] =
|
||||
|
||||
bool ShouldAccessServices(const PrefService& prefs);
|
||||
|
||||
+COMPONENT_EXPORT(HELIUM) bool ShouldAccessExtensionService(const PrefService& prefs);
|
||||
COMPONENT_EXPORT(HELIUM) GURL GetServicesBaseURL(const PrefService& prefs);
|
||||
COMPONENT_EXPORT(HELIUM) GURL GetDummyURL();
|
||||
+COMPONENT_EXPORT(HELIUM) GURL GetExtensionUpdateURL(const PrefService& prefs);
|
||||
+COMPONENT_EXPORT(HELIUM) GURL GetWebstoreSnippetURL(const PrefService& prefs, std::string_view id);
|
||||
COMPONENT_EXPORT(HELIUM) std::optional<GURL> GetValidUserOverridenURL(std::string_view user_url_);
|
||||
@@ -28,6 +28,11 @@ COMPONENT_EXPORT(HELIUM) void ConfigureP
|
||||
PrefChangeRegistrar& registrar, const base::RepeatingClosure& observer);
|
||||
COMPONENT_EXPORT(HELIUM) void ConfigurePrefChangeRegistrarFor(std::string_view pref_name,
|
||||
PrefChangeRegistrar& registrar, const base::RepeatingClosure& observer);
|
||||
+
|
||||
+COMPONENT_EXPORT(HELIUM) bool ShouldAccessExtensionService(const PrefService& prefs);
|
||||
+COMPONENT_EXPORT(HELIUM) GURL GetExtensionUpdateURL(const PrefService& prefs);
|
||||
+COMPONENT_EXPORT(HELIUM) GURL GetWebstoreSnippetURL(const PrefService& prefs, std::string_view id);
|
||||
+
|
||||
} // namespace helium
|
||||
|
||||
#endif // COMPONENTS_HELIUM_SERVICES_HELIUM_SERVICES_HELPERS_H_
|
||||
--- a/chrome/browser/extensions/BUILD.gn
|
||||
+++ b/chrome/browser/extensions/BUILD.gn
|
||||
@@ -581,6 +581,7 @@ source_set("extensions") {
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
|
||||
--- a/components/helium_services/helium_services_helpers.cc
|
||||
+++ b/components/helium_services/helium_services_helpers.cc
|
||||
@@ -63,6 +63,11 @@ bool ShouldAccessExtensionService(const
|
||||
@@ -83,6 +83,11 @@ bool ShouldAccessExtensionService(const
|
||||
prefs.GetBoolean(prefs::kHeliumExtProxyEnabled);
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@
|
||||
bool ShouldFetchBangs(const PrefService& prefs) {
|
||||
return ShouldAccessServices(prefs) &&
|
||||
prefs.GetBoolean(prefs::kHeliumBangsEnabled);
|
||||
@@ -85,6 +90,14 @@ GURL GetWebstoreSnippetURL(const PrefSer
|
||||
@@ -105,6 +110,14 @@ GURL GetWebstoreSnippetURL(const PrefSer
|
||||
base::StringPrintf("/ext/cws_snippet?id=%s", id));
|
||||
}
|
||||
|
||||
@@ -71,17 +71,17 @@
|
||||
+
|
||||
void ConfigurePrefChangeRegistrarFor(std::string_view pref_name,
|
||||
PrefChangeRegistrar& registrar, const base::RepeatingClosure& observer) {
|
||||
registrar.Add(prefs::kHeliumServicesEnabled, observer);
|
||||
ConfigurePrefChangeRegistrarForServices(registrar, observer);
|
||||
--- a/components/helium_services/helium_services_helpers.h
|
||||
+++ b/components/helium_services/helium_services_helpers.h
|
||||
@@ -26,6 +26,7 @@ COMPONENT_EXPORT(HELIUM) GURL GetService
|
||||
COMPONENT_EXPORT(HELIUM) GURL GetDummyURL();
|
||||
@@ -33,6 +33,7 @@ COMPONENT_EXPORT(HELIUM) bool ShouldFetc
|
||||
COMPONENT_EXPORT(HELIUM) bool ShouldAccessExtensionService(const PrefService& prefs);
|
||||
COMPONENT_EXPORT(HELIUM) GURL GetExtensionUpdateURL(const PrefService& prefs);
|
||||
COMPONENT_EXPORT(HELIUM) GURL GetWebstoreSnippetURL(const PrefService& prefs, std::string_view id);
|
||||
+COMPONENT_EXPORT(HELIUM) GURL GetSpellcheckURL(const PrefService& prefs);
|
||||
COMPONENT_EXPORT(HELIUM) std::optional<GURL> GetValidUserOverridenURL(std::string_view user_url_);
|
||||
COMPONENT_EXPORT(HELIUM) void ConfigurePrefChangeRegistrarFor(std::string_view pref_name,
|
||||
PrefChangeRegistrar& registrar, const base::RepeatingClosure& observer);
|
||||
|
||||
} // namespace helium
|
||||
|
||||
--- a/components/helium_services/pref_names.h
|
||||
+++ b/components/helium_services/pref_names.h
|
||||
@@ -33,6 +33,9 @@ inline constexpr char kHeliumExtProxyEna
|
||||
|
||||
@@ -471,7 +471,7 @@
|
||||
+}
|
||||
--- /dev/null
|
||||
+++ b/components/helium_services/helium_services_helpers.cc
|
||||
@@ -0,0 +1,67 @@
|
||||
@@ -0,0 +1,72 @@
|
||||
+// Copyright 2025 The Helium Authors
|
||||
+// You can use, redistribute, and/or modify this source code under
|
||||
+// the terms of the GPL-3.0 license that can be found in the LICENSE file.
|
||||
@@ -530,18 +530,23 @@
|
||||
+ return prefs.GetBoolean(prefs::kHeliumServicesEnabled);
|
||||
+}
|
||||
+
|
||||
+void ConfigurePrefChangeRegistrarFor(std::string_view pref_name,
|
||||
+void ConfigurePrefChangeRegistrarForServices(
|
||||
+ PrefChangeRegistrar& registrar, const base::RepeatingClosure& observer) {
|
||||
+ registrar.Add(prefs::kHeliumServicesEnabled, observer);
|
||||
+ registrar.Add(prefs::kHeliumServicesOrigin, observer);
|
||||
+ registrar.Add(prefs::kHeliumSchemaVersion, observer);
|
||||
+}
|
||||
+
|
||||
+void ConfigurePrefChangeRegistrarFor(std::string_view pref_name,
|
||||
+ PrefChangeRegistrar& registrar, const base::RepeatingClosure& observer) {
|
||||
+ ConfigurePrefChangeRegistrarForServices(registrar, observer);
|
||||
+ registrar.Add(pref_name, observer);
|
||||
+}
|
||||
+
|
||||
+} // namespace helium
|
||||
--- /dev/null
|
||||
+++ b/components/helium_services/helium_services_helpers.h
|
||||
@@ -0,0 +1,30 @@
|
||||
@@ -0,0 +1,32 @@
|
||||
+// Copyright 2025 The Helium Authors
|
||||
+// You can use, redistribute, and/or modify this source code under
|
||||
+// the terms of the GPL-3.0 license that can be found in the LICENSE file.
|
||||
@@ -567,6 +572,8 @@
|
||||
+COMPONENT_EXPORT(HELIUM) GURL GetServicesBaseURL(const PrefService& prefs);
|
||||
+COMPONENT_EXPORT(HELIUM) GURL GetDummyURL();
|
||||
+COMPONENT_EXPORT(HELIUM) std::optional<GURL> GetValidUserOverridenURL(std::string_view user_url_);
|
||||
+COMPONENT_EXPORT(HELIUM) void ConfigurePrefChangeRegistrarForServices(
|
||||
+ PrefChangeRegistrar& registrar, const base::RepeatingClosure& observer);
|
||||
+COMPONENT_EXPORT(HELIUM) void ConfigurePrefChangeRegistrarFor(std::string_view pref_name,
|
||||
+ PrefChangeRegistrar& registrar, const base::RepeatingClosure& observer);
|
||||
+} // namespace helium
|
||||
@@ -683,7 +690,7 @@
|
||||
+#endif // CHROME_BROWSER_UI_WEBUI_SETTINGS_SERVICES_SCHEMA_HANDLER_H_
|
||||
--- /dev/null
|
||||
+++ b/components/helium_services/schema.cc
|
||||
@@ -0,0 +1,40 @@
|
||||
@@ -0,0 +1,46 @@
|
||||
+// Copyright 2025 The Helium Authors
|
||||
+// You can use, redistribute, and/or modify this source code under
|
||||
+// the terms of the GPL-3.0 license that can be found in the LICENSE file.
|
||||
@@ -717,7 +724,13 @@
|
||||
+ 1,
|
||||
+ "Automatic component updates are now available. They're managed by the same toggle that enables automatic browser updates.\n"
|
||||
+ "From now on, you'll be notified about major changes to Helium services. Even though these notifications are extremely rare, you can choose to ignore them and accept all future changes automatically."
|
||||
+ }
|
||||
+ },
|
||||
+ {
|
||||
+ 2,
|
||||
+ "Helium now checks whether the browser is behind a captive portal by sending an empty connectivity request "
|
||||
+ "to the configured Helium services origin when captive portal detection runs.\nThis is tied to the main "
|
||||
+ "Helium Services connection setting."
|
||||
+ },
|
||||
+ });
|
||||
+
|
||||
+ return kHeliumSchemaChangelog;
|
||||
@@ -740,7 +753,7 @@
|
||||
+
|
||||
+namespace helium {
|
||||
+
|
||||
+inline constexpr int kHeliumCurrentSchemaVersion = 1;
|
||||
+inline constexpr int kHeliumCurrentSchemaVersion = 2;
|
||||
+
|
||||
+using ServicesChangelog = const base::
|
||||
+ fixed_flat_map<int, std::string_view, kHeliumCurrentSchemaVersion>;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
--- a/components/helium_services/helium_services_helpers.cc
|
||||
+++ b/components/helium_services/helium_services_helpers.cc
|
||||
@@ -101,6 +101,11 @@ bool ShouldAccessUpdateService(const Pre
|
||||
@@ -121,6 +121,11 @@ bool ShouldAccessUpdateService(const Pre
|
||||
prefs.GetBoolean(prefs::kHeliumUpdateFetchingEnabled);
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
GURL GetExtensionUpdateURL(const PrefService& prefs) {
|
||||
if (!ShouldAccessExtensionService(prefs)) {
|
||||
return GetDummyURL();
|
||||
@@ -144,6 +149,14 @@ GURL GetBrowserUpdateURL(const PrefServi
|
||||
@@ -164,6 +169,14 @@ GURL GetBrowserUpdateURL(const PrefServi
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -26,24 +26,19 @@
|
||||
+
|
||||
void ConfigurePrefChangeRegistrarFor(std::string_view pref_name,
|
||||
PrefChangeRegistrar& registrar, const base::RepeatingClosure& observer) {
|
||||
registrar.Add(prefs::kHeliumServicesEnabled, observer);
|
||||
ConfigurePrefChangeRegistrarForServices(registrar, observer);
|
||||
--- a/components/helium_services/helium_services_helpers.h
|
||||
+++ b/components/helium_services/helium_services_helpers.h
|
||||
@@ -23,12 +23,14 @@ bool ShouldAccessServices(const PrefServ
|
||||
COMPONENT_EXPORT(HELIUM) bool ShouldFetchBangs(const PrefService& prefs);
|
||||
COMPONENT_EXPORT(HELIUM) bool ShouldAccessExtensionService(const PrefService& prefs);
|
||||
@@ -38,6 +38,9 @@ COMPONENT_EXPORT(HELIUM) GURL GetSpellch
|
||||
COMPONENT_EXPORT(HELIUM) bool ShouldAccessUpdateService(const PrefService& prefs);
|
||||
+COMPONENT_EXPORT(HELIUM) bool ShouldAccessUBlockAssets(const PrefService& prefs);
|
||||
COMPONENT_EXPORT(HELIUM) GURL GetServicesBaseURL(const PrefService& prefs);
|
||||
COMPONENT_EXPORT(HELIUM) GURL GetDummyURL();
|
||||
COMPONENT_EXPORT(HELIUM) GURL GetExtensionUpdateURL(const PrefService& prefs);
|
||||
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) bool ShouldAccessUBlockAssets(const PrefService& prefs);
|
||||
+COMPONENT_EXPORT(HELIUM) GURL GetUBlockAssetsURL(const PrefService& prefs);
|
||||
COMPONENT_EXPORT(HELIUM) std::optional<GURL> GetValidUserOverridenURL(std::string_view user_url_);
|
||||
COMPONENT_EXPORT(HELIUM) void ConfigurePrefChangeRegistrarFor(std::string_view pref_name,
|
||||
PrefChangeRegistrar& registrar, const base::RepeatingClosure& observer);
|
||||
+
|
||||
} // namespace helium
|
||||
|
||||
#endif // COMPONENTS_HELIUM_SERVICES_HELIUM_SERVICES_HELPERS_H_
|
||||
--- a/components/helium_services/pref_names.h
|
||||
+++ b/components/helium_services/pref_names.h
|
||||
@@ -39,6 +39,8 @@ inline constexpr char kHeliumUpdateFetch
|
||||
|
||||
@@ -106,6 +106,7 @@ helium/core/disable-unsupported-importers.patch
|
||||
helium/core/fix-building-without-safebrowsing.patch
|
||||
helium/core/services-prefs.patch
|
||||
helium/core/services-schema-nag.patch
|
||||
helium/core/connectivity-check.patch
|
||||
helium/core/override-chrome-protocol.patch
|
||||
helium/core/onboarding-page.patch
|
||||
helium/core/change-chromium-branding.patch
|
||||
|
||||
Reference in New Issue
Block a user