Add privacy history settings
This commit is contained in:
@@ -7,6 +7,7 @@ mod history;
|
||||
mod identifiers;
|
||||
mod new_tab;
|
||||
mod plugin;
|
||||
mod privacy;
|
||||
mod profile;
|
||||
mod reading_list;
|
||||
mod search;
|
||||
@@ -34,6 +35,7 @@ pub use plugin::{
|
||||
PluginContributionPoint, PluginId, PluginManifest, PluginPermission, PluginPermissionRisk,
|
||||
PluginSignature, PluginSignatureAlgorithm,
|
||||
};
|
||||
pub use privacy::HistoryRecordingPolicy;
|
||||
pub use profile::{Profile, ProfileKind};
|
||||
pub use reading_list::{ReadingListEntry, ReadingProgress};
|
||||
pub use search::SearchEngine;
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
#[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
|
||||
pub enum HistoryRecordingPolicy {
|
||||
#[default]
|
||||
Record,
|
||||
Pause,
|
||||
}
|
||||
|
||||
impl HistoryRecordingPolicy {
|
||||
pub const ALL: &[Self] = &[Self::Record, Self::Pause];
|
||||
|
||||
#[must_use]
|
||||
pub fn records_history(self) -> bool {
|
||||
matches!(self, Self::Record)
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
pub fn name(self) -> &'static str {
|
||||
match self {
|
||||
Self::Record => "Record History",
|
||||
Self::Pause => "Pause History",
|
||||
}
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
pub fn detail(self) -> &'static str {
|
||||
match self {
|
||||
Self::Record => "Save new web visits for Standard Profiles.",
|
||||
Self::Pause => "Skip new history entries for Standard Profiles.",
|
||||
}
|
||||
}
|
||||
|
||||
#[must_use]
|
||||
pub fn status(self) -> &'static str {
|
||||
match self {
|
||||
Self::Record => "History recording is on",
|
||||
Self::Pause => "History recording is paused",
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user