mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Add notification for aborted popups (fixes #3776)
Pass a new |popup_id| parameter to OnBeforePopup and call a new OnBeforePopupAborted callback if the popup is aborted before OnAfterCreated is called for the popup browser. Add new CefBrowserHost::GetBrowserByIdentifier and GetOpenerIdentifier methods to assist with retrieval of associated browsers. In cefclient, clean up state when a popup is aborted and close any associated popup browsers when the opener browser is closed. This also works when running with `--use-default-popup`.
This commit is contained in:
@ -324,6 +324,12 @@ class CefBrowserHost : public virtual CefBaseRefCounted {
|
||||
CefRefPtr<CefDictionaryValue> extra_info,
|
||||
CefRefPtr<CefRequestContext> request_context);
|
||||
|
||||
///
|
||||
/// Returns the browser (if any) with the specified identifier.
|
||||
///
|
||||
/*--cef()--*/
|
||||
static CefRefPtr<CefBrowser> GetBrowserByIdentifier(int browser_id);
|
||||
|
||||
///
|
||||
/// Returns the hosted browser object.
|
||||
///
|
||||
@ -412,6 +418,13 @@ class CefBrowserHost : public virtual CefBaseRefCounted {
|
||||
/*--cef()--*/
|
||||
virtual CefWindowHandle GetOpenerWindowHandle() = 0;
|
||||
|
||||
///
|
||||
/// Retrieve the unique identifier of the browser that opened this browser.
|
||||
/// Will return 0 for non-popup browsers.
|
||||
///
|
||||
/*--cef()--*/
|
||||
virtual int GetOpenerIdentifier() = 0;
|
||||
|
||||
///
|
||||
/// Returns true if this browser is wrapped in a CefBrowserView.
|
||||
///
|
||||
|
Reference in New Issue
Block a user