mirror of
https://github.com/cefsharp/CefSharp.git
synced 2026-12-06 04:00:07 +00:00
Core - Add IBrowserHost.TryCloseBrowser
This commit is contained in:
@@ -150,6 +150,13 @@ void CefBrowserHostWrapper::CloseBrowser(bool forceClose)
|
||||
_browserHost->CloseBrowser(forceClose);
|
||||
}
|
||||
|
||||
bool CefBrowserHostWrapper::TryCloseBrowser()
|
||||
{
|
||||
ThrowIfDisposed();
|
||||
|
||||
return _browserHost->TryCloseBrowser();
|
||||
}
|
||||
|
||||
void CefBrowserHostWrapper::ShowDevTools(IWindowInfo^ windowInfo, int inspectElementAtX, int inspectElementAtY)
|
||||
{
|
||||
ThrowIfDisposed();
|
||||
|
||||
@@ -50,6 +50,7 @@ namespace CefSharp
|
||||
virtual Task<double>^ GetZoomLevelAsync();
|
||||
virtual IntPtr GetWindowHandle();
|
||||
virtual void CloseBrowser(bool forceClose);
|
||||
virtual bool TryCloseBrowser();
|
||||
|
||||
virtual void DragTargetDragEnter(IDragData^ dragData, MouseEvent mouseEvent, DragOperationsMask allowedOperations);
|
||||
virtual void DragTargetDragOver(MouseEvent mouseEvent, DragOperationsMask allowedOperations);
|
||||
|
||||
@@ -36,6 +36,15 @@ namespace CefSharp
|
||||
/// </param>
|
||||
void CloseBrowser(bool forceClose);
|
||||
|
||||
/// <summary>
|
||||
/// Helper for closing a browser. Call this method from the top-level window close handler. Internally this calls CloseBrowser(false) if the close has not yet been initiated. This method returns false while the close is pending and true after the close has completed.
|
||||
/// See <see cref="CloseBrowser(bool)"/> and <see cref="ILifeSpanHandler.DoClose(IWebBrowser, IBrowser)"/> documentation for additional usage information. This method must be called on the CEF UI thread.
|
||||
/// </summary>
|
||||
/// <returns>
|
||||
/// This method returns false while the close is pending and true after the close has completed
|
||||
/// </returns>
|
||||
bool TryCloseBrowser();
|
||||
|
||||
/// <summary>
|
||||
/// Explicitly close the developer tools window if one exists for this browser instance.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user