2018-03-08 07:35:58 +01:00
|
|
|
|
/*
|
2019-01-09 11:25:21 +01:00
|
|
|
|
* Copyright (c) 2019 ETH Zürich, Educational Development and Technology (LET)
|
2018-03-08 07:35:58 +01:00
|
|
|
|
*
|
|
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
using CefSharp;
|
2019-08-30 09:55:26 +02:00
|
|
|
|
using SafeExamBrowser.Configuration.Contracts;
|
2018-03-08 07:35:58 +01:00
|
|
|
|
|
|
|
|
|
namespace SafeExamBrowser.Browser.Handlers
|
|
|
|
|
{
|
2019-08-23 15:48:23 +02:00
|
|
|
|
internal class RequestHandler : CefSharp.Handler.RequestHandler
|
2018-03-08 07:35:58 +01:00
|
|
|
|
{
|
2018-08-14 09:06:35 +02:00
|
|
|
|
private AppConfig appConfig;
|
2019-08-23 15:48:23 +02:00
|
|
|
|
private ResourceRequestHandler resourceRequestHandler;
|
2018-08-14 09:06:35 +02:00
|
|
|
|
|
|
|
|
|
internal RequestHandler(AppConfig appConfig)
|
|
|
|
|
{
|
|
|
|
|
this.appConfig = appConfig;
|
2019-08-23 15:48:23 +02:00
|
|
|
|
this.resourceRequestHandler = new ResourceRequestHandler(appConfig);
|
2018-08-14 09:06:35 +02:00
|
|
|
|
}
|
|
|
|
|
|
2019-08-23 15:48:23 +02:00
|
|
|
|
protected override IResourceRequestHandler GetResourceRequestHandler(IWebBrowser webBrowser, IBrowser browser, IFrame frame, IRequest request, bool isNavigation, bool isDownload, string requestInitiator, ref bool disableDefaultHandling)
|
2019-04-18 08:15:47 +02:00
|
|
|
|
{
|
2019-08-23 15:48:23 +02:00
|
|
|
|
return resourceRequestHandler;
|
2018-03-08 07:35:58 +01:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|