diff --git a/fpCefSharp/fpCallback.cs b/fpCefSharp/fpCallback.cs deleted file mode 100644 index e17909e..0000000 --- a/fpCefSharp/fpCallback.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System; -using CefSharp; - -namespace fpDotNet.fpCefSharp -{ - public class fpCallback - { - /// - /// Instance of a cefSharpBroweser class from cefSharpBroweser.prg. - /// Each instance is bound to once IBrowser instance. - /// - readonly dynamic VfpHandler; - - public fpCallback(Object callback) - { - if (callback == null) - throw new ArgumentNullException(nameof(callback)); - - VfpHandler = callback; - } - - public void OnProcessRequest(ResourceHandler resourceHandler, IRequest request) - { - VfpHandler.OnProcessRequest(resourceHandler, request); - } - } -} \ No newline at end of file diff --git a/fpCefSharp/fpHandler.cs b/fpCefSharp/fpHandler.cs deleted file mode 100644 index d1d93c8..0000000 --- a/fpCefSharp/fpHandler.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Threading.Tasks; -using CefSharp; - -namespace fpDotNet.fpCefSharp -{ - internal class fpHandler : ResourceHandler - { - readonly fpCallback Handler; - - public fpHandler(fpCallback handler) - { - Handler = handler; - } - - /// - /// Process request and craft response. - /// - /// the request object from CefSharp - /// the object we call when we are done with processing - /// - public override CefReturnValue ProcessRequestAsync(IRequest request, ICallback callback) - { - Task.Run(() => - { - using (callback) - { - Handler.OnProcessRequest(this, request); - callback.Continue(); - } - }); - - return CefReturnValue.ContinueAsync; - } - } -} \ No newline at end of file diff --git a/fpCefSharp/fpSchemeHandlerFactory.cs b/fpCefSharp/fpSchemeHandlerFactory.cs deleted file mode 100644 index e49559d..0000000 --- a/fpCefSharp/fpSchemeHandlerFactory.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System; -using System.Collections.Generic; -using CefSharp; - -namespace fpDotNet.fpCefSharp -{ - public class fpSchemeHandlerFactory : ISchemeHandlerFactory - { - public fpSchemeHandlerFactory() { } - - static readonly Dictionary RegisteredClients = new Dictionary(); - - public static void RegisterCallback(IBrowser browser, Object callback) - { - var handler = new fpCallback(callback); - RegisteredClients.Add(browser.Identifier, handler); - } - - public static void UnregisterCallback(IBrowser browser) - { - if (RegisteredClients.ContainsKey(browser.Identifier)) - RegisteredClients.Remove(browser.Identifier); - } - - public IResourceHandler Create(IBrowser browser, IFrame frame, string schemeName, IRequest request) - { - if (RegisteredClients.ContainsKey(browser.Identifier)) - { - var callback = RegisteredClients[browser.Identifier]; - return new fpHandler(callback); - } - - return null; - } - } -} \ No newline at end of file