Allow swapping out internal WebViewManager implementation.

Everything moved to interfaces.
This commit is contained in:
Pieter-Jan Briers
2021-11-03 15:12:49 +01:00
parent 3770149cfc
commit dae6424667
20 changed files with 775 additions and 547 deletions

View File

@@ -0,0 +1,32 @@
using Xilium.CefGlue;
namespace Robust.Client.WebView.Cef
{
internal sealed class CefBeforeBrowseContext : IBeforeBrowseContext
{
internal readonly CefRequest CefRequest;
public string Url => CefRequest.Url;
public string Method => CefRequest.Method;
public bool IsRedirect { get; }
public bool UserGesture { get; }
public bool IsCancelled { get; private set; }
internal CefBeforeBrowseContext(
bool isRedirect,
bool userGesture,
CefRequest cefRequest)
{
CefRequest = cefRequest;
IsRedirect = isRedirect;
UserGesture = userGesture;
}
public void DoCancel()
{
IsCancelled = true;
}
}
}