mirror of
https://github.com/chylex/TweetDuck.git
synced 2025-08-16 06:31:42 +02:00
.github
.idea
bld
lib
linux
resources
windows
TweetDuck
TweetDuck.Browser
TweetDuck.Video
TweetImpl.CefSharp
Adapters
Component
Dialogs
Handlers
CefByteArrayResourceHandler.cs
CefContextMenuHandler.cs
CefDownloadRequestClient.cs
CefDragHandler.cs
CefFileDialogHandler.cs
CefJsDialogHandler.cs
CefLifeSpanHandler.cs
CefRequestHandler.cs
CefResourceHandlerFactory.cs
CefResourceRequestHandler.cs
CefResourceRequestHandlerFactory.cs
CefResponseFilter.cs
CefSchemeHandlerFactory.cs
Properties
TweetImpl.CefSharp.csproj
TweetLib.WinForms.Legacy
.gitattributes
.gitignore
LICENSE.md
README.md
TweetDuck.sln
TweetDuck.sln.DotSettings
Version.cs
global.json
32 lines
1.0 KiB
C#
32 lines
1.0 KiB
C#
using System.IO;
|
|
using CefSharp;
|
|
using TweetLib.Browser.CEF.Data;
|
|
using TweetLib.Browser.CEF.Logic;
|
|
using static TweetLib.Browser.CEF.Logic.DownloadRequestClientLogic.RequestStatus;
|
|
|
|
namespace TweetImpl.CefSharp.Handlers {
|
|
sealed class CefDownloadRequestClient : UrlRequestClient {
|
|
private readonly DownloadRequestClientLogic logic;
|
|
|
|
public CefDownloadRequestClient(DownloadCallbacks callbacks) {
|
|
this.logic = new DownloadRequestClientLogic(callbacks);
|
|
}
|
|
|
|
protected override bool GetAuthCredentials(bool isProxy, string host, int port, string realm, string scheme, IAuthCallback callback) {
|
|
return logic.GetAuthCredentials(callback);
|
|
}
|
|
|
|
protected override void OnDownloadData(IUrlRequest request, Stream data) {
|
|
logic.OnDownloadData(data);
|
|
}
|
|
|
|
protected override void OnRequestComplete(IUrlRequest request) {
|
|
logic.OnRequestComplete(request.RequestStatus switch {
|
|
UrlRequestStatus.Success => Success,
|
|
UrlRequestStatus.Failed => Failed,
|
|
_ => Unknown
|
|
});
|
|
}
|
|
}
|
|
}
|