Files
cromite/build/patches/Disable-Web-Bluetooth-by-default-in-desktop-platforms.patch
2026-02-01 15:18:16 +01:00

40 lines
2.0 KiB
Diff

From: uazo <uazo@users.noreply.github.com>
Date: Fri, 24 Jan 2025 14:32:14 +0000
Subject: Disable Web Bluetooth by default in desktop platforms
On desktop platforms, disable Bluetooth by default and activate the user-manageable content setting ui.
License: GPL-2.0-or-later - https://spdx.org/licenses/GPL-2.0-or-later.html
---
.../core/browser/content_settings_registry.cc | 5 +++++
.../content_features_cc/Disable-Web-Bluetooth-by-default.inc | 3 +++
2 files changed, 8 insertions(+)
create mode 100644 cromite_flags/content/public/common/content_features_cc/Disable-Web-Bluetooth-by-default.inc
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
@@ -346,8 +346,13 @@ void ContentSettingsRegistry::Init() {
ContentSettingsInfo::INHERIT_IF_LESS_PERMISSIVE,
PermissionSettingsInfo::EXCEPTIONS_ON_SECURE_AND_INSECURE_ORIGINS);
+#if BUILDFLAG(IS_ANDROID)
Register(ContentSettingsType::BLUETOOTH_GUARD, "bluetooth-guard",
CONTENT_SETTING_ASK, WebsiteSettingsInfo::UNSYNCABLE,
+#else
+ Register(ContentSettingsType::BLUETOOTH_GUARD, "bluetooth-guard2",
+ CONTENT_SETTING_BLOCK, WebsiteSettingsInfo::UNSYNCABLE,
+#endif
/*allowlisted_primary_schemes=*/{},
/*valid_settings=*/{CONTENT_SETTING_ASK, CONTENT_SETTING_BLOCK},
WebsiteSettingsInfo::TOP_ORIGIN_ONLY_SCOPE,
diff --git a/cromite_flags/content/public/common/content_features_cc/Disable-Web-Bluetooth-by-default.inc b/cromite_flags/content/public/common/content_features_cc/Disable-Web-Bluetooth-by-default.inc
new file mode 100644
--- /dev/null
+++ b/cromite_flags/content/public/common/content_features_cc/Disable-Web-Bluetooth-by-default.inc
@@ -0,0 +1,3 @@
+#if !BUILDFLAG(IS_ANDROID)
+SET_CROMITE_FEATURE_ENABLED(kWebBluetoothNewPermissionsBackend);
+#endif
--