Content settings infrastructure: fix crash (#2727)

This commit is contained in:
Carmelo Messina
2026-02-18 17:03:59 +01:00
parent ce00a93d11
commit 7c97ec46c1
@@ -42,7 +42,7 @@ Require: bromite-build-utils.patch
.../res/xml/site_settings_preferences.xml | 7 +
.../site_settings/AllSiteSettings.java | 5 +-
.../BromiteCustomContentSetting.java | 155 +++++++
.../BromiteCustomContentSettingImpl.java | 415 ++++++++++++++++++
.../BromiteCustomContentSettingImpl.java | 416 ++++++++++++++++++
...tomTriStateSiteSettingsPreferenceImpl.java | 24 +
.../ContentSettingsResources.java | 32 +-
.../site_settings/SingleCategorySettings.java | 57 ++-
@@ -84,7 +84,7 @@ Require: bromite-build-utils.patch
.../platform/web_content_settings_client.h | 13 +
.../execution_context/execution_context.cc | 16 +
.../execution_context/execution_context.h | 5 +
73 files changed, 1963 insertions(+), 106 deletions(-)
73 files changed, 1964 insertions(+), 106 deletions(-)
create mode 100644 components/browser_ui/settings/android/java/res/layout/preference_spinner_single_widget.xml
create mode 100644 components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/BromiteCustomContentSetting.java
create mode 100644 components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/BromiteCustomContentSettingImpl.java
@@ -1776,7 +1776,7 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c
new file mode 100644
--- /dev/null
+++ b/components/browser_ui/site_settings/android/java/src/org/chromium/components/browser_ui/site_settings/BromiteCustomContentSettingImpl.java
@@ -0,0 +1,415 @@
@@ -0,0 +1,416 @@
+/*
+ This file is part of Bromite.
+
@@ -2021,7 +2021,8 @@ new file mode 100644
+ continue;
+ }
+
+ if (SingleCategorySettings.BINARY_TOGGLE_KEY.equals(preference.getKey())) {
+ if (SingleCategorySettings.BINARY_RADIO_BUTTON_KEY.equals(preference.getKey())
+ || SingleCategorySettings.BINARY_TOGGLE_KEY.equals(preference.getKey())) {
+ int setting = ((boolean) newValue) == true ? cs.getDefaultEnabledValue() :
+ cs.getDefaultDisabledValue();
+
@@ -2349,7 +2350,7 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c
BrowserContextHandle browserContextHandle = getBrowserContextHandle();
PrefService prefService = UserPrefs.get(browserContextHandle);
+ if (BromiteCustomContentSettingImpl.onPreferenceChange(mCategory,
+ browserContextHandle, preference, newValue) == true) {
+ browserContextHandle, preference, newValue)) {
+ getInfoForOrigins();
+ return true;
+ }