cef/patch/patches/chrome_plugins.patch

57 lines
2.4 KiB
Diff

diff --git content/browser/browser_plugin/browser_plugin_embedder.h content/browser/browser_plugin/browser_plugin_embedder.h
index ea2891a279371..595e5b8eb2cb6 100644
--- content/browser/browser_plugin/browser_plugin_embedder.h
+++ content/browser/browser_plugin/browser_plugin_embedder.h
@@ -15,6 +15,7 @@
#define CONTENT_BROWSER_BROWSER_PLUGIN_BROWSER_PLUGIN_EMBEDDER_H_
#include "base/memory/raw_ptr.h"
+#include "content/common/content_export.h"
namespace input {
struct NativeWebKeyboardEvent;
@@ -29,7 +30,7 @@ class WebContentsImpl;
// TODO(wjmaclean): Get rid of "BrowserPlugin" in the name of this class.
// Perhaps "WebContentsEmbedderDelegate" would be better?
-class BrowserPluginEmbedder {
+class CONTENT_EXPORT BrowserPluginEmbedder {
public:
BrowserPluginEmbedder(const BrowserPluginEmbedder&) = delete;
BrowserPluginEmbedder& operator=(const BrowserPluginEmbedder&) = delete;
diff --git content/browser/browser_plugin/browser_plugin_guest.cc content/browser/browser_plugin/browser_plugin_guest.cc
index 1ce20a2a42705..7a3ef88ec689b 100644
--- content/browser/browser_plugin/browser_plugin_guest.cc
+++ content/browser/browser_plugin/browser_plugin_guest.cc
@@ -49,6 +49,8 @@ std::unique_ptr<WebContentsImpl> BrowserPluginGuest::CreateNewGuestWindow(
}
void BrowserPluginGuest::InitInternal(WebContentsImpl* owner_web_contents) {
+ owner_web_contents_ = owner_web_contents;
+
RenderWidgetHostImpl* rwhi =
GetWebContents()->GetPrimaryMainFrame()->GetRenderWidgetHost();
DCHECK(rwhi);
diff --git content/browser/browser_plugin/browser_plugin_guest.h content/browser/browser_plugin/browser_plugin_guest.h
index 7f3083029d45e..94a5cbed96a10 100644
--- content/browser/browser_plugin/browser_plugin_guest.h
+++ content/browser/browser_plugin/browser_plugin_guest.h
@@ -70,6 +70,8 @@ class BrowserPluginGuest : public WebContentsObserver {
WebContentsImpl* GetWebContents() const;
RenderFrameHostImpl* GetProspectiveOuterDocument();
+ WebContentsImpl* owner_web_contents() const { return owner_web_contents_; }
+
private:
// BrowserPluginGuest is a WebContentsObserver of |web_contents| and
// |web_contents| has to stay valid for the lifetime of BrowserPluginGuest.
@@ -80,6 +82,8 @@ class BrowserPluginGuest : public WebContentsObserver {
// May be null during guest destruction.
const base::WeakPtr<BrowserPluginGuestDelegate> delegate_;
+
+ raw_ptr<WebContentsImpl> owner_web_contents_ = nullptr;
};
} // namespace content