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:
@@ -235,6 +235,17 @@ void RootWindowViews::OnViewsWindowCreated(CefRefPtr<ViewsWindow> window) {
|
||||
DCHECK(!window_);
|
||||
window_ = window;
|
||||
window_->SetAlwaysOnTop(config_->always_on_top);
|
||||
|
||||
if (CURRENTLY_ON_MAIN_THREAD()) {
|
||||
window_created_ = true;
|
||||
} else {
|
||||
// Execute on the main thread.
|
||||
MAIN_POST_CLOSURE(base::BindOnce(
|
||||
[](scoped_refptr<RootWindowViews> self) {
|
||||
self->window_created_ = true;
|
||||
},
|
||||
scoped_refptr<RootWindowViews>(this)));
|
||||
}
|
||||
}
|
||||
|
||||
void RootWindowViews::OnViewsWindowClosing(CefRefPtr<ViewsWindow> window) {
|
||||
|
Reference in New Issue
Block a user