mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Switch to chromeless mode when app opens from a servo:// link
This commit is contained in:
parent
3ade7b680d
commit
5fe9a6223d
7 changed files with 26 additions and 2 deletions
|
@ -71,7 +71,8 @@ void App::OnActivated(IActivatedEventArgs const &args) {
|
|||
Frame rootFrame{nullptr};
|
||||
|
||||
auto content = Window::Current().Content();
|
||||
if (content == nullptr) {
|
||||
bool isRunning = content != nullptr;
|
||||
if (!isRunning) {
|
||||
rootFrame = Frame();
|
||||
rootFrame.Navigate(xaml_typename<ServoApp::BrowserPage>());
|
||||
Window::Current().Content(rootFrame);
|
||||
|
@ -81,6 +82,9 @@ void App::OnActivated(IActivatedEventArgs const &args) {
|
|||
}
|
||||
auto page = rootFrame.Content().try_as<BrowserPage>();
|
||||
page->LoadServoURI(protocolActivatedEventArgs.Uri());
|
||||
// If Servo was opened as a result of clicking on a servo:// URL,
|
||||
// we activate transient mode.
|
||||
page->SetTransientMode(!isRunning);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue