2018-10-24 18:24:11 +00:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
2018-09-21 00:30:26 +00:00
|
|
|
From: Cheng Zhao <zcbenz@gmail.com>
|
|
|
|
Date: Thu, 20 Sep 2018 17:45:32 -0700
|
|
|
|
Subject: can_create_window.patch
|
|
|
|
|
|
|
|
|
2018-09-14 05:02:16 +00:00
|
|
|
diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc
|
2019-08-02 23:56:46 +00:00
|
|
|
index 111039f17535c7a6fec84a5d157e174044a30028..fe573789d280f0545d4ac5725789f3054a9fd492 100644
|
2018-09-14 05:02:16 +00:00
|
|
|
--- a/content/browser/frame_host/render_frame_host_impl.cc
|
|
|
|
+++ b/content/browser/frame_host/render_frame_host_impl.cc
|
2019-08-02 23:56:46 +00:00
|
|
|
@@ -3805,6 +3805,7 @@ void RenderFrameHostImpl::CreateNewWindow(
|
2019-01-16 18:07:52 +00:00
|
|
|
last_committed_origin_, params->window_container_type,
|
2019-01-08 23:59:47 +00:00
|
|
|
params->target_url, params->referrer.To<Referrer>(),
|
|
|
|
params->frame_name, params->disposition, *params->features,
|
2019-01-24 14:52:14 +00:00
|
|
|
+ params->additional_features, params->body,
|
2018-09-21 00:30:26 +00:00
|
|
|
effective_transient_activation_state, params->opener_suppressed,
|
|
|
|
&no_javascript_access);
|
2018-09-14 05:02:16 +00:00
|
|
|
|
|
|
|
diff --git a/content/common/frame.mojom b/content/common/frame.mojom
|
2019-08-02 23:56:46 +00:00
|
|
|
index c9cb924bef70b9d186b5f622033f7f9206f890dd..0f7da5d076a3e89f4ea45e1e1d57ff2d8c681c41 100644
|
2018-09-14 05:02:16 +00:00
|
|
|
--- a/content/common/frame.mojom
|
|
|
|
+++ b/content/common/frame.mojom
|
2019-08-02 23:56:46 +00:00
|
|
|
@@ -307,6 +307,10 @@ struct CreateNewWindowParams {
|
2018-09-14 05:02:16 +00:00
|
|
|
|
|
|
|
// The window features to use for the new window.
|
|
|
|
blink.mojom.WindowFeatures features;
|
|
|
|
+
|
|
|
|
+ // Extra fields added by Electron.
|
|
|
|
+ array<string> additional_features;
|
2019-01-24 14:52:14 +00:00
|
|
|
+ network.mojom.URLRequestBody? body;
|
2018-09-14 05:02:16 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
// Operation result when the renderer asks the browser to create a new window.
|
|
|
|
diff --git a/content/public/browser/content_browser_client.cc b/content/public/browser/content_browser_client.cc
|
2019-08-02 23:56:46 +00:00
|
|
|
index 4aef09d612532f7c71656c24bca13e9b5887be8e..746f5893f95b940ac68610d9655aa46a3b85430a 100644
|
2018-09-14 05:02:16 +00:00
|
|
|
--- a/content/public/browser/content_browser_client.cc
|
|
|
|
+++ b/content/public/browser/content_browser_client.cc
|
2019-08-02 23:56:46 +00:00
|
|
|
@@ -493,6 +493,8 @@ bool ContentBrowserClient::CanCreateWindow(
|
2018-09-14 05:02:16 +00:00
|
|
|
const std::string& frame_name,
|
|
|
|
WindowOpenDisposition disposition,
|
|
|
|
const blink::mojom::WindowFeatures& features,
|
|
|
|
+ const std::vector<std::string>& additional_features,
|
|
|
|
+ const scoped_refptr<network::ResourceRequestBody>& body,
|
|
|
|
bool user_gesture,
|
|
|
|
bool opener_suppressed,
|
|
|
|
bool* no_javascript_access) {
|
|
|
|
diff --git a/content/public/browser/content_browser_client.h b/content/public/browser/content_browser_client.h
|
2019-08-02 23:56:46 +00:00
|
|
|
index da6420d62ef701c141d62d58c20a821b265cbe1d..3946cdec768f9f26a6710967f664b411012ef260 100644
|
2018-09-14 05:02:16 +00:00
|
|
|
--- a/content/public/browser/content_browser_client.h
|
|
|
|
+++ b/content/public/browser/content_browser_client.h
|
2019-08-02 23:56:46 +00:00
|
|
|
@@ -176,6 +176,7 @@ class RenderFrameHost;
|
2018-09-14 05:02:16 +00:00
|
|
|
class RenderProcessHost;
|
|
|
|
class RenderViewHost;
|
|
|
|
class ResourceContext;
|
|
|
|
+class ResourceRequestBody;
|
2019-02-14 16:34:15 +00:00
|
|
|
class SerialDelegate;
|
2018-09-14 05:02:16 +00:00
|
|
|
class SiteInstance;
|
2019-05-28 20:18:10 +00:00
|
|
|
class SpeechRecognitionManagerDelegate;
|
2019-07-26 19:18:32 +00:00
|
|
|
@@ -778,6 +779,8 @@ class CONTENT_EXPORT ContentBrowserClient {
|
2018-09-14 05:02:16 +00:00
|
|
|
const std::string& frame_name,
|
|
|
|
WindowOpenDisposition disposition,
|
|
|
|
const blink::mojom::WindowFeatures& features,
|
|
|
|
+ const std::vector<std::string>& additional_features,
|
|
|
|
+ const scoped_refptr<network::ResourceRequestBody>& body,
|
|
|
|
bool user_gesture,
|
|
|
|
bool opener_suppressed,
|
|
|
|
bool* no_javascript_access);
|
|
|
|
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
|
2019-08-02 23:56:46 +00:00
|
|
|
index 0335070be844765bc685eed2899fba19093f6e49..227436a1954818ded4dd4b38047ed07ffc0b939d 100644
|
2018-09-14 05:02:16 +00:00
|
|
|
--- a/content/renderer/render_view_impl.cc
|
|
|
|
+++ b/content/renderer/render_view_impl.cc
|
2019-07-24 22:58:51 +00:00
|
|
|
@@ -75,6 +75,7 @@
|
2018-09-14 18:03:43 +00:00
|
|
|
#include "content/renderer/ime_event_guard.h"
|
2018-09-14 05:02:16 +00:00
|
|
|
#include "content/renderer/internal_document_state_data.h"
|
|
|
|
#include "content/renderer/loader/request_extra_data.h"
|
|
|
|
+#include "content/renderer/loader/web_url_request_util.h"
|
2018-09-21 00:30:26 +00:00
|
|
|
#include "content/renderer/media/audio/audio_device_factory.h"
|
2019-08-02 23:56:46 +00:00
|
|
|
#include "content/renderer/media/webrtc/peer_connection_dependency_factory.h"
|
|
|
|
#include "content/renderer/media/webrtc/rtc_peer_connection_handler.h"
|
|
|
|
@@ -1368,6 +1369,8 @@ WebView* RenderViewImpl::CreateView(
|
2018-09-14 05:02:16 +00:00
|
|
|
}
|
|
|
|
params->features = ConvertWebWindowFeaturesToMojoWindowFeatures(features);
|
|
|
|
|
2019-01-24 14:52:14 +00:00
|
|
|
+ params->body = GetRequestBodyForWebURLRequest(request);
|
2018-09-14 05:02:16 +00:00
|
|
|
+
|
|
|
|
// We preserve this information before sending the message since |params| is
|
|
|
|
// moved on send.
|
|
|
|
bool is_background_tab =
|
2019-01-16 18:07:52 +00:00
|
|
|
diff --git a/content/shell/browser/web_test/web_test_content_browser_client.cc b/content/shell/browser/web_test/web_test_content_browser_client.cc
|
2019-08-02 23:56:46 +00:00
|
|
|
index 14c8b66a426372c371c3aa4eb376dc2ed898b072..ab4d79b2b4bcdd42dbc9c44634155adf3334f2cf 100644
|
2019-01-16 18:07:52 +00:00
|
|
|
--- a/content/shell/browser/web_test/web_test_content_browser_client.cc
|
|
|
|
+++ b/content/shell/browser/web_test/web_test_content_browser_client.cc
|
2019-08-02 23:56:46 +00:00
|
|
|
@@ -307,6 +307,8 @@ bool WebTestContentBrowserClient::CanCreateWindow(
|
2018-09-14 05:02:16 +00:00
|
|
|
const std::string& frame_name,
|
|
|
|
WindowOpenDisposition disposition,
|
|
|
|
const blink::mojom::WindowFeatures& features,
|
|
|
|
+ const std::vector<std::string>& additional_features,
|
|
|
|
+ const scoped_refptr<network::ResourceRequestBody>& body,
|
|
|
|
bool user_gesture,
|
|
|
|
bool opener_suppressed,
|
|
|
|
bool* no_javascript_access) {
|
2019-01-16 18:07:52 +00:00
|
|
|
diff --git a/content/shell/browser/web_test/web_test_content_browser_client.h b/content/shell/browser/web_test/web_test_content_browser_client.h
|
2019-07-24 22:58:51 +00:00
|
|
|
index 4f00217da5a4f6f3d7410b82352fcb94e7f4a8fd..33e30d6a816e87dade0a26710a8f71fc6f630f34 100644
|
2019-01-16 18:07:52 +00:00
|
|
|
--- a/content/shell/browser/web_test/web_test_content_browser_client.h
|
|
|
|
+++ b/content/shell/browser/web_test/web_test_content_browser_client.h
|
2019-05-13 18:49:01 +00:00
|
|
|
@@ -69,6 +69,8 @@ class WebTestContentBrowserClient : public ShellContentBrowserClient {
|
2018-09-14 05:02:16 +00:00
|
|
|
const std::string& frame_name,
|
|
|
|
WindowOpenDisposition disposition,
|
|
|
|
const blink::mojom::WindowFeatures& features,
|
|
|
|
+ const std::vector<std::string>& additional_features,
|
|
|
|
+ const scoped_refptr<network::ResourceRequestBody>& body,
|
|
|
|
bool user_gesture,
|
|
|
|
bool opener_suppressed,
|
|
|
|
bool* no_javascript_access) override;
|