Add OnPluginCrashed to Request handler

This commit is contained in:
amaitland
2014-05-25 13:36:34 +10:00
parent 599c9d14ef
commit cc78bfeb13
4 changed files with 22 additions and 0 deletions
@@ -204,6 +204,15 @@ namespace CefSharp
return handler->OnBeforePluginLoad(_browserControl, StringUtils::ToClr(url), StringUtils::ToClr(policy_url), wrapper);
}
void ClientAdapter::OnPluginCrashed(CefRefPtr<CefBrowser> browser, const CefString& plugin_path)
{
IRequestHandler^ handler = _browserControl->RequestHandler;
if (handler != nullptr)
{
handler->OnPluginCrashed(_browserControl, StringUtils::ToClr(plugin_path));
}
}
bool ClientAdapter::OnBeforeResourceLoad(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, CefRefPtr<CefRequest> request)
{
// TOOD: Try to support with CEF3; seems quite difficult because the method signature has changed greatly with many parts
+1
View File
@@ -84,6 +84,7 @@ namespace CefSharp
const CefString& host, int port, const CefString& realm, const CefString& scheme, CefRefPtr<CefAuthCallback> callback) OVERRIDE;
virtual DECL bool OnBeforeBrowse(CefRefPtr<CefBrowser> browser, CefRefPtr<CefFrame> frame, CefRefPtr<CefRequest> request, bool isRedirect) OVERRIDE;
virtual DECL bool OnBeforePluginLoad( CefRefPtr< CefBrowser > browser, const CefString& url, const CefString& policy_url, CefRefPtr< CefWebPluginInfo > info ) OVERRIDE;
virtual DECL void OnPluginCrashed(CefRefPtr<CefBrowser> browser, const CefString& plugin_path) OVERRIDE;
// CefDisplayHandler
virtual DECL void OnLoadingStateChange(CefRefPtr<CefBrowser> browser, bool isLoading, bool canGoBack, bool canGoForward) OVERRIDE;
+5
View File
@@ -272,6 +272,11 @@ namespace CefSharp.Example
return false;
}
void IRequestHandler.OnPluginCrashed(IWebBrowser browser, string pluginPath)
{
}
bool IRequestHandler.OnBeforeResourceLoad(IWebBrowser browser, IRequestResponse requestResponse)
{
IRequest request = requestResponse.Request;
+7
View File
@@ -26,6 +26,13 @@ namespace CefSharp
/// <returns>Return true to cancel the navigation or false to allow the navigation to proceed.</returns>
bool OnBeforeBrowse(IWebBrowser browser, IRequest request, bool isRedirect);
/// <summary>
/// Called when a plugin has crashed
/// </summary>
/// <param name="browser">the browser object</param>
/// <param name="pluginPath">path of the plugin that crashed</param>
void OnPluginCrashed(IWebBrowser browser, string pluginPath);
/// <summary>
/// Called before a resource request is loaded.
/// </summary>