CustomSchemeHandlerFactory.cs 542 B

12345678910111213141516171819
  1. using CefGlue.Tests.Helpers;
  2. using Xilium.CefGlue;
  3. using Xilium.CefGlue.Common.Handlers;
  4. namespace CefGlue.Tests.CustomSchemes
  5. {
  6. class CustomSchemeHandlerFactory : CefSchemeHandlerFactory
  7. {
  8. public const string SchemeName = "test";
  9. protected override CefResourceHandler Create(CefBrowser browser, CefFrame frame, string schemeName, CefRequest request)
  10. {
  11. return new DefaultResourceHandler()
  12. {
  13. Response = StreamHelper.GetStream("test")
  14. };
  15. }
  16. }
  17. }