// Copyright © 2014 The CefSharp Authors. All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
namespace CefSharp
{
///
/// Class that creates instances for handling custom requests.
/// The methods of this class will always be called on the CEF IO thread. This interface
/// maps to the CefRequestHandler::GetResourceHandler method. It was split out to allow for
/// the implementation that provides support
/// for the LoadHtml extension method.
///
public interface IResourceRequestHandlerFactory
{
///
/// Are there any 's registered?
///
bool HasHandlers { get; }
///
/// Called on the CEF IO thread before a resource request is initiated.
///
/// the ChromiumWebBrowser control
/// represent the source browser of the request
/// represent the source frame of the request
/// represents the request contents and cannot be modified in this callback
/// will be true if the resource request is a navigation
/// will be true if the resource request is a download
/// is the origin (scheme + domain) of the page that initiated the request
/// to true to disable default handling of the request, in which case it will need to be handled via or it will be canceled
/// To allow the resource load to proceed with default handling return null. To specify a handler for the resource return a object. If this callback returns null the same method will be called on the associated , if any
IResourceRequestHandler GetResourceRequestHandler(IWebBrowser chromiumWebBrowser, IBrowser browser, IFrame frame, IRequest request, bool isNavigation, bool isDownload, string requestInitiator, ref bool disableDefaultHandling);
}
}