2017-01-19 00:37:56 +01:00
|
|
|
diff --git chrome/browser/download/download_target_determiner.cc chrome/browser/download/download_target_determiner.cc
|
2020-08-29 00:39:23 +02:00
|
|
|
index cdeecb35a998..1615185f2a65 100644
|
2017-01-19 00:37:56 +01:00
|
|
|
--- chrome/browser/download/download_target_determiner.cc
|
|
|
|
+++ chrome/browser/download/download_target_determiner.cc
|
2020-07-08 19:23:29 +02:00
|
|
|
@@ -660,7 +660,7 @@ void IsHandledBySafePlugin(int render_process_id,
|
2017-01-19 00:37:56 +01:00
|
|
|
content::PluginService* plugin_service =
|
|
|
|
content::PluginService::GetInstance();
|
|
|
|
bool plugin_found = plugin_service->GetPluginInfo(
|
2019-10-01 15:55:16 +02:00
|
|
|
- render_process_id, routing_id, url, url::Origin(), mime_type, false,
|
|
|
|
+ render_process_id, routing_id, url, true, url::Origin(), mime_type, false,
|
|
|
|
&is_stale, &plugin_info, &actual_mime_type);
|
2017-01-19 00:37:56 +01:00
|
|
|
if (is_stale && stale_plugin_action == RETRY_IF_STALE_PLUGIN_LIST) {
|
|
|
|
// The GetPlugins call causes the plugin list to be refreshed. Once that's
|
|
|
|
diff --git chrome/browser/plugins/chrome_plugin_service_filter.cc chrome/browser/plugins/chrome_plugin_service_filter.cc
|
2020-02-10 18:10:17 +01:00
|
|
|
index e46003ea5e4a..503876cf7725 100644
|
2017-01-19 00:37:56 +01:00
|
|
|
--- chrome/browser/plugins/chrome_plugin_service_filter.cc
|
|
|
|
+++ chrome/browser/plugins/chrome_plugin_service_filter.cc
|
2019-10-01 15:55:16 +02:00
|
|
|
@@ -163,6 +163,7 @@ bool ChromePluginServiceFilter::IsPluginAvailable(
|
|
|
|
int render_process_id,
|
2017-01-19 00:37:56 +01:00
|
|
|
int render_frame_id,
|
|
|
|
const GURL& plugin_content_url,
|
|
|
|
+ bool is_main_frame,
|
|
|
|
const url::Origin& main_frame_origin,
|
|
|
|
content::WebPluginInfo* plugin) {
|
|
|
|
base::AutoLock auto_lock(lock_);
|
|
|
|
diff --git chrome/browser/plugins/chrome_plugin_service_filter.h chrome/browser/plugins/chrome_plugin_service_filter.h
|
2019-10-01 15:55:16 +02:00
|
|
|
index 937d3d5bc84f..ac327392dcf3 100644
|
2017-01-19 00:37:56 +01:00
|
|
|
--- chrome/browser/plugins/chrome_plugin_service_filter.h
|
|
|
|
+++ chrome/browser/plugins/chrome_plugin_service_filter.h
|
2019-10-01 15:55:16 +02:00
|
|
|
@@ -64,6 +64,7 @@ class ChromePluginServiceFilter : public content::PluginServiceFilter,
|
|
|
|
bool IsPluginAvailable(int render_process_id,
|
2017-01-19 00:37:56 +01:00
|
|
|
int render_frame_id,
|
|
|
|
const GURL& plugin_content_url,
|
|
|
|
+ bool is_main_frame,
|
|
|
|
const url::Origin& main_frame_origin,
|
|
|
|
content::WebPluginInfo* plugin) override;
|
|
|
|
|
2017-09-06 23:40:58 +02:00
|
|
|
diff --git chrome/browser/plugins/pdf_iframe_navigation_throttle.cc chrome/browser/plugins/pdf_iframe_navigation_throttle.cc
|
2020-03-30 22:13:42 +02:00
|
|
|
index 5b780f8bf34c..a75d0da983b4 100644
|
2017-09-06 23:40:58 +02:00
|
|
|
--- chrome/browser/plugins/pdf_iframe_navigation_throttle.cc
|
|
|
|
+++ chrome/browser/plugins/pdf_iframe_navigation_throttle.cc
|
2020-03-30 22:13:42 +02:00
|
|
|
@@ -65,7 +65,7 @@ bool IsPDFPluginEnabled(content::NavigationHandle* navigation_handle,
|
2019-10-01 15:55:16 +02:00
|
|
|
|
2019-02-21 01:42:36 +01:00
|
|
|
content::WebPluginInfo plugin_info;
|
|
|
|
return content::PluginService::GetInstance()->GetPluginInfo(
|
2019-10-01 15:55:16 +02:00
|
|
|
- process_id, routing_id, navigation_handle->GetURL(),
|
|
|
|
+ process_id, routing_id, navigation_handle->GetURL(), false,
|
|
|
|
web_contents->GetMainFrame()->GetLastCommittedOrigin(), kPDFMimeType,
|
|
|
|
false /* allow_wildcard */, is_stale, &plugin_info,
|
2019-02-21 01:42:36 +01:00
|
|
|
nullptr /* actual_mime_type */);
|
2018-05-20 15:51:42 +02:00
|
|
|
diff --git chrome/browser/ui/views/frame/browser_root_view.cc chrome/browser/ui/views/frame/browser_root_view.cc
|
2020-07-08 19:23:29 +02:00
|
|
|
index f64e2a94062e..b1bf9689321c 100644
|
2018-05-20 15:51:42 +02:00
|
|
|
--- chrome/browser/ui/views/frame/browser_root_view.cc
|
|
|
|
+++ chrome/browser/ui/views/frame/browser_root_view.cc
|
2020-03-30 22:13:42 +02:00
|
|
|
@@ -76,7 +76,7 @@ void OnFindURLMimeType(const GURL& url,
|
2020-03-04 01:29:39 +01:00
|
|
|
#if BUILDFLAG(ENABLE_PLUGINS)
|
|
|
|
content::WebPluginInfo plugin;
|
|
|
|
result = result || content::PluginService::GetInstance()->GetPluginInfo(
|
|
|
|
- process_id, routing_id, url, url::Origin(), mime_type,
|
|
|
|
+ process_id, routing_id, url, true, url::Origin(), mime_type,
|
|
|
|
false, nullptr, &plugin, nullptr);
|
|
|
|
#endif
|
2018-05-20 15:51:42 +02:00
|
|
|
|
2019-04-24 04:50:25 +02:00
|
|
|
diff --git content/browser/devtools/devtools_http_handler.cc content/browser/devtools/devtools_http_handler.cc
|
2020-07-08 19:23:29 +02:00
|
|
|
index f66e6bca5e2b..c99998449b6b 100644
|
2019-04-24 04:50:25 +02:00
|
|
|
--- content/browser/devtools/devtools_http_handler.cc
|
|
|
|
+++ content/browser/devtools/devtools_http_handler.cc
|
2020-07-08 19:23:29 +02:00
|
|
|
@@ -570,7 +570,7 @@ void DevToolsHttpHandler::OnJsonRequest(
|
2019-04-24 04:50:25 +02:00
|
|
|
version.SetString("Protocol-Version",
|
|
|
|
DevToolsAgentHost::GetProtocolVersion());
|
|
|
|
version.SetString("WebKit-Version", GetWebKitVersion());
|
|
|
|
- version.SetString("Browser", GetContentClient()->browser()->GetProduct());
|
|
|
|
+ version.SetString("Browser", GetContentClient()->browser()->GetChromeProduct());
|
|
|
|
version.SetString("User-Agent",
|
|
|
|
GetContentClient()->browser()->GetUserAgent());
|
|
|
|
version.SetString("V8-Version", V8_VERSION_STRING);
|
2017-01-19 00:37:56 +01:00
|
|
|
diff --git content/browser/frame_host/render_frame_message_filter.cc content/browser/frame_host/render_frame_message_filter.cc
|
2020-08-29 00:39:23 +02:00
|
|
|
index caa2c1d4d0ab..f20dfe7ca7fe 100644
|
2017-01-19 00:37:56 +01:00
|
|
|
--- content/browser/frame_host/render_frame_message_filter.cc
|
|
|
|
+++ content/browser/frame_host/render_frame_message_filter.cc
|
2020-07-08 19:23:29 +02:00
|
|
|
@@ -300,6 +300,7 @@ void RenderFrameMessageFilter::OnCreateChildFrame(
|
2017-01-19 00:37:56 +01:00
|
|
|
void RenderFrameMessageFilter::OnGetPluginInfo(
|
|
|
|
int render_frame_id,
|
|
|
|
const GURL& url,
|
|
|
|
+ bool is_main_frame,
|
|
|
|
const url::Origin& main_frame_origin,
|
|
|
|
const std::string& mime_type,
|
|
|
|
bool* found,
|
2020-07-08 19:23:29 +02:00
|
|
|
@@ -307,8 +308,9 @@ void RenderFrameMessageFilter::OnGetPluginInfo(
|
2019-10-01 15:55:16 +02:00
|
|
|
std::string* actual_mime_type) {
|
2017-01-19 00:37:56 +01:00
|
|
|
bool allow_wildcard = true;
|
|
|
|
*found = plugin_service_->GetPluginInfo(
|
2019-10-01 15:55:16 +02:00
|
|
|
- render_process_id_, render_frame_id, url, main_frame_origin, mime_type,
|
|
|
|
- allow_wildcard, nullptr, info, actual_mime_type);
|
|
|
|
+ render_process_id_, render_frame_id, url, is_main_frame,
|
|
|
|
+ main_frame_origin, mime_type, allow_wildcard, nullptr, info,
|
|
|
|
+ actual_mime_type);
|
2017-01-19 00:37:56 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void RenderFrameMessageFilter::OnOpenChannelToPepperPlugin(
|
|
|
|
diff --git content/browser/frame_host/render_frame_message_filter.h content/browser/frame_host/render_frame_message_filter.h
|
2020-06-09 19:48:00 +02:00
|
|
|
index 8d1c932e9f3a..e6a2c525da06 100644
|
2017-01-19 00:37:56 +01:00
|
|
|
--- content/browser/frame_host/render_frame_message_filter.h
|
|
|
|
+++ content/browser/frame_host/render_frame_message_filter.h
|
2020-03-30 22:13:42 +02:00
|
|
|
@@ -83,6 +83,7 @@ class CONTENT_EXPORT RenderFrameMessageFilter : public BrowserMessageFilter {
|
2017-01-19 00:37:56 +01:00
|
|
|
#if BUILDFLAG(ENABLE_PLUGINS)
|
|
|
|
void OnGetPluginInfo(int render_frame_id,
|
|
|
|
const GURL& url,
|
|
|
|
+ bool is_main_frame,
|
|
|
|
const url::Origin& main_frame_origin,
|
|
|
|
const std::string& mime_type,
|
|
|
|
bool* found,
|
2019-03-24 01:39:54 +01:00
|
|
|
diff --git content/browser/loader/navigation_url_loader_impl.cc content/browser/loader/navigation_url_loader_impl.cc
|
2020-08-29 00:39:23 +02:00
|
|
|
index 2b94b8b2839e..36506642484c 100644
|
2019-03-24 01:39:54 +01:00
|
|
|
--- content/browser/loader/navigation_url_loader_impl.cc
|
|
|
|
+++ content/browser/loader/navigation_url_loader_impl.cc
|
2020-08-29 00:39:23 +02:00
|
|
|
@@ -632,6 +632,13 @@ NavigationURLLoaderImpl::PrepareForNonInterceptedRequest(
|
2020-07-08 19:23:29 +02:00
|
|
|
resource_request_->has_user_gesture,
|
|
|
|
resource_request_->request_initiator, &loader_factory);
|
2019-09-04 17:13:32 +02:00
|
|
|
|
2020-07-08 19:23:29 +02:00
|
|
|
+ if (!handled) {
|
|
|
|
+ handled = GetContentClient()->browser()->HandleExternalProtocol(
|
|
|
|
+ web_contents_getter_, frame_tree_node_id_,
|
|
|
|
+ navigation_ui_data_.get(), *resource_request_,
|
|
|
|
+ &loader_factory);
|
|
|
|
+ }
|
2019-09-04 17:13:32 +02:00
|
|
|
+
|
2020-07-08 19:23:29 +02:00
|
|
|
if (loader_factory) {
|
|
|
|
factory = base::MakeRefCounted<network::WrapperSharedURLLoaderFactory>(
|
|
|
|
std::move(loader_factory));
|
2020-08-29 00:39:23 +02:00
|
|
|
@@ -833,7 +840,7 @@ void NavigationURLLoaderImpl::CheckPluginAndContinueOnReceiveResponse(
|
2020-07-08 19:23:29 +02:00
|
|
|
frame_tree_node->current_frame_host()->GetProcess()->GetID();
|
|
|
|
int routing_id = frame_tree_node->current_frame_host()->GetRoutingID();
|
|
|
|
bool has_plugin = PluginService::GetInstance()->GetPluginInfo(
|
|
|
|
- render_process_id, routing_id, resource_request_->url, url::Origin(),
|
|
|
|
+ render_process_id, routing_id, resource_request_->url, true, url::Origin(),
|
|
|
|
head->mime_type, false /* allow_wildcard */, &stale, &plugin, nullptr);
|
2019-03-24 01:39:54 +01:00
|
|
|
|
2020-07-08 19:23:29 +02:00
|
|
|
if (stale) {
|
2017-01-19 00:37:56 +01:00
|
|
|
diff --git content/browser/plugin_service_impl.cc content/browser/plugin_service_impl.cc
|
2020-08-29 00:39:23 +02:00
|
|
|
index e9cb48e03f17..47996036362c 100644
|
2017-01-19 00:37:56 +01:00
|
|
|
--- content/browser/plugin_service_impl.cc
|
|
|
|
+++ content/browser/plugin_service_impl.cc
|
2020-08-29 00:39:23 +02:00
|
|
|
@@ -341,6 +341,7 @@ bool PluginServiceImpl::GetPluginInfoArray(
|
2019-10-01 15:55:16 +02:00
|
|
|
bool PluginServiceImpl::GetPluginInfo(int render_process_id,
|
2017-01-19 00:37:56 +01:00
|
|
|
int render_frame_id,
|
|
|
|
const GURL& url,
|
|
|
|
+ bool is_main_frame,
|
|
|
|
const url::Origin& main_frame_origin,
|
|
|
|
const std::string& mime_type,
|
|
|
|
bool allow_wildcard,
|
2020-08-29 00:39:23 +02:00
|
|
|
@@ -358,7 +359,8 @@ bool PluginServiceImpl::GetPluginInfo(int render_process_id,
|
2017-01-19 00:37:56 +01:00
|
|
|
for (size_t i = 0; i < plugins.size(); ++i) {
|
|
|
|
if (!filter_ ||
|
2019-10-01 15:55:16 +02:00
|
|
|
filter_->IsPluginAvailable(render_process_id, render_frame_id, url,
|
|
|
|
- main_frame_origin, &plugins[i])) {
|
|
|
|
+ is_main_frame, main_frame_origin,
|
2017-01-19 00:37:56 +01:00
|
|
|
+ &plugins[i])) {
|
|
|
|
*info = plugins[i];
|
|
|
|
if (actual_mime_type)
|
|
|
|
*actual_mime_type = mime_types[i];
|
|
|
|
diff --git content/browser/plugin_service_impl.h content/browser/plugin_service_impl.h
|
2020-03-04 01:29:39 +01:00
|
|
|
index 79ac3b705511..71d73d3da158 100644
|
2017-01-19 00:37:56 +01:00
|
|
|
--- content/browser/plugin_service_impl.h
|
|
|
|
+++ content/browser/plugin_service_impl.h
|
2019-10-01 15:55:16 +02:00
|
|
|
@@ -54,6 +54,7 @@ class CONTENT_EXPORT PluginServiceImpl : public PluginService {
|
|
|
|
bool GetPluginInfo(int render_process_id,
|
2017-01-19 00:37:56 +01:00
|
|
|
int render_frame_id,
|
|
|
|
const GURL& url,
|
|
|
|
+ bool is_main_frame,
|
|
|
|
const url::Origin& main_frame_origin,
|
|
|
|
const std::string& mime_type,
|
|
|
|
bool allow_wildcard,
|
2018-07-02 19:11:49 +02:00
|
|
|
diff --git content/browser/renderer_host/plugin_registry_impl.cc content/browser/renderer_host/plugin_registry_impl.cc
|
2019-10-01 15:55:16 +02:00
|
|
|
index a6d6188fb139..7ac57de6fd55 100644
|
2018-07-02 19:11:49 +02:00
|
|
|
--- content/browser/renderer_host/plugin_registry_impl.cc
|
|
|
|
+++ content/browser/renderer_host/plugin_registry_impl.cc
|
2019-10-01 15:55:16 +02:00
|
|
|
@@ -29,6 +29,7 @@ void PluginRegistryImpl::Bind(
|
2018-07-02 19:11:49 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void PluginRegistryImpl::GetPlugins(bool refresh,
|
|
|
|
+ bool is_main_frame,
|
|
|
|
const url::Origin& main_frame_origin,
|
|
|
|
GetPluginsCallback callback) {
|
|
|
|
auto* plugin_service = PluginServiceImpl::GetInstance();
|
2019-10-01 15:55:16 +02:00
|
|
|
@@ -50,10 +51,11 @@ void PluginRegistryImpl::GetPlugins(bool refresh,
|
2018-07-02 19:11:49 +02:00
|
|
|
|
|
|
|
plugin_service->GetPlugins(base::BindOnce(
|
|
|
|
&PluginRegistryImpl::GetPluginsComplete, weak_factory_.GetWeakPtr(),
|
|
|
|
- main_frame_origin, std::move(callback)));
|
|
|
|
+ is_main_frame, main_frame_origin, std::move(callback)));
|
|
|
|
}
|
|
|
|
|
|
|
|
void PluginRegistryImpl::GetPluginsComplete(
|
|
|
|
+ bool is_main_frame,
|
|
|
|
const url::Origin& main_frame_origin,
|
|
|
|
GetPluginsCallback callback,
|
|
|
|
const std::vector<WebPluginInfo>& all_plugins) {
|
2019-10-01 15:55:16 +02:00
|
|
|
@@ -76,6 +78,7 @@ void PluginRegistryImpl::GetPluginsComplete(
|
|
|
|
// TODO(crbug.com/621724): Pass an url::Origin instead of a GURL.
|
|
|
|
if (!filter || filter->IsPluginAvailable(render_process_id_, routing_id,
|
|
|
|
main_frame_origin.GetURL(),
|
|
|
|
+ is_main_frame,
|
|
|
|
main_frame_origin, &plugin)) {
|
2018-07-02 19:11:49 +02:00
|
|
|
auto plugin_blink = blink::mojom::PluginInfo::New();
|
|
|
|
plugin_blink->name = plugin.name;
|
|
|
|
diff --git content/browser/renderer_host/plugin_registry_impl.h content/browser/renderer_host/plugin_registry_impl.h
|
2019-10-01 15:55:16 +02:00
|
|
|
index 632ae86c6fd6..55b749ec1242 100644
|
2018-07-02 19:11:49 +02:00
|
|
|
--- content/browser/renderer_host/plugin_registry_impl.h
|
|
|
|
+++ content/browser/renderer_host/plugin_registry_impl.h
|
2019-10-01 15:55:16 +02:00
|
|
|
@@ -24,11 +24,13 @@ class PluginRegistryImpl : public blink::mojom::PluginRegistry {
|
2018-07-02 19:11:49 +02:00
|
|
|
|
|
|
|
// blink::mojom::PluginRegistry
|
|
|
|
void GetPlugins(bool refresh,
|
|
|
|
+ bool is_main_frame,
|
|
|
|
const url::Origin& main_frame_origin,
|
|
|
|
GetPluginsCallback callback) override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
- void GetPluginsComplete(const url::Origin& main_frame_origin,
|
|
|
|
+ void GetPluginsComplete(bool is_main_frame,
|
|
|
|
+ const url::Origin& main_frame_origin,
|
|
|
|
GetPluginsCallback callback,
|
|
|
|
const std::vector<WebPluginInfo>& all_plugins);
|
|
|
|
|
2017-01-19 00:37:56 +01:00
|
|
|
diff --git content/common/frame_messages.h content/common/frame_messages.h
|
2020-08-29 00:39:23 +02:00
|
|
|
index 33db23c32723..acde4d008de3 100644
|
2017-01-19 00:37:56 +01:00
|
|
|
--- content/common/frame_messages.h
|
|
|
|
+++ content/common/frame_messages.h
|
2020-08-29 00:39:23 +02:00
|
|
|
@@ -502,9 +502,10 @@ IPC_MESSAGE_ROUTED1(FrameHostMsg_PepperStopsPlayback,
|
2017-01-19 00:37:56 +01:00
|
|
|
// type. If there is no matching plugin, |found| is false.
|
|
|
|
// |actual_mime_type| is the actual mime type supported by the
|
|
|
|
// found plugin.
|
|
|
|
-IPC_SYNC_MESSAGE_CONTROL4_3(FrameHostMsg_GetPluginInfo,
|
|
|
|
+IPC_SYNC_MESSAGE_CONTROL5_3(FrameHostMsg_GetPluginInfo,
|
|
|
|
int /* render_frame_id */,
|
|
|
|
GURL /* url */,
|
|
|
|
+ bool /* is_main_frame */,
|
|
|
|
url::Origin /* main_frame_origin */,
|
|
|
|
std::string /* mime_type */,
|
|
|
|
bool /* found */,
|
2020-03-30 22:13:42 +02:00
|
|
|
diff --git content/public/browser/content_browser_client.cc content/public/browser/content_browser_client.cc
|
2020-08-29 00:39:23 +02:00
|
|
|
index e112645811cb..7758de1bf201 100644
|
2020-03-30 22:13:42 +02:00
|
|
|
--- content/public/browser/content_browser_client.cc
|
|
|
|
+++ content/public/browser/content_browser_client.cc
|
|
|
|
@@ -9,7 +9,7 @@
|
|
|
|
// declarations instead of including more headers. If that is infeasible, adjust
|
|
|
|
// the limit. For more info, see
|
|
|
|
// https://chromium.googlesource.com/chromium/src/+/HEAD/docs/wmax_tokens.md
|
2020-08-29 00:39:23 +02:00
|
|
|
-#pragma clang max_tokens_here 880000
|
|
|
|
+// #pragma clang max_tokens_here 880000
|
2020-03-30 22:13:42 +02:00
|
|
|
|
|
|
|
#include <utility>
|
|
|
|
|
2019-04-24 04:50:25 +02:00
|
|
|
diff --git content/public/browser/content_browser_client.h content/public/browser/content_browser_client.h
|
2020-08-29 00:39:23 +02:00
|
|
|
index 428ec871deba..16ac7abd2f04 100644
|
2019-04-24 04:50:25 +02:00
|
|
|
--- content/public/browser/content_browser_client.h
|
|
|
|
+++ content/public/browser/content_browser_client.h
|
2020-08-29 00:39:23 +02:00
|
|
|
@@ -31,6 +31,7 @@
|
2019-11-12 17:11:44 +01:00
|
|
|
#include "content/public/browser/certificate_request_result_type.h"
|
|
|
|
#include "content/public/browser/generated_code_cache_settings.h"
|
2020-07-08 19:23:29 +02:00
|
|
|
#include "content/public/browser/storage_partition_config.h"
|
2019-11-12 17:11:44 +01:00
|
|
|
+#include "content/public/browser/web_contents.h"
|
2020-02-10 18:10:17 +01:00
|
|
|
#include "content/public/common/page_visibility_state.h"
|
2019-11-12 17:11:44 +01:00
|
|
|
#include "content/public/common/window_container_type.mojom-forward.h"
|
2020-08-29 00:39:23 +02:00
|
|
|
#include "device/vr/buildflags/buildflags.h"
|
|
|
|
@@ -1664,6 +1665,14 @@ class CONTENT_EXPORT ContentBrowserClient {
|
2019-11-12 17:11:44 +01:00
|
|
|
const base::Optional<url::Origin>& initiating_origin,
|
2020-02-10 18:10:17 +01:00
|
|
|
mojo::PendingRemote<network::mojom::URLLoaderFactory>* out_factory);
|
2019-04-24 04:50:25 +02:00
|
|
|
|
|
|
|
+ // Same as above, but exposing the whole ResourceRequest object.
|
|
|
|
+ virtual bool HandleExternalProtocol(
|
2019-10-01 15:55:16 +02:00
|
|
|
+ WebContents::Getter web_contents_getter,
|
2019-04-24 04:50:25 +02:00
|
|
|
+ int frame_tree_node_id,
|
|
|
|
+ NavigationUIData* navigation_data,
|
|
|
|
+ const network::ResourceRequest& request,
|
2020-02-10 18:10:17 +01:00
|
|
|
+ mojo::PendingRemote<network::mojom::URLLoaderFactory>* out_factory) { return false; }
|
2019-04-24 04:50:25 +02:00
|
|
|
+
|
|
|
|
// Creates an OverlayWindow to be used for Picture-in-Picture. This window
|
|
|
|
// will house the content shown when in Picture-in-Picture mode. This will
|
|
|
|
// return a new OverlayWindow.
|
2020-08-29 00:39:23 +02:00
|
|
|
@@ -1735,6 +1744,10 @@ class CONTENT_EXPORT ContentBrowserClient {
|
2019-04-24 04:50:25 +02:00
|
|
|
// Used as part of the user agent string.
|
2019-09-04 17:13:32 +02:00
|
|
|
virtual std::string GetProduct();
|
2019-04-24 04:50:25 +02:00
|
|
|
|
|
|
|
+ // Returns the Chrome-specific product string. This is used for compatibility
|
|
|
|
+ // purposes with external tools like Selenium.
|
2019-09-04 17:13:32 +02:00
|
|
|
+ virtual std::string GetChromeProduct() { return GetProduct(); }
|
2019-04-24 04:50:25 +02:00
|
|
|
+
|
|
|
|
// Returns the user agent. Content may cache this value.
|
2019-09-04 17:13:32 +02:00
|
|
|
virtual std::string GetUserAgent();
|
2019-04-24 04:50:25 +02:00
|
|
|
|
2017-01-19 00:37:56 +01:00
|
|
|
diff --git content/public/browser/plugin_service.h content/public/browser/plugin_service.h
|
2019-10-01 15:55:16 +02:00
|
|
|
index dcfd3ff37186..4e822ee5f750 100644
|
2017-01-19 00:37:56 +01:00
|
|
|
--- content/public/browser/plugin_service.h
|
|
|
|
+++ content/public/browser/plugin_service.h
|
2019-10-01 15:55:16 +02:00
|
|
|
@@ -74,6 +74,7 @@ class CONTENT_EXPORT PluginService {
|
|
|
|
virtual bool GetPluginInfo(int render_process_id,
|
2017-01-19 00:37:56 +01:00
|
|
|
int render_frame_id,
|
|
|
|
const GURL& url,
|
|
|
|
+ bool is_main_frame,
|
|
|
|
const url::Origin& main_frame_origin,
|
|
|
|
const std::string& mime_type,
|
|
|
|
bool allow_wildcard,
|
|
|
|
diff --git content/public/browser/plugin_service_filter.h content/public/browser/plugin_service_filter.h
|
2019-10-01 15:55:16 +02:00
|
|
|
index 98c59005599e..69752184745d 100644
|
2017-01-19 00:37:56 +01:00
|
|
|
--- content/public/browser/plugin_service_filter.h
|
|
|
|
+++ content/public/browser/plugin_service_filter.h
|
2019-10-01 15:55:16 +02:00
|
|
|
@@ -32,6 +32,7 @@ class PluginServiceFilter {
|
|
|
|
virtual bool IsPluginAvailable(int render_process_id,
|
2017-01-19 00:37:56 +01:00
|
|
|
int render_frame_id,
|
|
|
|
const GURL& url,
|
|
|
|
+ bool is_main_frame,
|
|
|
|
const url::Origin& main_frame_origin,
|
|
|
|
WebPluginInfo* plugin) = 0;
|
|
|
|
|
2017-04-20 21:28:17 +02:00
|
|
|
diff --git content/public/renderer/content_renderer_client.h content/public/renderer/content_renderer_client.h
|
2020-08-29 00:39:23 +02:00
|
|
|
index 5b0784c844bd..a7b6d3f3c237 100644
|
2017-04-20 21:28:17 +02:00
|
|
|
--- content/public/renderer/content_renderer_client.h
|
|
|
|
+++ content/public/renderer/content_renderer_client.h
|
2020-08-29 00:39:23 +02:00
|
|
|
@@ -84,6 +84,9 @@ class CONTENT_EXPORT ContentRendererClient {
|
2020-02-10 18:10:17 +01:00
|
|
|
// binding requests from RenderProcessHost::BindReceiver().
|
|
|
|
virtual void ExposeInterfacesToBrowser(mojo::BinderMap* binders) {}
|
2017-05-31 17:33:30 +02:00
|
|
|
|
|
|
|
+ // Notifies that the RenderThread can now send sync IPC messages.
|
|
|
|
+ virtual void RenderThreadConnected() {}
|
|
|
|
+
|
|
|
|
// Notifies that a new RenderFrame has been created.
|
|
|
|
virtual void RenderFrameCreated(RenderFrame* render_frame) {}
|
|
|
|
|
2020-08-29 00:39:23 +02:00
|
|
|
@@ -325,6 +328,10 @@ class CONTENT_EXPORT ContentRendererClient {
|
2017-12-07 22:44:24 +01:00
|
|
|
// This method may invalidate the frame.
|
|
|
|
virtual void RunScriptsAtDocumentIdle(RenderFrame* render_frame) {}
|
|
|
|
|
|
|
|
+ // Notifies that a DevTools agent has attached or detached.
|
2018-02-15 01:12:09 +01:00
|
|
|
+ virtual void DevToolsAgentAttached() {}
|
|
|
|
+ virtual void DevToolsAgentDetached() {}
|
2017-12-07 22:44:24 +01:00
|
|
|
+
|
|
|
|
// Allows subclasses to enable some runtime features before Blink has
|
|
|
|
// started.
|
|
|
|
virtual void SetRuntimeFeaturesDefaultsBeforeBlinkInitialization() {}
|
2017-01-19 00:37:56 +01:00
|
|
|
diff --git content/renderer/render_frame_impl.cc content/renderer/render_frame_impl.cc
|
2020-08-29 00:39:23 +02:00
|
|
|
index 16a16b1f075d..94942f76489c 100644
|
2017-01-19 00:37:56 +01:00
|
|
|
--- content/renderer/render_frame_impl.cc
|
|
|
|
+++ content/renderer/render_frame_impl.cc
|
2020-08-29 00:39:23 +02:00
|
|
|
@@ -3853,7 +3853,8 @@ blink::WebPlugin* RenderFrameImpl::CreatePlugin(
|
2017-01-19 00:37:56 +01:00
|
|
|
std::string mime_type;
|
|
|
|
bool found = false;
|
|
|
|
Send(new FrameHostMsg_GetPluginInfo(
|
2017-05-31 17:33:30 +02:00
|
|
|
- routing_id_, params.url, frame_->Top()->GetSecurityOrigin(),
|
|
|
|
+ routing_id_, params.url, frame_->Parent() == nullptr,
|
|
|
|
+ frame_->Top()->GetSecurityOrigin(),
|
2017-04-20 21:28:17 +02:00
|
|
|
params.mime_type.Utf8(), &found, &info, &mime_type));
|
2017-01-19 00:37:56 +01:00
|
|
|
if (!found)
|
2017-05-31 17:33:30 +02:00
|
|
|
return nullptr;
|
|
|
|
diff --git content/renderer/render_thread_impl.cc content/renderer/render_thread_impl.cc
|
2020-08-29 00:39:23 +02:00
|
|
|
index a6118f1f5ce1..7ae0e25160bb 100644
|
2017-05-31 17:33:30 +02:00
|
|
|
--- content/renderer/render_thread_impl.cc
|
|
|
|
+++ content/renderer/render_thread_impl.cc
|
2020-08-29 00:39:23 +02:00
|
|
|
@@ -632,6 +632,8 @@ void RenderThreadImpl::Init() {
|
2020-02-10 18:10:17 +01:00
|
|
|
GetContentClient()->renderer()->CreateURLLoaderThrottleProvider(
|
|
|
|
URLLoaderThrottleProviderType::kFrame);
|
2017-05-31 17:33:30 +02:00
|
|
|
|
|
|
|
+ GetContentClient()->renderer()->RenderThreadConnected();
|
|
|
|
+
|
2019-07-16 19:59:21 +02:00
|
|
|
GetAssociatedInterfaceRegistry()->AddInterface(base::BindRepeating(
|
2019-11-12 17:11:44 +01:00
|
|
|
&RenderThreadImpl::OnRendererInterfaceReceiver, base::Unretained(this)));
|
2019-07-16 19:59:21 +02:00
|
|
|
|
2017-01-19 00:37:56 +01:00
|
|
|
diff --git content/renderer/renderer_blink_platform_impl.cc content/renderer/renderer_blink_platform_impl.cc
|
2020-08-29 00:39:23 +02:00
|
|
|
index d6375e9d16dc..b9e33ebe62d1 100644
|
2017-01-19 00:37:56 +01:00
|
|
|
--- content/renderer/renderer_blink_platform_impl.cc
|
|
|
|
+++ content/renderer/renderer_blink_platform_impl.cc
|
2020-08-29 00:39:23 +02:00
|
|
|
@@ -915,6 +915,15 @@ void RendererBlinkPlatformImpl::SetRenderingColorSpace(
|
2019-03-13 22:27:37 +01:00
|
|
|
|
|
|
|
//------------------------------------------------------------------------------
|
2018-02-15 01:12:09 +01:00
|
|
|
|
|
|
|
+void RendererBlinkPlatformImpl::DevToolsAgentAttached() {
|
|
|
|
+ GetContentClient()->renderer()->DevToolsAgentAttached();
|
|
|
|
+}
|
|
|
|
+void RendererBlinkPlatformImpl::DevToolsAgentDetached() {
|
|
|
|
+ GetContentClient()->renderer()->DevToolsAgentDetached();
|
|
|
|
+}
|
|
|
|
+
|
2019-09-04 17:13:32 +02:00
|
|
|
+//------------------------------------------------------------------------------
|
|
|
|
+
|
|
|
|
blink::mojom::CodeCacheHost& RendererBlinkPlatformImpl::GetCodeCacheHost() {
|
|
|
|
if (!code_cache_host_) {
|
2019-10-01 15:55:16 +02:00
|
|
|
code_cache_host_ = mojo::SharedRemote<blink::mojom::CodeCacheHost>(
|
2017-01-19 00:37:56 +01:00
|
|
|
diff --git content/renderer/renderer_blink_platform_impl.h content/renderer/renderer_blink_platform_impl.h
|
2020-08-29 00:39:23 +02:00
|
|
|
index cfced914c88d..a8f1ffc14cb7 100644
|
2017-01-19 00:37:56 +01:00
|
|
|
--- content/renderer/renderer_blink_platform_impl.h
|
|
|
|
+++ content/renderer/renderer_blink_platform_impl.h
|
2020-08-29 00:39:23 +02:00
|
|
|
@@ -210,6 +210,9 @@ class CONTENT_EXPORT RendererBlinkPlatformImpl : public BlinkPlatformImpl {
|
2019-09-04 17:13:32 +02:00
|
|
|
media::GpuVideoAcceleratorFactories* GetGpuFactories() override;
|
2020-08-29 00:39:23 +02:00
|
|
|
void SetRenderingColorSpace(const gfx::ColorSpace& color_space) override;
|
2018-02-15 01:12:09 +01:00
|
|
|
|
|
|
|
+ void DevToolsAgentAttached() override;
|
|
|
|
+ void DevToolsAgentDetached() override;
|
|
|
|
+
|
2020-08-29 00:39:23 +02:00
|
|
|
// Tells this platform that the renderer is locked to a site (i.e., a scheme
|
|
|
|
// plus eTLD+1, such as https://google.com), or to a more specific origin.
|
|
|
|
void SetIsLockedToSite();
|
2017-05-31 17:33:30 +02:00
|
|
|
diff --git content/shell/browser/shell_plugin_service_filter.cc content/shell/browser/shell_plugin_service_filter.cc
|
2019-10-01 15:55:16 +02:00
|
|
|
index 427132c6920e..4809ddaf21e1 100644
|
2017-05-31 17:33:30 +02:00
|
|
|
--- content/shell/browser/shell_plugin_service_filter.cc
|
|
|
|
+++ content/shell/browser/shell_plugin_service_filter.cc
|
2019-10-01 15:55:16 +02:00
|
|
|
@@ -17,6 +17,7 @@ bool ShellPluginServiceFilter::IsPluginAvailable(
|
|
|
|
int render_process_id,
|
2017-05-31 17:33:30 +02:00
|
|
|
int render_frame_id,
|
|
|
|
const GURL& url,
|
|
|
|
+ bool is_main_frame,
|
|
|
|
const url::Origin& main_frame_origin,
|
|
|
|
WebPluginInfo* plugin) {
|
|
|
|
return plugin->name == base::ASCIIToUTF16("Blink Test Plugin") ||
|
|
|
|
diff --git content/shell/browser/shell_plugin_service_filter.h content/shell/browser/shell_plugin_service_filter.h
|
2019-10-01 15:55:16 +02:00
|
|
|
index 337b4b0653fe..107ab4c9d8a8 100644
|
2017-05-31 17:33:30 +02:00
|
|
|
--- content/shell/browser/shell_plugin_service_filter.h
|
|
|
|
+++ content/shell/browser/shell_plugin_service_filter.h
|
2019-10-01 15:55:16 +02:00
|
|
|
@@ -20,6 +20,7 @@ class ShellPluginServiceFilter : public PluginServiceFilter {
|
|
|
|
bool IsPluginAvailable(int render_process_id,
|
2017-05-31 17:33:30 +02:00
|
|
|
int render_frame_id,
|
|
|
|
const GURL& url,
|
|
|
|
+ bool is_main_frame,
|
|
|
|
const url::Origin& main_frame_origin,
|
|
|
|
WebPluginInfo* plugin) override;
|
|
|
|
|
|
|
|
diff --git content/test/fake_plugin_service.cc content/test/fake_plugin_service.cc
|
2019-10-01 15:55:16 +02:00
|
|
|
index eb280cd21c6d..b499b2536b2d 100644
|
2017-05-31 17:33:30 +02:00
|
|
|
--- content/test/fake_plugin_service.cc
|
|
|
|
+++ content/test/fake_plugin_service.cc
|
2019-10-01 15:55:16 +02:00
|
|
|
@@ -28,6 +28,7 @@ bool FakePluginService::GetPluginInfoArray(
|
|
|
|
bool FakePluginService::GetPluginInfo(int render_process_id,
|
2017-05-31 17:33:30 +02:00
|
|
|
int render_frame_id,
|
|
|
|
const GURL& url,
|
|
|
|
+ bool is_main_frame,
|
|
|
|
const url::Origin& main_frame_origin,
|
|
|
|
const std::string& mime_type,
|
|
|
|
bool allow_wildcard,
|
|
|
|
diff --git content/test/fake_plugin_service.h content/test/fake_plugin_service.h
|
2019-10-01 15:55:16 +02:00
|
|
|
index df49da7cbec0..edf526fff7f8 100644
|
2017-05-31 17:33:30 +02:00
|
|
|
--- content/test/fake_plugin_service.h
|
|
|
|
+++ content/test/fake_plugin_service.h
|
2019-10-01 15:55:16 +02:00
|
|
|
@@ -29,6 +29,7 @@ class FakePluginService : public PluginService {
|
|
|
|
bool GetPluginInfo(int render_process_id,
|
2017-05-31 17:33:30 +02:00
|
|
|
int render_frame_id,
|
|
|
|
const GURL& url,
|
|
|
|
+ bool is_main_frame,
|
|
|
|
const url::Origin& main_frame_origin,
|
|
|
|
const std::string& mime_type,
|
|
|
|
bool allow_wildcard,
|