mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2024-12-11 09:08:06 +01:00
1a99a3abc5
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`.
30 lines
1.4 KiB
Diff
30 lines
1.4 KiB
Diff
diff --git content/browser/renderer_host/render_frame_host_impl.cc content/browser/renderer_host/render_frame_host_impl.cc
|
|
index 98c865765c57d..f31210f9c3070 100644
|
|
--- content/browser/renderer_host/render_frame_host_impl.cc
|
|
+++ content/browser/renderer_host/render_frame_host_impl.cc
|
|
@@ -9125,6 +9125,16 @@ void RenderFrameHostImpl::CreateNewWindow(
|
|
return;
|
|
}
|
|
|
|
+ callback = base::BindOnce(
|
|
+ [](RenderFrameHostImpl* self,
|
|
+ CreateNewWindowCallback callback,
|
|
+ mojom::CreateNewWindowStatus status,
|
|
+ mojom::CreateNewWindowReplyPtr reply) {
|
|
+ GetContentClient()->browser()->CreateWindowResult(
|
|
+ self, status == mojom::CreateNewWindowStatus::kSuccess);
|
|
+ std::move(callback).Run(status, std::move(reply));
|
|
+ }, base::Unretained(this), std::move(callback));
|
|
+
|
|
// Otherwise, consume user activation before we proceed. In particular, it is
|
|
// important to do this before we return from the |opener_suppressed| case
|
|
// below.
|
|
@@ -11466,6 +11476,7 @@ void RenderFrameHostImpl::CommitNavigation(
|
|
auto browser_calc_origin_to_commit =
|
|
navigation_request->GetOriginToCommitWithDebugInfo();
|
|
if (!process_lock.is_error_page() && !is_mhtml_subframe &&
|
|
+ common_params->url.IsStandard() &&
|
|
!policy->CanAccessOrigin(
|
|
GetProcess()->GetID(), browser_calc_origin_to_commit.first.value(),
|
|
ChildProcessSecurityPolicyImpl::AccessType::kCanCommitNewOrigin)) {
|