mirror of
https://github.com/cefsharp/CefSharp.git
synced 2026-12-04 10:22:55 +00:00
Merge remote-tracking branch 'remotes/upstream/master' into JsBinding_WIP
This commit is contained in:
@@ -228,6 +228,15 @@ namespace CefSharp
|
||||
}
|
||||
}
|
||||
|
||||
void ClientAdapter::OnRenderProcessTerminated(CefRefPtr<CefBrowser> browser, TerminationStatus status)
|
||||
{
|
||||
IRequestHandler^ handler = _browserControl->RequestHandler;
|
||||
if (handler != nullptr)
|
||||
{
|
||||
handler->OnRenderProcessTerminated(_browserControl, (CefTerminationStatus)status);
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
|
||||
@@ -87,6 +87,7 @@ namespace CefSharp
|
||||
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;
|
||||
virtual DECL void OnRenderProcessTerminated(CefRefPtr<CefBrowser> browser, TerminationStatus status) OVERRIDE;
|
||||
|
||||
// CefDisplayHandler
|
||||
virtual DECL void OnLoadingStateChange(CefRefPtr<CefBrowser> browser, bool isLoading, bool canGoBack, bool canGoForward) OVERRIDE;
|
||||
|
||||
@@ -61,7 +61,11 @@ namespace CefSharp
|
||||
|
||||
_headers = ToHeaderMap(response->ResponseHeaders);
|
||||
|
||||
_callback->Continue();
|
||||
// If CEF has cancelled the initial request, throw away a response that comes afterwards.
|
||||
if (_callback != nullptr)
|
||||
{
|
||||
_callback->Continue();
|
||||
}
|
||||
|
||||
// Must be done AFTER CEF has been allowed to consume the headers etc. After this call is made, the SchemeHandlerWrapper
|
||||
// instance has likely been deallocated.
|
||||
|
||||
@@ -48,5 +48,10 @@ namespace CefSharp.Example
|
||||
//blockPluginLoad = info.Name.ToLower().Contains("flash");
|
||||
return blockPluginLoad;
|
||||
}
|
||||
|
||||
void IRequestHandler.OnRenderProcessTerminated(IWebBrowser browser, CefTerminationStatus status)
|
||||
{
|
||||
// TODO: Add your own code here for handling scenarios where the Render Process terminated for one reason or another.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -933,6 +933,41 @@ namespace CefSharp.Wpf
|
||||
managedCefBrowserAdapter.LoadHtml(html, url);
|
||||
}
|
||||
|
||||
public void Undo()
|
||||
{
|
||||
managedCefBrowserAdapter.Undo();
|
||||
}
|
||||
|
||||
public void Redo()
|
||||
{
|
||||
managedCefBrowserAdapter.Redo();
|
||||
}
|
||||
|
||||
public void Cut()
|
||||
{
|
||||
managedCefBrowserAdapter.Cut();
|
||||
}
|
||||
|
||||
public void Copy()
|
||||
{
|
||||
managedCefBrowserAdapter.Copy();
|
||||
}
|
||||
|
||||
public void Paste()
|
||||
{
|
||||
managedCefBrowserAdapter.Paste();
|
||||
}
|
||||
|
||||
public void Delete()
|
||||
{
|
||||
managedCefBrowserAdapter.Delete();
|
||||
}
|
||||
|
||||
public void SelectAll()
|
||||
{
|
||||
managedCefBrowserAdapter.SelectAll();
|
||||
}
|
||||
|
||||
public void Stop()
|
||||
{
|
||||
managedCefBrowserAdapter.Stop();
|
||||
|
||||
@@ -87,6 +87,7 @@
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="CefFileDialogMode.cs" />
|
||||
<Compile Include="CefTerminationStatus.cs" />
|
||||
<Compile Include="IDialogHandler.cs" />
|
||||
<Compile Include="AddressChangedEventArgs.cs" />
|
||||
<Compile Include="Internals\IBindableJavascriptMember.cs" />
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
namespace CefSharp
|
||||
{
|
||||
public enum CefTerminationStatus
|
||||
{
|
||||
///
|
||||
// Non-zero exit status.
|
||||
///
|
||||
AbnormalTermination = 0,
|
||||
|
||||
///
|
||||
// SIGKILL or task manager kill.
|
||||
///
|
||||
ProcessWasKilled,
|
||||
|
||||
///
|
||||
// Segmentation fault.
|
||||
///
|
||||
ProcessCrashed
|
||||
}
|
||||
}
|
||||
@@ -59,5 +59,12 @@ namespace CefSharp
|
||||
/// <param name="info">plugin information</param>
|
||||
/// <returns>Return true to block loading of the plugin.</returns>
|
||||
bool OnBeforePluginLoad(IWebBrowser browser, string url, string policyUrl, IWebPluginInfo info);
|
||||
|
||||
/// <summary>
|
||||
/// Called when the render process terminates unexpectedly.
|
||||
/// </summary>
|
||||
/// <param name="browser">the browser object</param>
|
||||
/// <param name="status">indicates how the process terminated.</param>
|
||||
void OnRenderProcessTerminated(IWebBrowser browser, CefTerminationStatus status);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user