make safe browsing a dedicated setting
This commit is contained in:
+74
@@ -55,6 +55,7 @@ class PrivacySecuritySettingsScreen extends StatelessWidget {
|
||||
_NetworkProtectionSection(),
|
||||
_PrivacySignalsSection(),
|
||||
_DataManagementSection(),
|
||||
_SafeBrowsingSection(),
|
||||
_AdvancedSecuritySection(),
|
||||
],
|
||||
);
|
||||
@@ -145,6 +146,21 @@ class _PrivacySignalsSection extends StatelessWidget {
|
||||
}
|
||||
}
|
||||
|
||||
class _SafeBrowsingSection extends StatelessWidget {
|
||||
const _SafeBrowsingSection();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return const Column(
|
||||
children: [
|
||||
SettingSection(name: 'Google Safe Browsing'),
|
||||
_SafeBrowsingMalwareTile(),
|
||||
_SafeBrowsingPhishingTile(),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class _DataManagementSection extends StatelessWidget {
|
||||
const _DataManagementSection();
|
||||
|
||||
@@ -739,6 +755,64 @@ class _FissionEnabledTile extends HookConsumerWidget {
|
||||
}
|
||||
}
|
||||
|
||||
class _SafeBrowsingMalwareTile extends HookConsumerWidget {
|
||||
const _SafeBrowsingMalwareTile();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final safeBrowsingMalwareEnabled = ref.watch(
|
||||
engineSettingsWithDefaultsProvider.select(
|
||||
(s) => s.safeBrowsingMalwareEnabled,
|
||||
),
|
||||
);
|
||||
|
||||
return SwitchListTile.adaptive(
|
||||
title: const Text('Safe Browsing Malware Protection'),
|
||||
subtitle: const Text(
|
||||
'Warn about dangerous websites and malicious downloads.',
|
||||
),
|
||||
secondary: const Icon(Icons.bug_report_outlined),
|
||||
value: safeBrowsingMalwareEnabled,
|
||||
onChanged: (value) async {
|
||||
await ref
|
||||
.read(saveEngineSettingsControllerProvider.notifier)
|
||||
.save(
|
||||
(currentSettings) =>
|
||||
currentSettings.copyWith.safeBrowsingMalwareEnabled(value),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class _SafeBrowsingPhishingTile extends HookConsumerWidget {
|
||||
const _SafeBrowsingPhishingTile();
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final safeBrowsingPhishingEnabled = ref.watch(
|
||||
engineSettingsWithDefaultsProvider.select(
|
||||
(s) => s.safeBrowsingPhishingEnabled,
|
||||
),
|
||||
);
|
||||
|
||||
return SwitchListTile.adaptive(
|
||||
title: const Text('Safe Browsing Phishing Protection'),
|
||||
subtitle: const Text('Warn about deceptive websites and login pages.'),
|
||||
secondary: const Icon(Icons.gpp_maybe_outlined),
|
||||
value: safeBrowsingPhishingEnabled,
|
||||
onChanged: (value) async {
|
||||
await ref
|
||||
.read(saveEngineSettingsControllerProvider.notifier)
|
||||
.save(
|
||||
(currentSettings) =>
|
||||
currentSettings.copyWith.safeBrowsingPhishingEnabled(value),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class _ExtensionsWebAPIEnabledTile extends HookConsumerWidget {
|
||||
const _ExtensionsWebAPIEnabledTile();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user