mirror of
https://github.com/chylex/TweetDuck.git
synced 2025-08-17 00:31:42 +02:00
.github
.idea
bld
lib
linux
.idea
TweetDuck
TweetImpl.CefGlue
Adapters
Component
Dialogs
Handlers
Resource
ContextMenuHandler.cs
DialogHandler.cs
DownloadRequestClient.cs
DragHandler.cs
JsDialogHandler.cs
LifeSpanHandler.cs
RequestHandler.cs
ResourceRequestHandler.cs
ResourceRequestHandlerFactory.cs
ResponseFilter.cs
Resources
Utils
Lib.cs
TweetImpl.CefGlue.csproj
.gitignore
Directory.Build.props
TweetDuck.Linux.sln
global.json
publish.sh
resources
windows
.gitattributes
.gitignore
LICENSE.md
README.md
TweetDuck.sln
TweetDuck.sln.DotSettings
Version.cs
global.json
34 lines
1.3 KiB
C#
34 lines
1.3 KiB
C#
using TweetImpl.CefGlue.Adapters;
|
|
using TweetLib.Browser.CEF.Logic;
|
|
using TweetLib.Browser.Contexts;
|
|
using TweetLib.Browser.Interfaces;
|
|
using Xilium.CefGlue;
|
|
|
|
namespace TweetImpl.CefGlue.Handlers {
|
|
public abstract class ContextMenuHandler : CefContextMenuHandler {
|
|
private readonly ContextMenuLogic<CefMenuModel> logic;
|
|
|
|
protected ContextMenuHandler(IContextMenuHandler? handler) {
|
|
this.logic = new ContextMenuLogic<CefMenuModel>(handler, CefMenuModelAdapter.Instance);
|
|
}
|
|
|
|
protected abstract Context CreateContext(CefContextMenuParams parameters);
|
|
|
|
protected override void OnBeforeContextMenu(CefBrowser browser, CefFrame frame, CefContextMenuParams state, CefMenuModel model) {
|
|
logic.OnBeforeContextMenu(model, CreateContext(state));
|
|
}
|
|
|
|
protected override bool OnContextMenuCommand(CefBrowser browser, CefFrame frame, CefContextMenuParams state, int commandId, CefEventFlags eventFlags) {
|
|
return logic.OnContextMenuCommand(commandId);
|
|
}
|
|
|
|
protected override void OnContextMenuDismissed(CefBrowser browser, CefFrame frame) {
|
|
logic.OnContextMenuDismissed();
|
|
}
|
|
|
|
protected override bool RunContextMenu(CefBrowser browser, CefFrame frame, CefContextMenuParams parameters, CefMenuModel model, CefRunContextMenuCallback callback) {
|
|
return logic.RunContextMenu();
|
|
}
|
|
}
|
|
}
|