mirror of
https://github.com/chylex/TweetDuck.git
synced 2025-08-17 00:31:42 +02:00
.github
.idea
bld
lib
linux
resources
windows
TweetDuck
TweetDuck.Browser
TweetDuck.Video
TweetImpl.CefSharp
Adapters
CefAdapter.cs
CefBrowserAdapter.cs
CefDragDataAdapter.cs
CefErrorCodeAdapter.cs
CefFileDialogCallbackAdapter.cs
CefFrameAdapter.cs
CefJsDialogCallbackAdapter.cs
CefMenuModelAdapter.cs
CefRequestAdapter.cs
CefResponseAdapter.cs
Component
Dialogs
Handlers
Properties
TweetImpl.CefSharp.csproj
TweetLib.WinForms.Legacy
.gitattributes
.gitignore
LICENSE.md
README.md
TweetDuck.sln
TweetDuck.sln.DotSettings
Version.cs
global.json
32 lines
875 B
C#
32 lines
875 B
C#
using CefSharp;
|
|
using CefSharp.WinForms;
|
|
using TweetImpl.CefSharp.Handlers;
|
|
using TweetLib.Browser.CEF.Data;
|
|
using TweetLib.Browser.CEF.Interfaces;
|
|
|
|
namespace TweetImpl.CefSharp.Adapters {
|
|
sealed class CefBrowserAdapter : IBrowserWrapper<IFrame, IRequest> {
|
|
public string Url => browser.Address;
|
|
public IFrame MainFrame => browser.GetMainFrame();
|
|
|
|
private readonly ChromiumWebBrowser browser;
|
|
|
|
public CefBrowserAdapter(ChromiumWebBrowser browser) {
|
|
this.browser = browser;
|
|
}
|
|
|
|
public void AddWordToDictionary(string word) {
|
|
browser.AddWordToDictionary(word);
|
|
}
|
|
|
|
public IRequest CreateGetRequest() {
|
|
using var frame = MainFrame;
|
|
return frame.CreateRequest(false);
|
|
}
|
|
|
|
public void RequestDownload(IFrame frame, IRequest request, DownloadCallbacks callbacks) {
|
|
frame.CreateUrlRequest(request, new CefDownloadRequestClient(callbacks));
|
|
}
|
|
}
|
|
}
|