Add diagnostics privacy controls
This commit is contained in:
@@ -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