2018-10-24 18:24:11 +00:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
2020-04-13 23:39:26 +00:00
|
|
|
From: deepak1556 <hop2deep@gmail.com>
|
|
|
|
Date: Fri, 10 Apr 2020 15:14:49 -0700
|
2018-09-21 00:30:26 +00:00
|
|
|
Subject: web_contents.patch
|
|
|
|
|
2019-12-13 17:18:45 +00:00
|
|
|
This allows overriding the RenderViewHostDelegateView of a WebContents, which
|
|
|
|
is needed for OSR.
|
|
|
|
|
|
|
|
Originally landed in https://github.com/electron/libchromiumcontent/pull/226.
|
2018-09-21 00:30:26 +00:00
|
|
|
|
2018-09-14 05:02:16 +00:00
|
|
|
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
|
2021-01-25 16:46:00 +00:00
|
|
|
index 81ecd2d06104aa125c95d40336e8192ec23a1206..3ea1b844a80f85da1d4e3c47d0a33d0e9eeb02ef 100644
|
2018-09-14 05:02:16 +00:00
|
|
|
--- a/content/browser/web_contents/web_contents_impl.cc
|
|
|
|
+++ b/content/browser/web_contents/web_contents_impl.cc
|
2021-01-25 16:46:00 +00:00
|
|
|
@@ -2725,6 +2725,12 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) {
|
2018-09-14 05:02:16 +00:00
|
|
|
std::string unique_name;
|
|
|
|
frame_tree_.root()->SetFrameName(params.main_frame_name, unique_name);
|
|
|
|
|
|
|
|
+ if (params.view && params.delegate_view) {
|
|
|
|
+ view_.reset(params.view);
|
|
|
|
+ render_view_host_delegate_view_ = params.delegate_view;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (!view_) {
|
|
|
|
WebContentsViewDelegate* delegate =
|
|
|
|
GetContentClient()->browser()->GetWebContentsViewDelegate(this);
|
|
|
|
|
2021-01-25 16:46:00 +00:00
|
|
|
@@ -2735,6 +2741,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) {
|
2019-12-11 00:22:35 +00:00
|
|
|
view_.reset(CreateWebContentsView(this, delegate,
|
|
|
|
&render_view_host_delegate_view_));
|
2018-09-14 05:02:16 +00:00
|
|
|
}
|
|
|
|
+ } // !view_
|
|
|
|
CHECK(render_view_host_delegate_view_);
|
|
|
|
CHECK(view_.get());
|
|
|
|
|
|
|
|
diff --git a/content/public/browser/web_contents.h b/content/public/browser/web_contents.h
|
2021-01-25 16:46:00 +00:00
|
|
|
index 05efddc8d80fad9be7f4276d51a80ab0b747e484..c558236eb621ae6a67468afaa1b8431b9857a35f 100644
|
2018-09-14 05:02:16 +00:00
|
|
|
--- a/content/public/browser/web_contents.h
|
|
|
|
+++ b/content/public/browser/web_contents.h
|
2020-11-14 00:16:56 +00:00
|
|
|
@@ -87,8 +87,11 @@ class BrowserContext;
|
2020-05-26 20:06:26 +00:00
|
|
|
class BrowserPluginGuestDelegate;
|
2018-09-14 05:02:16 +00:00
|
|
|
class RenderFrameHost;
|
|
|
|
class RenderViewHost;
|
|
|
|
+class RenderViewHostDelegateView;
|
|
|
|
class RenderWidgetHostView;
|
|
|
|
+class RenderWidgetHostViewBase;
|
|
|
|
class WebContentsDelegate;
|
|
|
|
+class WebContentsView;
|
2020-03-03 21:35:05 +00:00
|
|
|
class WebUI;
|
2018-09-14 05:02:16 +00:00
|
|
|
struct CustomContextMenuContext;
|
|
|
|
struct DropData;
|
2020-11-14 00:16:56 +00:00
|
|
|
@@ -222,6 +225,10 @@ class WebContents : public PageNavigator,
|
2020-04-13 23:39:26 +00:00
|
|
|
// Sandboxing flags set on the new WebContents.
|
|
|
|
network::mojom::WebSandboxFlags starting_sandbox_flags;
|
2018-09-14 05:02:16 +00:00
|
|
|
|
|
|
|
+ // Optionally specify the view and delegate view.
|
|
|
|
+ content::WebContentsView* view = nullptr;
|
|
|
|
+ content::RenderViewHostDelegateView* delegate_view = nullptr;
|
|
|
|
+
|
2020-04-13 23:39:26 +00:00
|
|
|
// Value used to set the last time the WebContents was made active, this is
|
|
|
|
// the value that'll be returned by GetLastActiveTime(). If this is left
|
|
|
|
// default initialized then the value is not passed on to the WebContents
|