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:
@ -212,6 +212,7 @@ class ClientHandler : public BaseClientHandler,
|
||||
bool OnBeforePopup(
|
||||
CefRefPtr<CefBrowser> browser,
|
||||
CefRefPtr<CefFrame> frame,
|
||||
int popup_id,
|
||||
const CefString& target_url,
|
||||
const CefString& target_frame_name,
|
||||
CefLifeSpanHandler::WindowOpenDisposition target_disposition,
|
||||
@ -222,6 +223,8 @@ class ClientHandler : public BaseClientHandler,
|
||||
CefBrowserSettings& settings,
|
||||
CefRefPtr<CefDictionaryValue>& extra_info,
|
||||
bool* no_javascript_access) override;
|
||||
void OnBeforePopupAborted(CefRefPtr<CefBrowser> browser,
|
||||
int popup_id) override;
|
||||
void OnBeforeDevToolsPopup(CefRefPtr<CefBrowser> browser,
|
||||
CefWindowInfo& windowInfo,
|
||||
CefRefPtr<CefClient>& client,
|
||||
@ -331,6 +334,7 @@ class ClientHandler : public BaseClientHandler,
|
||||
// will be true if the window will be used for DevTools. Returns true if a
|
||||
// RootWindow was created for the popup.
|
||||
bool CreatePopupWindow(CefRefPtr<CefBrowser> browser,
|
||||
int popup_id,
|
||||
bool is_devtools,
|
||||
const CefPopupFeatures& popupFeatures,
|
||||
CefWindowInfo& windowInfo,
|
||||
|
Reference in New Issue
Block a user