mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +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
|
@ -8,6 +8,7 @@ using namespace winrt::Windows::Graphics::Display;
|
|||
using namespace winrt::Windows::UI::Xaml;
|
||||
using namespace winrt::Windows::UI::Core;
|
||||
using namespace winrt::Windows::Foundation;
|
||||
using namespace winrt::Windows::System;
|
||||
using namespace concurrency;
|
||||
using namespace winrt::servo;
|
||||
|
||||
|
@ -270,7 +271,14 @@ void ServoControl::WakeUp() {
|
|||
RunOnGLThread([=] {});
|
||||
}
|
||||
|
||||
bool ServoControl::OnServoAllowNavigation(hstring) { return true; }
|
||||
bool ServoControl::OnServoAllowNavigation(hstring uri) {
|
||||
if (mTransient) {
|
||||
RunOnUIThread([=] {
|
||||
Launcher::LaunchUriAsync(Uri{uri});
|
||||
});
|
||||
}
|
||||
return !mTransient;
|
||||
}
|
||||
|
||||
void ServoControl::OnServoAnimatingChanged(bool animating) {
|
||||
EnterCriticalSection(&mGLLock);
|
||||
|
|
|
@ -69,6 +69,8 @@ struct ServoControl : ServoControlT<ServoControl>, public servo::ServoDelegate {
|
|||
mOnCaptureGesturesEndedEvent.remove(token);
|
||||
}
|
||||
|
||||
void SetTransientMode(bool transient) { mTransient = transient; }
|
||||
|
||||
virtual void WakeUp();
|
||||
virtual void OnServoLoadStarted();
|
||||
virtual void OnServoLoadEnded();
|
||||
|
@ -94,6 +96,7 @@ private:
|
|||
|
||||
float mDPI = 1;
|
||||
hstring mInitialURL = L"https://servo.org";
|
||||
bool mTransient = false;
|
||||
|
||||
Windows::UI::Xaml::Controls::SwapChainPanel ServoControl::Panel();
|
||||
void CreateRenderSurface();
|
||||
|
|
|
@ -10,6 +10,7 @@ namespace ServoApp {
|
|||
void Reload();
|
||||
void Stop();
|
||||
Windows.Foundation.Uri LoadURIOrSearch(String url);
|
||||
void SetTransientMode(Boolean transient);
|
||||
void Shutdown();
|
||||
event EventDelegate OnLoadStarted;
|
||||
event EventDelegate OnLoadEnded;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue