using System.Collections.Generic;
namespace CefSharp
{
///
/// Handler methods that get called AFTER the Popup is created.
///
public interface IPopupHandler : IKeyboardHandler
{
///
/// Called before the passed popup window (browser) is closed.
///
/// The IWebBrowser control this popup is related to.
/// The popup window instance that is closing.
void OnBeforeClose(IWebBrowser browserControl, IBrowser browser);
///
/// Called after the paased popup window (browser) is created.
///
/// The IWebBrowser control this popup is related to.
/// The popup window instance that was just created.
void OnAfterCreated(IWebBrowser browserControl, IBrowser browser);
void OnFaviconUrlChange(IWebBrowser browserControl, IBrowser browser, List iconUrls);
void OnLoadingStateChange(IWebBrowser browserControl, IBrowser browser, bool isLoading, bool canGoBack, bool canGoForward);
void OnStatusMessage(IWebBrowser browserControl, IBrowser browser, string message);
void OnFrameLoadStart(IWebBrowser browserControl, FrameLoadStartEventArgs frameLoadStartArgs);
void OnFrameLoadEnd(IWebBrowser browserControl, FrameLoadEndEventArgs frameLoadEndArgs);
///
/// Called when the resource load for a navigation fails or is canceled.
/// |errorCode| is the error code number, |errorText| is the error text and
/// |failedUrl| is the URL that failed to load. See net\base\net_error_list.h
/// for complete descriptions of the error codes.
///
void OnLoadError(IWebBrowser browserControl, IBrowser browser, LoadErrorEventArgs loadErrorArgs);
///
/// Called before browser navigation.
/// If the navigation is allowed and
/// will be called. If the navigation is canceled will be called with an ErrorCode
/// value of .
///
/// the browser control
/// the browser object
/// the request object - cannot be modified in this callback
/// has the request been redirected
/// The frame the request is coming from
/// Return true to cancel the navigation or false to allow the navigation to proceed.
bool OnBeforeBrowse(IWebBrowser browserControl, IBrowser browser, IRequest request, bool isRedirect, IFrame frame);
///
/// Called on the IO thread when a resource load is redirected. The
/// parameter will contain the old URL and other request-related information.
///
/// The browser control
/// the browser object
/// The frame that is being redirected.
/// the request object - cannot be modified in this callback
/// the new URL and can be changed if desired
void OnResourceRedirect(IWebBrowser browserControl, IBrowser browser, IFrame frame, IRequest request, ref string newUrl);
///
/// Called before a resource request is loaded. For async processing return
/// and execute or
///
/// The browser control
/// the browser object
/// the request object - can be modified in this callback.
/// The frame object
/// Callback interface used for asynchronous continuation of url requests.
/// To cancel loading of the resource return
/// or to allow the resource to load normally. For async
/// return
CefReturnValue OnBeforeResourceLoad(IWebBrowser browserControl, IBrowser browser, IFrame frame, IRequest request, IRequestCallback callback);
}
}