// Copyright © 2010-2017 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
{
///
/// Implement this interface to provide handler implementations. The handler
/// instance will not be released until all objects related to the context have
/// been destroyed. Implement this interface to cancel loading of specific plugins
///
public interface IRequestContextHandler
{
///
/// Called on the browser process IO thread to retrieve the cookie manager. If
/// this method returns NULL the default cookie manager retrievable via
/// IRequestContext.GetDefaultCookieManager() will be used.
///
/// If
/// this method returns null the default cookie manager retrievable via
/// IRequestContext.GetDefaultCookieManager() will be used..
ICookieManager GetCookieManager();
///
/// Called on the CEF IO thread before a plugin instance is loaded.
/// The default plugin policy can be set at runtime using the `--plugin-policy=[allow|detect|block]` command-line flag.
///
/// is the mime type of the plugin that will be loaded
/// is the content URL that the plugin will load and may be empty
/// will be true if the plugin is being loaded in the main (top-level) frame
/// is the URL for the top-level frame that contains the plugin
/// includes additional information about the plugin that will be loaded
/// Modify and return true to change the policy.
/// Return false to use the recommended policy. Modify and return true to change the policy.
bool OnBeforePluginLoad(string mimeType, string url, bool isMainFrame, string topOriginUrl, WebPluginInfo pluginInfo, ref PluginPolicy pluginPolicy);
}
}