Add private window entry point

This commit is contained in:
2026-05-09 00:31:40 -04:00
parent 97a06d7b52
commit 7797203bbf
6 changed files with 139 additions and 29 deletions
+13 -1
View File
@@ -77,6 +77,18 @@ pub struct ElyShell {
impl ElyShell {
pub fn new(window: &mut Window, cx: &mut Context<Self>) -> Self {
Self::new_with_config(InitialBrowserConfig::ely_defaults(), window, cx)
}
pub fn new_private(window: &mut Window, cx: &mut Context<Self>) -> Self {
Self::new_with_config(InitialBrowserConfig::private_window(), window, cx)
}
fn new_with_config(
config: Result<InitialBrowserConfig, ely_domain::DomainError>,
window: &mut Window,
cx: &mut Context<Self>,
) -> Self {
let command_input =
cx.new(|cx| InputState::new(window, cx).placeholder("Search or enter address"));
@@ -112,7 +124,7 @@ impl ElyShell {
},
);
let state = match InitialBrowserConfig::ely_defaults().and_then(|config| {
let state = match config.and_then(|config| {
BrowserCore::new(config).map_err(|error| match error {
ely_browser_core::CoreError::Domain(source) => source,
_ => ely_domain::DomainError::InvalidCommand,