summaryrefslogtreecommitdiffstats
path: root/src/core/content_browser_client_qt.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/content_browser_client_qt.cpp')
-rw-r--r--src/core/content_browser_client_qt.cpp69
1 files changed, 63 insertions, 6 deletions
diff --git a/src/core/content_browser_client_qt.cpp b/src/core/content_browser_client_qt.cpp
index d446d8ff4..97d3ad6bb 100644
--- a/src/core/content_browser_client_qt.cpp
+++ b/src/core/content_browser_client_qt.cpp
@@ -46,7 +46,7 @@
#if BUILDFLAG(ENABLE_SPELLCHECK)
#include "chrome/browser/spellchecker/spellcheck_message_filter.h"
#if BUILDFLAG(USE_BROWSER_SPELLCHECKER)
-#include "chrome/browser/spellchecker/spellcheck_message_filter_platform.h"
+#include "components/spellcheck/browser/spellcheck_message_filter_platform.h"
#endif
#endif
#include "content/browser/renderer_host/render_view_host_delegate.h"
@@ -59,6 +59,7 @@
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/render_view_host.h"
#include "content/public/browser/resource_dispatcher_host.h"
+#include "content/public/browser/storage_partition.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_user_data.h"
#include "content/public/common/content_switches.h"
@@ -68,7 +69,8 @@
#include "device/geolocation/geolocation_provider.h"
#include "mojo/public/cpp/bindings/binding.h"
#include "mojo/public/cpp/bindings/binding_set.h"
-#include "services/service_manager/public/cpp/interface_registry.h"
+#include "services/service_manager/public/cpp/bind_source_info.h"
+#include "services/service_manager/public/cpp/binder_registry.h"
#include "third_party/WebKit/public/platform/modules/sensitive_input_visibility/sensitive_input_visibility_service.mojom.h"
#include "ui/base/ui_base_switches.h"
#include "ui/display/screen.h"
@@ -107,7 +109,7 @@
#include "ui/base/resource/resource_bundle.h"
#endif
-#if defined(ENABLE_PLUGINS)
+#if BUILDFLAG(ENABLE_PLUGINS)
#include "content/public/browser/browser_ppapi_host.h"
#include "ppapi/host/ppapi_host.h"
#include "renderer_host/pepper/pepper_host_factory_qt.h"
@@ -459,6 +461,17 @@ content::QuotaPermissionContext *ContentBrowserClientQt::CreateQuotaPermissionCo
return new QuotaPermissionContextQt;
}
+void ContentBrowserClientQt::GetQuotaSettings(content::BrowserContext *context,
+ content::StoragePartition *partition,
+ const storage::OptionalQuotaSettingsCallback &callback)
+{
+ content::BrowserThread::PostTaskAndReplyWithResult(
+ content::BrowserThread::FILE, FROM_HERE,
+ base::Bind(&storage::CalculateNominalDynamicSettings,
+ partition->GetPath(), context->IsOffTheRecord()),
+ callback);
+}
+
void ContentBrowserClientQt::AllowCertificateError(content::WebContents *webContents,
int cert_error,
const net::SSLInfo& ssl_info,
@@ -477,6 +490,7 @@ void ContentBrowserClientQt::AllowCertificateError(content::WebContents *webCont
void ContentBrowserClientQt::SelectClientCertificate(content::WebContents * /*webContents*/,
net::SSLCertRequestInfo * /*certRequestInfo*/,
+ net::CertificateList /*client_certs*/,
std::unique_ptr<content::ClientCertificateDelegate> delegate)
{
delegate->ContinueWithCertificate(nullptr);
@@ -522,7 +536,7 @@ void ContentBrowserClientQt::GetAdditionalMappedFilesForChildProcess(const base:
}
#endif
-#if defined(ENABLE_PLUGINS)
+#if BUILDFLAG(ENABLE_PLUGINS)
void ContentBrowserClientQt::DidCreatePpapiPlugin(content::BrowserPpapiHost* browser_host)
{
browser_host->GetPpapiHost()->AddHostFactoryFilter(
@@ -557,6 +571,7 @@ public:
return FromWebContents(web_contents);
}
static void BindSensitiveInputVisibilityService(content::RenderFrameHost* render_frame_host,
+ const service_manager::BindSourceInfo& source_info,
blink::mojom::SensitiveInputVisibilityServiceRequest request)
{
CreateForRenderFrameHost(render_frame_host);
@@ -583,12 +598,54 @@ private:
};
-void ContentBrowserClientQt::RegisterRenderFrameMojoInterfaces(service_manager::InterfaceRegistry* registry,
- content::RenderFrameHost* render_frame_host)
+void ContentBrowserClientQt::ExposeInterfacesToFrame(service_manager::BinderRegistry* registry,
+ content::RenderFrameHost* render_frame_host)
{
registry->AddInterface(base::Bind(&ServiceDriver::BindSensitiveInputVisibilityService, render_frame_host));
}
+bool ContentBrowserClientQt::CanCreateWindow(
+ content::RenderFrameHost* opener,
+ const GURL& opener_url,
+ const GURL& opener_top_level_frame_url,
+ const GURL& source_origin,
+ content::mojom::WindowContainerType container_type,
+ const GURL& target_url,
+ const content::Referrer& referrer,
+ const std::string& frame_name,
+ WindowOpenDisposition disposition,
+ const blink::mojom::WindowFeatures& features,
+ bool user_gesture,
+ bool opener_suppressed,
+ bool* no_javascript_access) {
+
+ Q_UNUSED(opener_url);
+ Q_UNUSED(opener_top_level_frame_url);
+ Q_UNUSED(source_origin);
+ Q_UNUSED(container_type);
+ Q_UNUSED(target_url);
+ Q_UNUSED(referrer);
+ Q_UNUSED(frame_name);
+ Q_UNUSED(disposition);
+ Q_UNUSED(features);
+ Q_UNUSED(opener_suppressed);
+
+ if (no_javascript_access)
+ *no_javascript_access = false;
+
+ content::WebContents* webContents = content::WebContents::FromRenderFrameHost(opener);
+
+ WebEngineSettings *settings = nullptr;
+ if (webContents) {
+ WebContentsDelegateQt* delegate =
+ static_cast<WebContentsDelegateQt*>(webContents->GetDelegate());
+ if (delegate)
+ settings = delegate->webEngineSettings();
+ }
+
+ return (settings && settings->getJavaScriptCanOpenWindowsAutomatically()) || user_gesture;
+}
+
} // namespace QtWebEngineCore
DEFINE_WEB_CONTENTS_USER_DATA_KEY(QtWebEngineCore::ServiceDriver);