From f5c79bf50c777e4be4d9ba6fa6735b7981f5433a Mon Sep 17 00:00:00 2001 From: Mike Wiedenbauer Date: Thu, 2 Apr 2020 21:26:14 +0000 Subject: [PATCH] Linux: Fix CefPrintHandler callbacks from PDF viewer (fixes issue #2906) --- libcef/browser/extensions/browser_extensions_util.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libcef/browser/extensions/browser_extensions_util.cc b/libcef/browser/extensions/browser_extensions_util.cc index e4f9a0bd6..c7ea3e1a3 100644 --- a/libcef/browser/extensions/browser_extensions_util.cc +++ b/libcef/browser/extensions/browser_extensions_util.cc @@ -58,8 +58,10 @@ content::WebContents* GetOwnerForGuestContents(content::WebContents* guest) { static_cast(guest); content::BrowserPluginGuest* plugin_guest = guest_impl->GetBrowserPluginGuest(); - if (plugin_guest) - return plugin_guest->embedder_web_contents(); + if (plugin_guest) { + return content::WebContents::FromRenderFrameHost( + plugin_guest->GetEmbedderFrame()); + } // Maybe it's a print preview dialog. auto print_preview_controller =