diff --git a/CefSharp.Core/Internals/ClientAdapter.cpp b/CefSharp.Core/Internals/ClientAdapter.cpp index 123da0190..fb2b9009d 100644 --- a/CefSharp.Core/Internals/ClientAdapter.cpp +++ b/CefSharp.Core/Internals/ClientAdapter.cpp @@ -204,6 +204,15 @@ namespace CefSharp return handler->OnBeforePluginLoad(_browserControl, StringUtils::ToClr(url), StringUtils::ToClr(policy_url), wrapper); } + void ClientAdapter::OnPluginCrashed(CefRefPtr browser, const CefString& plugin_path) + { + IRequestHandler^ handler = _browserControl->RequestHandler; + if (handler != nullptr) + { + handler->OnPluginCrashed(_browserControl, StringUtils::ToClr(plugin_path)); + } + } + bool ClientAdapter::OnBeforeResourceLoad(CefRefPtr browser, CefRefPtr frame, CefRefPtr request) { // TOOD: Try to support with CEF3; seems quite difficult because the method signature has changed greatly with many parts diff --git a/CefSharp.Core/Internals/ClientAdapter.h b/CefSharp.Core/Internals/ClientAdapter.h index eb9b9e4c9..b55758777 100644 --- a/CefSharp.Core/Internals/ClientAdapter.h +++ b/CefSharp.Core/Internals/ClientAdapter.h @@ -84,6 +84,7 @@ namespace CefSharp const CefString& host, int port, const CefString& realm, const CefString& scheme, CefRefPtr callback) OVERRIDE; virtual DECL bool OnBeforeBrowse(CefRefPtr browser, CefRefPtr frame, CefRefPtr 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 browser, const CefString& plugin_path) OVERRIDE; // CefDisplayHandler virtual DECL void OnLoadingStateChange(CefRefPtr browser, bool isLoading, bool canGoBack, bool canGoForward) OVERRIDE; diff --git a/CefSharp.Example/ExamplePresenter.cs b/CefSharp.Example/ExamplePresenter.cs index bcf9cabfa..b80b28b37 100644 --- a/CefSharp.Example/ExamplePresenter.cs +++ b/CefSharp.Example/ExamplePresenter.cs @@ -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; diff --git a/CefSharp/IRequestHandler.cs b/CefSharp/IRequestHandler.cs index e71cfb129..044cb00a1 100644 --- a/CefSharp/IRequestHandler.cs +++ b/CefSharp/IRequestHandler.cs @@ -26,6 +26,13 @@ namespace CefSharp /// Return true to cancel the navigation or false to allow the navigation to proceed. bool OnBeforeBrowse(IWebBrowser browser, IRequest request, bool isRedirect); + /// + /// Called when a plugin has crashed + /// + /// the browser object + /// path of the plugin that crashed + void OnPluginCrashed(IWebBrowser browser, string pluginPath); + /// /// Called before a resource request is loaded. ///