Add diagnostics privacy controls
This commit is contained in:
@@ -42,7 +42,7 @@ pub use plugin::{
|
||||
PluginContributionPoint, PluginId, PluginManifest, PluginPermission, PluginPermissionRisk,
|
||||
PluginSignature, PluginSignatureAlgorithm,
|
||||
};
|
||||
pub use privacy::HistoryRecordingPolicy;
|
||||
pub use privacy::{DiagnosticsReportingPolicy, HistoryRecordingPolicy};
|
||||
pub use profile::{Profile, ProfileKind, ProfileSyncPolicy};
|
||||
pub use reading_list::{ReadingListEntry, ReadingProgress, ReadingProgressPercent};
|
||||
pub use search::SearchEngine;
|
||||
|
||||
@@ -37,3 +37,45 @@ impl HistoryRecordingPolicy {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
|
||||
pub enum DiagnosticsReportingPolicy {
|
||||
#[default]
|
||||
Minimal,
|
||||
Paused,
|
||||
}
|
||||
|
||||
impl DiagnosticsReportingPolicy {
|
||||
pub const ALL: &[Self] = &[Self::Minimal, Self::Paused];
|
||||
|
||||
#[must_use]
|
||||
pub fn reports_diagnostics(self) -> bool {
|
||||
matches!(self, Self::Minimal)
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
pub fn name(self) -> &'static str {
|
||||
match self {
|
||||
Self::Minimal => "Minimal Diagnostics",
|
||||
Self::Paused => "Paused Diagnostics",
|
||||
}
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
pub fn detail(self) -> &'static str {
|
||||
match self {
|
||||
Self::Minimal => {
|
||||
"Send startup, crash, WebView crash, sync error, plugin crash, and update result codes."
|
||||
}
|
||||
Self::Paused => "Keep diagnostics local for review and privacy exports.",
|
||||
}
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
pub fn status(self) -> &'static str {
|
||||
match self {
|
||||
Self::Minimal => "Diagnostics reporting is on",
|
||||
Self::Paused => "Diagnostics reporting is paused",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user