summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--.qmake.conf2
-rw-r--r--examples/webengine/quicknanobrowser/BrowserDialog.qml12
-rw-r--r--examples/webengine/quicknanobrowser/BrowserWindow.qml9
-rw-r--r--examples/webenginewidgets/simplebrowser/webpopupwindow.cpp7
-rw-r--r--mkspecs/features/gn_generator.prf36
m---------src/3rdparty0
-rw-r--r--src/core/clipboard_qt.h2
-rw-r--r--src/core/content_browser_client_qt.cpp16
-rw-r--r--src/core/content_browser_client_qt.h2
-rw-r--r--src/core/core_chromium.pri17
-rw-r--r--src/core/devtools.qrc5
-rw-r--r--src/core/devtools_manager_delegate_qt.cpp (renamed from src/core/dev_tools_http_handler_delegate_qt.cpp)23
-rw-r--r--src/core/devtools_manager_delegate_qt.h (renamed from src/core/dev_tools_http_handler_delegate_qt.h)0
-rw-r--r--src/core/network_delegate_qt.h41
-rw-r--r--src/core/qtwebengine.gni1
-rw-r--r--src/core/qtwebengine_resources.gni6
-rw-r--r--src/core/qtwebengine_sources.gni27
-rw-r--r--src/core/quota_permission_context_qt.cpp107
-rw-r--r--src/core/quota_permission_context_qt.h61
-rw-r--r--src/core/quota_permission_controller.cpp98
-rw-r--r--src/core/quota_permission_controller.h70
-rw-r--r--src/core/quota_permission_controller_p.h66
-rw-r--r--src/core/render_widget_host_view_qt.cpp1
-rw-r--r--src/core/render_widget_host_view_qt.h1
-rw-r--r--src/core/renderer/web_channel_ipc_transport.cpp2
-rw-r--r--src/core/renderer_host/resource_dispatcher_host_delegate_qt.cpp10
-rw-r--r--src/core/resources/devtools_discovery_page.html140
-rw-r--r--src/core/ssl_host_state_delegate_qt.h12
-rw-r--r--src/core/url_request_context_getter_qt.cpp17
-rw-r--r--src/core/web_contents_adapter_client.h4
-rw-r--r--src/core/web_contents_delegate_qt.cpp51
-rw-r--r--src/core/web_contents_delegate_qt.h2
-rw-r--r--src/core/web_engine_context.cpp6
-rw-r--r--src/core/web_engine_settings.cpp18
-rw-r--r--src/core/web_engine_settings.h12
-rw-r--r--src/core/webui/webui_controller_factory_qt.cpp219
-rw-r--r--src/core/webui/webui_controller_factory_qt.h79
-rw-r--r--src/plugins/qwebengineview/qwebengineview_plugin.h22
-rw-r--r--src/webengine/api/qquickwebengineprofile_p.h4
-rw-r--r--src/webengine/api/qquickwebenginesettings.cpp41
-rw-r--r--src/webengine/api/qquickwebenginesettings_p.h12
-rw-r--r--src/webengine/api/qquickwebengineview.cpp43
-rw-r--r--src/webengine/api/qquickwebengineview_p.h43
-rw-r--r--src/webengine/api/qquickwebengineview_p_p.h129
-rw-r--r--src/webengine/doc/src/webengineview_lgpl.qdoc80
-rw-r--r--src/webengine/plugin/plugin.cpp8
-rw-r--r--src/webengine/plugin/plugin.pro2
-rw-r--r--src/webengine/plugin/plugins.qmltypes41
-rw-r--r--src/webengine/render_widget_host_view_qt_delegate_quick.h80
-rw-r--r--src/webengine/render_widget_host_view_qt_delegate_quickwindow.h48
-rw-r--r--src/webenginewidgets/api/qwebenginepage.cpp24
-rw-r--r--src/webenginewidgets/api/qwebenginepage.h2
-rw-r--r--src/webenginewidgets/api/qwebenginepage_p.h115
-rw-r--r--src/webenginewidgets/api/qwebengineprofile_p.h4
-rw-r--r--src/webenginewidgets/api/qwebenginequotapermissionrequest.cpp98
-rw-r--r--src/webenginewidgets/api/qwebenginequotapermissionrequest.h71
-rw-r--r--src/webenginewidgets/api/qwebenginesettings.cpp25
-rw-r--r--src/webenginewidgets/api/qwebenginesettings.h10
-rw-r--r--src/webenginewidgets/api/qwebengineview.h18
-rw-r--r--src/webenginewidgets/api/qwebengineview_p.h6
-rw-r--r--src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc8
-rw-r--r--src/webenginewidgets/doc/src/qwebenginesettings_lgpl.qdoc40
-rw-r--r--src/webenginewidgets/render_widget_host_view_qt_delegate_widget.h58
-rw-r--r--src/webenginewidgets/ui/messagebubblewidget_p.h2
-rw-r--r--src/webenginewidgets/webenginewidgets.pro2
-rw-r--r--tests/auto/quick/publicapi/tst_publicapi.cpp6
-rw-r--r--tests/auto/quick/qmltests/data/TestWebEngineView.qml2
-rw-r--r--tests/auto/widgets/qwebenginefaviconmanager/tst_qwebenginefaviconmanager.cpp2
-rw-r--r--tests/auto/widgets/qwebenginehistory/tst_qwebenginehistory.cpp21
-rw-r--r--tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp42
-rw-r--r--tests/auto/widgets/qwebengineschemes/BLACKLIST0
-rw-r--r--tests/auto/widgets/qwebengineschemes/qwebengineschemes.pro3
-rw-r--r--tests/auto/widgets/qwebengineschemes/tst_qwebengineschemes.cpp110
-rw-r--r--tests/auto/widgets/widgets.pro6
74 files changed, 1880 insertions, 530 deletions
diff --git a/.qmake.conf b/.qmake.conf
index 76ab2f4b2..d4700d4ce 100644
--- a/.qmake.conf
+++ b/.qmake.conf
@@ -5,4 +5,4 @@ QTWEBENGINE_OUT_ROOT = $$shadowed($$PWD)
load(qt_build_config)
CONFIG += warning_clean
-MODULE_VERSION = 5.10.0
+MODULE_VERSION = 5.11.0
diff --git a/examples/webengine/quicknanobrowser/BrowserDialog.qml b/examples/webengine/quicknanobrowser/BrowserDialog.qml
index d060e2828..770cfee6a 100644
--- a/examples/webengine/quicknanobrowser/BrowserDialog.qml
+++ b/examples/webengine/quicknanobrowser/BrowserDialog.qml
@@ -50,11 +50,12 @@
import QtQuick 2.1
import QtQuick.Window 2.2
-import QtWebEngine 1.2
+import QtWebEngine 1.7
Window {
+ id: window
property alias currentWebView: webView
- flags: Qt.Dialog
+ flags: Qt.Dialog | Qt.WindowStaysOnTopHint
width: 800
height: 600
visible: true
@@ -62,5 +63,12 @@ Window {
WebEngineView {
id: webView
anchors.fill: parent
+
+ onGeometryChangeRequested: {
+ window.x = geometry.x
+ window.y = geometry.y
+ window.width = geometry.width
+ window.height = geometry.height
+ }
}
}
diff --git a/examples/webengine/quicknanobrowser/BrowserWindow.qml b/examples/webengine/quicknanobrowser/BrowserWindow.qml
index 16efc9e37..633ec7a98 100644
--- a/examples/webengine/quicknanobrowser/BrowserWindow.qml
+++ b/examples/webengine/quicknanobrowser/BrowserWindow.qml
@@ -57,7 +57,7 @@ import QtQuick.Controls.Styles 1.0
import QtQuick.Dialogs 1.2
import QtQuick.Layouts 1.0
import QtQuick.Window 2.1
-import QtWebEngine 1.3
+import QtWebEngine 1.7
ApplicationWindow {
id: browserWindow
@@ -423,6 +423,13 @@ ApplicationWindow {
request.accept();
}
+ onQuotaPermissionRequested: {
+ if (request.requestedSize <= 5 * 1024 * 1024)
+ request.accept();
+ else
+ request.reject();
+ }
+
onRenderProcessTerminated: {
var status = "";
switch (terminationStatus) {
diff --git a/examples/webenginewidgets/simplebrowser/webpopupwindow.cpp b/examples/webenginewidgets/simplebrowser/webpopupwindow.cpp
index 02cea35de..19e3b0124 100644
--- a/examples/webenginewidgets/simplebrowser/webpopupwindow.cpp
+++ b/examples/webenginewidgets/simplebrowser/webpopupwindow.cpp
@@ -55,6 +55,7 @@
#include <QIcon>
#include <QLineEdit>
#include <QVBoxLayout>
+#include <QWindow>
WebPopupWindow::WebPopupWindow(QWebEngineProfile *profile)
: m_urlLineEdit(new QLineEdit(this))
@@ -92,10 +93,8 @@ WebView *WebPopupWindow::view() const
void WebPopupWindow::handleGeometryChangeRequested(const QRect &newGeometry)
{
- m_view->setMinimumSize(newGeometry.width(), newGeometry.height());
- move(newGeometry.topLeft() - m_view->pos());
- // let the layout do the magic
- resize(0, 0);
+ if (QWindow *window = windowHandle())
+ setGeometry(newGeometry.marginsRemoved(window->frameMargins()));
show();
m_view->setFocus();
}
diff --git a/mkspecs/features/gn_generator.prf b/mkspecs/features/gn_generator.prf
index 072b0444e..a819e146b 100644
--- a/mkspecs/features/gn_generator.prf
+++ b/mkspecs/features/gn_generator.prf
@@ -82,23 +82,25 @@ GN_CONTENTS += "}"
CLEAN_QMAKE_RCC = $$clean_path($$QMAKE_RCC)
-GN_CONTENTS += "action_foreach(\"generate_resources\") {"\
- " script = \"$$GN_RUN_BINARY_SCRIPT\""
-GN_CONTENTS += " sources = ["
-for (sourcefile, RESOURCES): GN_CONTENTS += " \"$$GN_SRC_DIR/$$sourcefile\","
-GN_CONTENTS += " ]" \
- " outputs = [ \"$target_gen_dir/.rcc/qrc_{{source_name_part}}.cpp\" ]"
-GN_CONTENTS += " inputs = [ \"$$system_path($$_PRO_FILE_)\" ]" \
- " args = [" \
- " \"$$replace(CLEAN_QMAKE_RCC,\",\\\")\","
-for(resource_flag, $$QMAKE_RESOURCE_FLAGS): GN_CONTENTS += " \"$$resource_flag\""
-GN_CONTENTS += " \"-name\"," \
- " \"{{source_name_part}}\"," \
- " \"{{source}}\"," \
- " \"-o\"," \
- " rebase_path(\"$target_gen_dir/.rcc/qrc_{{source_name_part}}.cpp\")"\
- " ]"
-GN_CONTENTS += "}"
+!isEmpty(RESOURCES) {
+ GN_CONTENTS += "action_foreach(\"generate_resources\") {"\
+ " script = \"$$GN_RUN_BINARY_SCRIPT\""
+ GN_CONTENTS += " sources = ["
+ for (sourcefile, RESOURCES): GN_CONTENTS += " \"$$GN_SRC_DIR/$$sourcefile\","
+ GN_CONTENTS += " ]" \
+ " outputs = [ \"$target_gen_dir/.rcc/qrc_{{source_name_part}}.cpp\" ]"
+ GN_CONTENTS += " inputs = [ \"$$system_path($$_PRO_FILE_)\" ]" \
+ " args = [" \
+ " \"$$replace(CLEAN_QMAKE_RCC,\",\\\")\","
+ for(resource_flag, $$QMAKE_RESOURCE_FLAGS): GN_CONTENTS += " \"$$resource_flag\""
+ GN_CONTENTS += " \"-name\"," \
+ " \"{{source_name_part}}\"," \
+ " \"{{source}}\"," \
+ " \"-o\"," \
+ " rebase_path(\"$target_gen_dir/.rcc/qrc_{{source_name_part}}.cpp\")"\
+ " ]"
+ GN_CONTENTS += "}"
+}
# TARGET SETUP
diff --git a/src/3rdparty b/src/3rdparty
-Subproject f352e70b325bd176f53f47f43f9c37df54e4397
+Subproject 04cd5620124dc05c019a582363a93a78665b181
diff --git a/src/core/clipboard_qt.h b/src/core/clipboard_qt.h
index 20b51a599..2089208bf 100644
--- a/src/core/clipboard_qt.h
+++ b/src/core/clipboard_qt.h
@@ -82,7 +82,7 @@ public:
void ReadBookmark(base::string16* title, std::string* url) const override;
void ReadData(const FormatType& format, std::string* result) const override;
- virtual void OnPreShutdown() Q_DECL_OVERRIDE { }
+ void OnPreShutdown() override { }
protected:
void WriteObjects(ui::ClipboardType type, const ObjectMap& objects) override;
diff --git a/src/core/content_browser_client_qt.cpp b/src/core/content_browser_client_qt.cpp
index 3ec119e0a..328dcd38d 100644
--- a/src/core/content_browser_client_qt.cpp
+++ b/src/core/content_browser_client_qt.cpp
@@ -54,7 +54,6 @@
#include "content/public/browser/child_process_security_policy.h"
#include "content/public/browser/client_certificate_delegate.h"
#include "content/public/browser/media_observer.h"
-#include "content/public/browser/quota_permission_context.h"
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/render_view_host.h"
@@ -87,7 +86,7 @@
#include "certificate_error_controller.h"
#include "certificate_error_controller_p.h"
#include "desktop_screen_qt.h"
-#include "dev_tools_http_handler_delegate_qt.h"
+#include "devtools_manager_delegate_qt.h"
#ifdef QT_USE_POSITIONING
#include "location_provider_qt.h"
#else
@@ -99,6 +98,7 @@
#include "printing_message_filter_qt.h"
#endif // BUILDFLAG(ENABLE_BASIC_PRINTING)
#include "qrc_protocol_handler_qt.h"
+#include "quota_permission_context_qt.h"
#include "renderer_host/resource_dispatcher_host_delegate_qt.h"
#include "renderer_host/user_resource_controller_host.h"
#include "web_contents_delegate_qt.h"
@@ -376,16 +376,6 @@ void ShareGroupQtQuick::AboutToAddFirstContext()
#endif
}
-class QuotaPermissionContextQt : public content::QuotaPermissionContext {
-public:
- void RequestQuotaPermission(const content::StorageQuotaParams &params, int render_process_id, const PermissionCallback &callback) override
- {
- Q_UNUSED(params);
- Q_UNUSED(render_process_id);
- callback.Run(QUOTA_PERMISSION_RESPONSE_DISALLOW);
- }
-};
-
ContentBrowserClientQt::ContentBrowserClientQt()
: m_browserMainParts(0)
{
@@ -508,7 +498,7 @@ void ContentBrowserClientQt::AppendExtraCommandLineSwitches(base::CommandLine* c
command_line->AppendSwitchASCII(switches::kLang, GetApplicationLocale());
}
-void ContentBrowserClientQt::GetAdditionalWebUISchemes(std::vector<std::string>* additional_schemes)
+void ContentBrowserClientQt::GetAdditionalViewSourceSchemes(std::vector<std::string>* additional_schemes)
{
additional_schemes->push_back(kQrcSchemeQt);
}
diff --git a/src/core/content_browser_client_qt.h b/src/core/content_browser_client_qt.h
index 5d5a96e0c..d810fc08a 100644
--- a/src/core/content_browser_client_qt.h
+++ b/src/core/content_browser_client_qt.h
@@ -113,7 +113,7 @@ public:
std::string GetApplicationLocale() override;
std::string GetAcceptLangs(content::BrowserContext* context) override;
void AppendExtraCommandLineSwitches(base::CommandLine* command_line, int child_process_id) override;
- void GetAdditionalWebUISchemes(std::vector<std::string>* additional_schemes) override;
+ void GetAdditionalViewSourceSchemes(std::vector<std::string>* additional_schemes) override;
void BindInterfaceRequestFromFrame(content::RenderFrameHost* render_frame_host,
const std::string& interface_name,
diff --git a/src/core/core_chromium.pri b/src/core/core_chromium.pri
index 71f74f51a..179266900 100644
--- a/src/core/core_chromium.pri
+++ b/src/core/core_chromium.pri
@@ -32,8 +32,6 @@ qtConfig(embedded): DEFINES += QTWEBENGINE_EMBEDDED_SWITCHES
qtConfig(egl): CONFIG += egl
-RESOURCES += devtools.qrc
-
INCLUDEPATH += $$PWD $$PWD/api
SOURCES = \
@@ -61,7 +59,7 @@ SOURCES = \
custom_protocol_handler.cpp \
delegated_frame_node.cpp \
desktop_screen_qt.cpp \
- dev_tools_http_handler_delegate_qt.cpp \
+ devtools_manager_delegate_qt.cpp \
download_manager_delegate_qt.cpp \
favicon_manager.cpp \
file_picker_controller.cpp \
@@ -77,6 +75,8 @@ SOURCES = \
process_main.cpp \
proxy_config_service_qt.cpp \
qrc_protocol_handler_qt.cpp \
+ quota_permission_context_qt.cpp \
+ quota_permission_controller.cpp \
render_view_observer_host_qt.cpp \
render_widget_host_view_qt.cpp \
render_widget_host_view_qt_delegate.cpp \
@@ -107,7 +107,8 @@ SOURCES = \
web_engine_error.cpp \
web_engine_library_info.cpp \
web_engine_settings.cpp \
- web_event_factory.cpp
+ web_event_factory.cpp \
+ webui/webui_controller_factory_qt.cpp
HEADERS = \
access_token_store_qt.h \
@@ -135,7 +136,7 @@ HEADERS = \
custom_protocol_handler.h \
delegated_frame_node.h \
desktop_screen_qt.h \
- dev_tools_http_handler_delegate_qt.h \
+ devtools_manager_delegate_qt.h \
download_manager_delegate_qt.h \
chromium_gpu_helper.h \
favicon_manager_p.h \
@@ -154,6 +155,9 @@ HEADERS = \
process_main.h \
proxy_config_service_qt.h \
qrc_protocol_handler_qt.h \
+ quota_permission_context_qt.h \
+ quota_permission_controller.h \
+ quota_permission_controller_p.h \
render_view_observer_host_qt.h \
render_widget_host_view_qt.h \
render_widget_host_view_qt_delegate.h \
@@ -185,7 +189,8 @@ HEADERS = \
web_engine_error.h \
web_engine_library_info.h \
web_engine_settings.h \
- web_event_factory.h
+ web_event_factory.h \
+ webui/webui_controller_factory_qt.h
qtConfig(pepper-plugins) {
diff --git a/src/core/devtools.qrc b/src/core/devtools.qrc
deleted file mode 100644
index 6656304ac..000000000
--- a/src/core/devtools.qrc
+++ /dev/null
@@ -1,5 +0,0 @@
-<!DOCTYPE RCC><RCC version="1.0">
-<qresource prefix="data">
- <file alias="discovery_page.html">resources/devtools_discovery_page.html</file>
-</qresource>
-</RCC>
diff --git a/src/core/dev_tools_http_handler_delegate_qt.cpp b/src/core/devtools_manager_delegate_qt.cpp
index 569c4c179..8ea3c2fb7 100644
--- a/src/core/dev_tools_http_handler_delegate_qt.cpp
+++ b/src/core/devtools_manager_delegate_qt.cpp
@@ -37,22 +37,19 @@
**
****************************************************************************/
+// based on content/shell/browser/shell_devtools_manager_delegate.cc:
// Copyright 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE.Chromium file.
-#include "dev_tools_http_handler_delegate_qt.h"
-
-#include "type_conversion.h"
-
-#include <QByteArray>
-#include <QFile>
+#include "devtools_manager_delegate_qt.h"
#include "base/command_line.h"
#include "base/files/file_path.h"
#include "base/memory/ptr_util.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/utf_string_conversions.h"
+#include "chrome/grit/qt_webengine_resources.h"
#include "content/browser/devtools/devtools_http_handler.h"
#include "content/public/browser/devtools_agent_host.h"
#include "content/public/browser/devtools_frontend_host.h"
@@ -66,8 +63,11 @@
#include "net/base/ip_endpoint.h"
#include "net/base/net_errors.h"
#include "net/socket/tcp_server_socket.h"
+#include "ui/base/resource/resource_bundle.h"
-using namespace content;
+#include "type_conversion.h"
+
+using content::DevToolsAgentHost;
namespace {
@@ -181,14 +181,7 @@ void DevToolsManagerDelegateQt::Initialized(const net::IPEndPoint *ip_address)
std::string DevToolsManagerDelegateQt::GetDiscoveryPageHTML()
{
- static std::string html;
- if (html.empty()) {
- QFile html_file(":/data/discovery_page.html");
- html_file.open(QIODevice::ReadOnly);
- QByteArray contents = html_file.readAll();
- html = contents.data();
- }
- return html;
+ return ResourceBundle::GetSharedInstance().GetRawDataResource(IDR_DEVTOOLS_DISCOVERY_PAGE_HTML).as_string();
}
std::string DevToolsManagerDelegateQt::GetFrontendResource(const std::string& path)
diff --git a/src/core/dev_tools_http_handler_delegate_qt.h b/src/core/devtools_manager_delegate_qt.h
index 1b0e82bc0..1b0e82bc0 100644
--- a/src/core/dev_tools_http_handler_delegate_qt.h
+++ b/src/core/devtools_manager_delegate_qt.h
diff --git a/src/core/network_delegate_qt.h b/src/core/network_delegate_qt.h
index 3607d8ab0..b0a8e1ef9 100644
--- a/src/core/network_delegate_qt.h
+++ b/src/core/network_delegate_qt.h
@@ -73,30 +73,29 @@ public:
const net::CompletionCallback &callback);
// net::NetworkDelegate implementation
- virtual int OnBeforeURLRequest(net::URLRequest* request, const net::CompletionCallback& callback, GURL* newUrl) override;
- virtual void OnURLRequestDestroyed(net::URLRequest* request) override;
- virtual bool OnCanSetCookie(const net::URLRequest&, const std::string&, net::CookieOptions*) override;
- virtual int OnBeforeStartTransaction(net::URLRequest *request, const net::CompletionCallback &callback, net::HttpRequestHeaders *headers) override;
+ int OnBeforeURLRequest(net::URLRequest* request, const net::CompletionCallback& callback, GURL* newUrl) override;
+ void OnURLRequestDestroyed(net::URLRequest* request) override;
+ bool OnCanSetCookie(const net::URLRequest&, const std::string&, net::CookieOptions*) override;
+ int OnBeforeStartTransaction(net::URLRequest *request, const net::CompletionCallback &callback, net::HttpRequestHeaders *headers) override;
virtual void OnBeforeSendHeaders(net::URLRequest* request, const net::ProxyInfo& proxy_info,
const net::ProxyRetryInfoMap& proxy_retry_info, net::HttpRequestHeaders* headers) override;
- virtual void OnStartTransaction(net::URLRequest *request, const net::HttpRequestHeaders &headers) override;
- virtual int OnHeadersReceived(net::URLRequest*, const net::CompletionCallback&, const net::HttpResponseHeaders*, scoped_refptr<net::HttpResponseHeaders>*, GURL*) override;
- virtual void OnBeforeRedirect(net::URLRequest*, const GURL&) override;
- virtual void OnResponseStarted(net::URLRequest*) override;
- virtual void OnNetworkBytesReceived(net::URLRequest*, int64_t) override;
- virtual void OnNetworkBytesSent(net::URLRequest *, int64_t) override;
- virtual void OnCompleted(net::URLRequest*, bool) override;
- virtual void OnPACScriptError(int, const base::string16&) override;
- virtual net::NetworkDelegate::AuthRequiredResponse OnAuthRequired(net::URLRequest*, const net::AuthChallengeInfo&, const AuthCallback&, net::AuthCredentials*) override;
- virtual bool OnCanGetCookies(const net::URLRequest&, const net::CookieList&) override;
- virtual bool OnCanAccessFile(const net::URLRequest&, const base::FilePath&, const base::FilePath&) const override;
+ void OnStartTransaction(net::URLRequest *request, const net::HttpRequestHeaders &headers) override;
+ int OnHeadersReceived(net::URLRequest*, const net::CompletionCallback&, const net::HttpResponseHeaders*, scoped_refptr<net::HttpResponseHeaders>*, GURL*) override;
+ void OnBeforeRedirect(net::URLRequest*, const GURL&) override;
+ void OnResponseStarted(net::URLRequest*) override;
+ void OnNetworkBytesReceived(net::URLRequest*, int64_t) override;
+ void OnNetworkBytesSent(net::URLRequest *, int64_t) override;
+ void OnCompleted(net::URLRequest*, bool) override;
+ void OnPACScriptError(int, const base::string16&) override;
+ net::NetworkDelegate::AuthRequiredResponse OnAuthRequired(net::URLRequest*, const net::AuthChallengeInfo&, const AuthCallback&, net::AuthCredentials*) override;
+ bool OnCanGetCookies(const net::URLRequest&, const net::CookieList&) override;
+ bool OnCanAccessFile(const net::URLRequest&, const base::FilePath&, const base::FilePath&) const override;
+ bool OnCanEnablePrivacyMode(const GURL&, const GURL&) const override;
+ bool OnAreExperimentalCookieFeaturesEnabled() const override;
+ bool OnCancelURLRequestWithPolicyViolatingReferrerHeader(const net::URLRequest&, const GURL&, const GURL&) const override;
- virtual bool OnCanEnablePrivacyMode(const GURL&, const GURL&) const override;
- virtual bool OnAreExperimentalCookieFeaturesEnabled() const override;
- virtual bool OnCancelURLRequestWithPolicyViolatingReferrerHeader(const net::URLRequest&, const GURL&, const GURL&) const override;
-
- virtual bool OnCanQueueReportingReport(const url::Origin& origin) const override;
- virtual bool OnCanSendReportingReport(const url::Origin& origin) const override;
+ bool OnCanQueueReportingReport(const url::Origin& origin) const override;
+ bool OnCanSendReportingReport(const url::Origin& origin) const override;
virtual bool OnCanSetReportingClient(const url::Origin& origin,
const GURL& endpoint) const override;
virtual bool OnCanUseReportingClient(const url::Origin& origin,
diff --git a/src/core/qtwebengine.gni b/src/core/qtwebengine.gni
index c9f766a36..a86e93f5b 100644
--- a/src/core/qtwebengine.gni
+++ b/src/core/qtwebengine.gni
@@ -17,6 +17,7 @@ deps = [
"//components/keyed_service/content",
"//components/visitedlink/browser",
"//components/visitedlink/renderer",
+ "//components/signin/core/common:signin_features",
"//components/web_cache/browser",
"//components/web_cache/renderer",
"//components/spellcheck:build_features",
diff --git a/src/core/qtwebengine_resources.gni b/src/core/qtwebengine_resources.gni
index acf5f1590..6bff6a9a4 100644
--- a/src/core/qtwebengine_resources.gni
+++ b/src/core/qtwebengine_resources.gni
@@ -17,6 +17,9 @@ group("qtwebengine_resources") {
repack("qtwebengine_repack_resources") {
sources = [
"$root_gen_dir/blink/public/resources/blink_resources.pak",
+ "$root_gen_dir/chrome/qt_webengine_resources.pak",
+ "$root_gen_dir/chrome/quota_internals_resources.pak",
+ "$root_gen_dir/chrome/task_scheduler_internals_resources.pak",
"$root_gen_dir/components/components_resources.pak",
"$root_gen_dir/content/content_resources.pak",
"$root_gen_dir/net/net_resources.pak",
@@ -24,6 +27,9 @@ repack("qtwebengine_repack_resources") {
]
output = "$root_out_dir/qtwebengine_resources.pak"
deps = [
+ "//chrome/browser/resources:qt_webengine_resources",
+ "//chrome/browser/resources:quota_internals_resources",
+ "//chrome/browser/resources:task_scheduler_internals_resources",
"//components/resources:components_resources_grit",
"//content:resources_grit",
"//net:net_resources_grit",
diff --git a/src/core/qtwebengine_sources.gni b/src/core/qtwebengine_sources.gni
index 9a2d4aee5..a21193ecd 100644
--- a/src/core/qtwebengine_sources.gni
+++ b/src/core/qtwebengine_sources.gni
@@ -44,8 +44,26 @@ source_set("qtwebengine_sources") {
"//chrome/browser/media/webrtc/desktop_media_list.h",
"//chrome/browser/media/webrtc/desktop_streams_registry.cc",
"//chrome/browser/media/webrtc/desktop_streams_registry.h",
+ "//chrome/browser/profiles/profile.cc",
+ "//chrome/browser/profiles/profile.h",
+ "//chrome/browser/ui/webui/devtools_ui.cc",
+ "//chrome/browser/ui/webui/devtools_ui.h",
+ "//chrome/browser/ui/webui/quota_internals/quota_internals_handler.cc",
+ "//chrome/browser/ui/webui/quota_internals/quota_internals_handler.h",
+ "//chrome/browser/ui/webui/quota_internals/quota_internals_proxy.cc",
+ "//chrome/browser/ui/webui/quota_internals/quota_internals_proxy.h",
+ "//chrome/browser/ui/webui/quota_internals/quota_internals_types.cc",
+ "//chrome/browser/ui/webui/quota_internals/quota_internals_types.h",
+ "//chrome/browser/ui/webui/quota_internals/quota_internals_ui.cc",
+ "//chrome/browser/ui/webui/quota_internals/quota_internals_ui.h",
+ "//chrome/browser/ui/webui/task_scheduler_internals/task_scheduler_internals_ui.cc",
+ "//chrome/browser/ui/webui/task_scheduler_internals/task_scheduler_internals_ui.h",
"//chrome/common/chrome_switches.cc",
"//chrome/common/chrome_switches.h",
+ "//chrome/common/pref_names.cc",
+ "//chrome/common/pref_names.h",
+ "//chrome/common/url_constants.cc",
+ "//chrome/common/url_constants.h",
"//components/prefs/in_memory_pref_store.cc",
"//components/prefs/in_memory_pref_store.h",
"//extensions/common/constants.cc",
@@ -54,11 +72,14 @@ source_set("qtwebengine_sources") {
"//extensions/common/url_pattern.h",
]
- if (enable_spellcheck) {
+ if (is_linux) {
sources += [
- "//chrome/common/pref_names.cc",
- "//chrome/common/pref_names.h",
+ "//chrome/browser/ui/webui/sandbox_internals_ui.cc",
+ "//chrome/browser/ui/webui/sandbox_internals_ui.h",
]
+ }
+
+ if (enable_spellcheck) {
deps += [
":qtwebengine_spellcheck_sources",
"//chrome/tools/convert_dict",
diff --git a/src/core/quota_permission_context_qt.cpp b/src/core/quota_permission_context_qt.cpp
new file mode 100644
index 000000000..10249bbf0
--- /dev/null
+++ b/src/core/quota_permission_context_qt.cpp
@@ -0,0 +1,107 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtWebEngine module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "quota_permission_context_qt.h"
+
+#include "content/public/browser/browser_thread.h"
+#include "content/public/browser/render_frame_host.h"
+#include "content/public/browser/web_contents.h"
+#include "quota_permission_controller.h"
+#include "quota_permission_controller_p.h"
+#include "web_contents_delegate_qt.h"
+#include "web_contents_view_qt.h"
+
+using content::QuotaPermissionContext;
+using content::RenderFrameHost;
+using content::StorageQuotaParams;
+using content::WebContents;
+
+namespace QtWebEngineCore {
+
+void QuotaPermissionContextQt::RequestQuotaPermission(const StorageQuotaParams &params, int render_process_id, const PermissionCallback &callback)
+{
+ if (params.storage_type != storage::kStorageTypePersistent) {
+ // For now we only support requesting quota with this interface
+ // for Persistent storage type.
+ callback.Run(QUOTA_PERMISSION_RESPONSE_DISALLOW);
+ return;
+ }
+
+ if (!content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)) {
+ content::BrowserThread::PostTask(
+ content::BrowserThread::UI, FROM_HERE,
+ base::Bind(&QuotaPermissionContextQt::RequestQuotaPermission, this,
+ params, render_process_id, callback));
+ return;
+ }
+
+ RenderFrameHost *renderFrameHost = RenderFrameHost::FromID(render_process_id, params.render_frame_id);
+ if (!renderFrameHost)
+ return;
+
+ WebContents *webContents = WebContents::FromRenderFrameHost(renderFrameHost);
+ if (!webContents)
+ return;
+
+ WebContentsAdapterClient *client = WebContentsViewQt::from(static_cast<content::WebContentsImpl *>(webContents)->GetView())->client();
+ if (!client)
+ return;
+
+ QSharedPointer<QuotaPermissionController> controller(new QuotaPermissionController(new QuotaPermissionControllerPrivate(this, params, callback)));
+ client->runQuotaPermissionRequest(controller);
+}
+
+void QuotaPermissionContextQt::dispatchCallbackOnIOThread(const PermissionCallback &callback,
+ QuotaPermissionContext::QuotaPermissionResponse response)
+{
+ if (callback.is_null())
+ return;
+
+ if (!content::BrowserThread::CurrentlyOn(content::BrowserThread::IO)) {
+ content::BrowserThread::PostTask(
+ content::BrowserThread::IO, FROM_HERE,
+ base::Bind(&QuotaPermissionContextQt::dispatchCallbackOnIOThread,
+ this, callback, response));
+ return;
+ }
+
+ callback.Run(response);
+}
+
+} // namespace QtWebEngineCore
diff --git a/src/core/quota_permission_context_qt.h b/src/core/quota_permission_context_qt.h
new file mode 100644
index 000000000..99e07eec7
--- /dev/null
+++ b/src/core/quota_permission_context_qt.h
@@ -0,0 +1,61 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtWebEngine module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QUOTA_PERMISSION_CONTEXT_QT_H
+#define QUOTA_PERMISSION_CONTEXT_QT_H
+
+#include "content/public/browser/quota_permission_context.h"
+
+#include <QtCore/qcompilerdetection.h> // Needed for override
+
+namespace QtWebEngineCore {
+
+class QuotaPermissionContextQt : public content::QuotaPermissionContext {
+public:
+ void RequestQuotaPermission(const content::StorageQuotaParams &params,
+ int render_process_id,
+ const PermissionCallback &callback) override;
+
+ void dispatchCallbackOnIOThread(const PermissionCallback &callback,
+ QuotaPermissionContext::QuotaPermissionResponse response);
+};
+
+} // namespace QtWebEngineCore
+
+#endif // QUOTA_PERMISSION_CONTEXT_QT_H
diff --git a/src/core/quota_permission_controller.cpp b/src/core/quota_permission_controller.cpp
new file mode 100644
index 000000000..59fc6198d
--- /dev/null
+++ b/src/core/quota_permission_controller.cpp
@@ -0,0 +1,98 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtWebEngine module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "quota_permission_controller.h"
+#include "quota_permission_controller_p.h"
+
+#include "quota_permission_context_qt.h"
+#include "type_conversion.h"
+
+namespace QtWebEngineCore {
+
+QuotaPermissionControllerPrivate::QuotaPermissionControllerPrivate(QuotaPermissionContextQt *context,
+ const content::StorageQuotaParams &params,
+ const content::QuotaPermissionContext::PermissionCallback &callback)
+ : m_context(context),
+ m_originUrl(toQt(params.origin_url)),
+ m_requestedSize(params.requested_size),
+ m_callback(callback)
+{
+}
+
+QuotaPermissionControllerPrivate::~QuotaPermissionControllerPrivate()
+{
+}
+
+QuotaPermissionController::QuotaPermissionController(QuotaPermissionControllerPrivate *controllerPrivate)
+ : d(controllerPrivate)
+ , m_answered(false)
+{
+}
+
+QuotaPermissionController::~QuotaPermissionController()
+{
+}
+
+void QuotaPermissionController::accept()
+{
+ if (!m_answered) {
+ d->m_context->dispatchCallbackOnIOThread(d->m_callback, QuotaPermissionContextQt::QUOTA_PERMISSION_RESPONSE_ALLOW);
+ m_answered = true;
+ }
+}
+
+void QuotaPermissionController::cancel()
+{
+ if (!m_answered) {
+ d->m_context->dispatchCallbackOnIOThread(d->m_callback, QuotaPermissionContextQt::QUOTA_PERMISSION_RESPONSE_DISALLOW);
+ m_answered = true;
+ }
+}
+
+QUrl QuotaPermissionController::origin()
+{
+ return d->m_originUrl;
+}
+
+qint64 QuotaPermissionController::requestedSize()
+{
+ return d->m_requestedSize;
+}
+
+} // namespace QtWebEngineCore
diff --git a/src/core/quota_permission_controller.h b/src/core/quota_permission_controller.h
new file mode 100644
index 000000000..36f751c2c
--- /dev/null
+++ b/src/core/quota_permission_controller.h
@@ -0,0 +1,70 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtWebEngine module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QUOTA_PERMISSION_CONTROLLER_H
+#define QUOTA_PERMISSION_CONTROLLER_H
+
+#include "qtwebenginecoreglobal.h"
+#include <QtCore/qscopedpointer.h>
+#include <QtCore/qurl.h>
+
+namespace QtWebEngineCore {
+
+class QuotaPermissionContextQt;
+class QuotaPermissionControllerPrivate;
+
+class QWEBENGINE_EXPORT QuotaPermissionController {
+public:
+ QuotaPermissionController(QuotaPermissionControllerPrivate *controllerPrivate);
+ ~QuotaPermissionController();
+
+ void accept();
+ void cancel();
+
+ QUrl origin();
+ qint64 requestedSize();
+
+private:
+ QScopedPointer<QuotaPermissionControllerPrivate> d;
+ bool m_answered;
+};
+
+} // namespace QtWebEngineCore
+
+#endif // QUOTA_PERMISSION_CONTROLLER_H
diff --git a/src/core/quota_permission_controller_p.h b/src/core/quota_permission_controller_p.h
new file mode 100644
index 000000000..c00ae42c9
--- /dev/null
+++ b/src/core/quota_permission_controller_p.h
@@ -0,0 +1,66 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtWebEngine module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QUOTA_PERMISSION_CONTROLLER_P_H
+#define QUOTA_PERMISSION_CONTROLLER_P_H
+
+#include "quota_permission_context_qt.h"
+#include <QtCore/qurl.h>
+
+namespace QtWebEngineCore {
+
+class QuotaPermissionControllerPrivate {
+public:
+ QuotaPermissionControllerPrivate(QuotaPermissionContextQt *context,
+ const content::StorageQuotaParams &params,
+ const content::QuotaPermissionContext::PermissionCallback &callback);
+ ~QuotaPermissionControllerPrivate();
+
+private:
+ scoped_refptr<QuotaPermissionContextQt> m_context;
+ QUrl m_originUrl;
+ qint64 m_requestedSize;
+ content::QuotaPermissionContext::PermissionCallback m_callback;
+
+ friend class QuotaPermissionController;
+};
+
+} // namespace QtWebEngineCore
+
+#endif // QUOTA_PERMISSION_CONTROLLER_P_H
diff --git a/src/core/render_widget_host_view_qt.cpp b/src/core/render_widget_host_view_qt.cpp
index d1fc7d171..9be5bd498 100644
--- a/src/core/render_widget_host_view_qt.cpp
+++ b/src/core/render_widget_host_view_qt.cpp
@@ -902,6 +902,7 @@ QSGNode *RenderWidgetHostViewQt::updatePaintNode(QSGNode *oldNode)
void RenderWidgetHostViewQt::notifyResize()
{
m_host->WasResized();
+ m_host->SendScreenRects();
}
void RenderWidgetHostViewQt::notifyShown()
diff --git a/src/core/render_widget_host_view_qt.h b/src/core/render_widget_host_view_qt.h
index 59e21b853..7d32cc645 100644
--- a/src/core/render_widget_host_view_qt.h
+++ b/src/core/render_widget_host_view_qt.h
@@ -118,6 +118,7 @@ public:
RenderWidgetHostViewQt(content::RenderWidgetHost* widget);
~RenderWidgetHostViewQt();
+ RenderWidgetHostViewQtDelegate *delegate() { return m_delegate.get(); }
void setDelegate(RenderWidgetHostViewQtDelegate *delegate);
void setAdapterClient(WebContentsAdapterClient *adapterClient);
diff --git a/src/core/renderer/web_channel_ipc_transport.cpp b/src/core/renderer/web_channel_ipc_transport.cpp
index 554bda2a8..8374a8e6b 100644
--- a/src/core/renderer/web_channel_ipc_transport.cpp
+++ b/src/core/renderer/web_channel_ipc_transport.cpp
@@ -66,7 +66,7 @@ public:
private:
content::RenderView *GetRenderView(v8::Isolate *isolate);
WebChannelTransport() { }
- virtual gin::ObjectTemplateBuilder GetObjectTemplateBuilder(v8::Isolate *isolate) override;
+ gin::ObjectTemplateBuilder GetObjectTemplateBuilder(v8::Isolate *isolate) override;
bool NativeQtSendMessage(gin::Arguments *args)
{
diff --git a/src/core/renderer_host/resource_dispatcher_host_delegate_qt.cpp b/src/core/renderer_host/resource_dispatcher_host_delegate_qt.cpp
index bf61f1851..53d3e88ba 100644
--- a/src/core/renderer_host/resource_dispatcher_host_delegate_qt.cpp
+++ b/src/core/renderer_host/resource_dispatcher_host_delegate_qt.cpp
@@ -138,7 +138,7 @@ void ResourceDispatcherHostLoginDelegateQt::destroy()
static void LaunchURL(const GURL& url, int render_process_id,
const content::ResourceRequestInfo::WebContentsGetter& web_contents_getter,
- ui::PageTransition page_transition, bool is_main_frame)
+ ui::PageTransition page_transition, bool is_main_frame, bool has_user_gesture)
{
Q_UNUSED(render_process_id);
Q_ASSERT(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI));
@@ -146,16 +146,13 @@ static void LaunchURL(const GURL& url, int render_process_id,
if (!webContents)
return;
WebContentsDelegateQt *contentsDelegate = static_cast<WebContentsDelegateQt*>(webContents->GetDelegate());
- contentsDelegate->launchExternalURL(toQt(url), page_transition, is_main_frame);
+ contentsDelegate->launchExternalURL(toQt(url), page_transition, is_main_frame, has_user_gesture);
}
bool ResourceDispatcherHostDelegateQt::HandleExternalProtocol(const GURL& url, content::ResourceRequestInfo* info)
{
Q_ASSERT(content::BrowserThread::CurrentlyOn(content::BrowserThread::IO));
- // We don't want to launch external applications unless it is based on a user action
- if (!info->HasUserGesture())
- return false;
content::BrowserThread::PostTask(
content::BrowserThread::UI,
@@ -164,7 +161,8 @@ bool ResourceDispatcherHostDelegateQt::HandleExternalProtocol(const GURL& url, c
info->GetChildID(),
info->GetWebContentsGetterForRequest(),
info->GetPageTransition(),
- info->IsMainFrame())
+ info->IsMainFrame(),
+ info->HasUserGesture())
);
return true;
}
diff --git a/src/core/resources/devtools_discovery_page.html b/src/core/resources/devtools_discovery_page.html
deleted file mode 100644
index d37dbfcf4..000000000
--- a/src/core/resources/devtools_discovery_page.html
+++ /dev/null
@@ -1,140 +0,0 @@
-<html>
-<head>
-<title>QtWebEngine Remote Debugging</title>
-<style>
-body {
- color: #222;
- font-family: Helvetica, Arial, sans-serif;
- margin: 0;
- text-shadow: rgba(255, 255, 255, 0.496094) 0px 1px 0px;
-}
-
-#caption {
- font-size: 16px;
- margin-top: 15px;
- margin-bottom: 10px;
- margin-left: 20px;
- height: 20px;
- text-align: left;
-}
-
-#items {
- display: flex;
- flex-direction: column;
- margin: 10px;
-}
-
-.item {
- color: #222;
- display: flex;
- flex-direction: row;
- text-decoration: none;
- padding: 10px;
- -webkit-transition-property: background-color, border-color;
- -webkit-transition: background-color 0.15s, 0.15s;
- -webkit-transition-delay: 0ms, 0ms;
-}
-
-.item:not(.connected):hover {
- background-color: rgba(242, 242, 242, 1);
- border-color: rgba(110, 116, 128, 1);
- color: black;
-}
-
-.item.connected:hover {
- border-color: rgba(184, 184, 184, 1);
- color: rgb(110, 116, 128);
-}
-
-.description {
- display: flex;
- flex-direction: column;
-}
-
-.title, .subtitle {
- font-size: 13px;
- margin: 4px 0px 0px 6px;
- overflow: hidden;
- padding-left: 20px;
-}
-
-.title {
- background-repeat: no-repeat;
- background-size: 16px;
- font-size: 15px;
-}
-
-
-</style>
-
-<script>
-
-function onLoad() {
- var tabsListRequest = new XMLHttpRequest();
- tabsListRequest.open('GET', '/json/list', true);
- tabsListRequest.onreadystatechange = onReady;
- tabsListRequest.send();
-}
-
-function onReady() {
- if(this.readyState == 4 && this.status == 200) {
- if(this.response != null)
- var responseJSON = JSON.parse(this.response);
- for (var i = 0; i < responseJSON.length; ++i)
- appendItem(responseJSON[i]);
- }
-}
-
-function overrideFrontendUrl(item) {
- if (window.location.hash) {
- var overridden_url = window.location.hash.substr(1);
- var ws_suffix = item.webSocketDebuggerUrl.replace('ws://', 'ws=');
- if (overridden_url.indexOf('?') == -1)
- return overridden_url + '?' + ws_suffix;
- else
- return overridden_url + '&' + ws_suffix;
- }
- return item.devtoolsFrontendUrl;
-}
-
-function appendItem(item_object) {
- var item_element;
- if (item_object.devtoolsFrontendUrl) {
- item_element = document.createElement('a');
- item_element.href = overrideFrontendUrl(item_object);
- item_element.title = item_object.title;
- } else {
- item_element = document.createElement('div');
- item_element.className = 'connected';
- item_element.title = 'The tab already has an active debug session';
- }
- item_element.classList.add('item');
-
- var description = document.createElement('div');
- description.className = 'description';
-
- var title = document.createElement('div');
- title.className = 'title';
- title.textContent = item_object.description || item_object.title;
- title.style.cssText = 'background-image:url(' +
- item_object.faviconUrl + ')';
- description.appendChild(title);
-
- var subtitle = document.createElement('div');
- subtitle.className = 'subtitle';
- subtitle.textContent = (item_object.url || '').substring(0, 300);
- description.appendChild(subtitle);
-
- item_element.appendChild(description);
-
- document.getElementById('items').appendChild(item_element);
-}
-</script>
-</head>
-<body onload='onLoad()'>
- <div id='caption'>Inspectable pages</div>
- <hr>
- <div id='items'>
- </div>
-</body>
-</html>
diff --git a/src/core/ssl_host_state_delegate_qt.h b/src/core/ssl_host_state_delegate_qt.h
index f04e0b492..859e98fe7 100644
--- a/src/core/ssl_host_state_delegate_qt.h
+++ b/src/core/ssl_host_state_delegate_qt.h
@@ -64,14 +64,14 @@ public:
~SSLHostStateDelegateQt();
// content::SSLHostStateDelegate implementation:
- virtual void AllowCert(const std::string &, const net::X509Certificate &cert, net::CertStatus error) override;
- virtual void Clear(const base::Callback<bool(const std::string&)>& host_filter) override;
+ void AllowCert(const std::string &, const net::X509Certificate &cert, net::CertStatus error) override;
+ void Clear(const base::Callback<bool(const std::string&)>& host_filter) override;
virtual CertJudgment QueryPolicy(const std::string &host, const net::X509Certificate &cert,
net::CertStatus error,bool *expired_previous_decision) override;
- virtual void HostRanInsecureContent(const std::string& host, int child_id, InsecureContentType content_type) override;
- virtual bool DidHostRunInsecureContent(const std::string& host, int child_id, InsecureContentType content_type) const override;
- virtual void RevokeUserAllowExceptions(const std::string &host) override;
- virtual bool HasAllowException(const std::string &host) const override;
+ void HostRanInsecureContent(const std::string& host, int child_id, InsecureContentType content_type) override;
+ bool DidHostRunInsecureContent(const std::string& host, int child_id, InsecureContentType content_type) const override;
+ void RevokeUserAllowExceptions(const std::string &host) override;
+ bool HasAllowException(const std::string &host) const override;
private:
std::map<std::string, CertPolicy> m_certPolicyforHost;
diff --git a/src/core/url_request_context_getter_qt.cpp b/src/core/url_request_context_getter_qt.cpp
index 4f1850f54..4f30881c8 100644
--- a/src/core/url_request_context_getter_qt.cpp
+++ b/src/core/url_request_context_getter_qt.cpp
@@ -555,20 +555,9 @@ void URLRequestContextGetterQt::generateJobFactory()
m_updateJobFactory = false;
std::unique_ptr<net::URLRequestJobFactoryImpl> jobFactory(new net::URLRequestJobFactoryImpl());
-
- {
- // Chromium has transferred a few protocol handlers to us, only pick blob:, chrome: and filesystem:.
- content::ProtocolHandlerMap::iterator it = m_protocolHandlers.find(url::kBlobScheme);
- Q_ASSERT(it != m_protocolHandlers.end());
- jobFactory->SetProtocolHandler(it->first, std::unique_ptr<net::URLRequestJobFactory::ProtocolHandler>(it->second.release()));
- it = m_protocolHandlers.find(content::kChromeUIScheme);
- Q_ASSERT(it != m_protocolHandlers.end());
- jobFactory->SetProtocolHandler(it->first, std::unique_ptr<net::URLRequestJobFactory::ProtocolHandler>(it->second.release()));
- it = m_protocolHandlers.find(url::kFileSystemScheme);
- Q_ASSERT(it != m_protocolHandlers.end());
- jobFactory->SetProtocolHandler(it->first, std::unique_ptr<net::URLRequestJobFactory::ProtocolHandler>(it->second.release()));
- m_protocolHandlers.clear();
- }
+ for (auto &it : m_protocolHandlers)
+ jobFactory->SetProtocolHandler(it.first, base::WrapUnique(it.second.release()));
+ m_protocolHandlers.clear();
jobFactory->SetProtocolHandler(url::kDataScheme, std::unique_ptr<net::URLRequestJobFactory::ProtocolHandler>(new net::DataProtocolHandler()));
jobFactory->SetProtocolHandler(url::kFileScheme, std::unique_ptr<net::URLRequestJobFactory::ProtocolHandler>(new net::FileProtocolHandler(
diff --git a/src/core/web_contents_adapter_client.h b/src/core/web_contents_adapter_client.h
index bc45a90fb..6416ab6af 100644
--- a/src/core/web_contents_adapter_client.h
+++ b/src/core/web_contents_adapter_client.h
@@ -64,6 +64,7 @@ class BrowserContextAdapter;
class ColorChooserController;
class FilePickerController;
class JavaScriptDialogController;
+class QuotaPermissionController;
class RenderWidgetHostViewQt;
class RenderWidgetHostViewQtDelegate;
class RenderWidgetHostViewQtDelegateClient;
@@ -411,13 +412,14 @@ public:
virtual void runGeolocationPermissionRequest(const QUrl &securityOrigin) = 0;
virtual void runMediaAccessPermissionRequest(const QUrl &securityOrigin, MediaRequestFlags requestFlags) = 0;
virtual void runMouseLockPermissionRequest(const QUrl &securityOrigin) = 0;
+ virtual void runQuotaPermissionRequest(QSharedPointer<QuotaPermissionController>) = 0;
virtual WebEngineSettings *webEngineSettings() const = 0;
virtual void showValidationMessage(const QRect &anchor, const QString &mainText, const QString &subText) = 0;
virtual void hideValidationMessage() = 0;
virtual void moveValidationMessage(const QRect &anchor) = 0;
RenderProcessTerminationStatus renderProcessExitStatus(int);
virtual void renderProcessTerminated(RenderProcessTerminationStatus terminationStatus, int exitCode) = 0;
- virtual void requestGeometryChange(const QRect &geometry) = 0;
+ virtual void requestGeometryChange(const QRect &geometry, const QRect &frameGeometry) = 0;
virtual void allowCertificateError(const QSharedPointer<CertificateErrorController> &errorController) = 0;
virtual void updateScrollPosition(const QPointF &position) = 0;
virtual void updateContentsSize(const QSizeF &size) = 0;
diff --git a/src/core/web_contents_delegate_qt.cpp b/src/core/web_contents_delegate_qt.cpp
index f35620c86..111a6943a 100644
--- a/src/core/web_contents_delegate_qt.cpp
+++ b/src/core/web_contents_delegate_qt.cpp
@@ -76,6 +76,7 @@
#include <QDesktopServices>
#include <QTimer>
+#include <QWindow>
namespace QtWebEngineCore {
@@ -427,8 +428,13 @@ void WebContentsDelegateQt::RequestMediaAccessPermission(content::WebContents *w
void WebContentsDelegateQt::MoveContents(content::WebContents *source, const gfx::Rect &pos)
{
- Q_UNUSED(source)
- m_viewClient->requestGeometryChange(toQt(pos));
+ QRect frameGeometry(toQt(pos));
+ QRect geometry;
+ if (RenderWidgetHostViewQt *rwhv = static_cast<RenderWidgetHostViewQt*>(web_contents()->GetRenderWidgetHostView())) {
+ if (rwhv->delegate() && rwhv->delegate()->window())
+ geometry = frameGeometry.marginsRemoved(rwhv->delegate()->window()->frameMargins());
+ }
+ m_viewClient->requestGeometryChange(geometry, frameGeometry);
}
bool WebContentsDelegateQt::IsPopupOrPanel(const content::WebContents *source) const
@@ -506,14 +512,45 @@ void WebContentsDelegateQt::requestGeolocationPermission(const QUrl &requestingO
extern WebContentsAdapterClient::NavigationType pageTransitionToNavigationType(ui::PageTransition transition);
-void WebContentsDelegateQt::launchExternalURL(const QUrl &url, ui::PageTransition page_transition, bool is_main_frame)
+void WebContentsDelegateQt::launchExternalURL(const QUrl &url, ui::PageTransition page_transition, bool is_main_frame, bool has_user_gesture)
{
- int navigationRequestAction = WebContentsAdapterClient::AcceptRequest;
- m_viewClient->navigationRequested(pageTransitionToNavigationType(page_transition), url, navigationRequestAction, is_main_frame);
+ WebEngineSettings *settings = m_viewClient->webEngineSettings();
+ bool navigationAllowedByPolicy = false;
+ bool navigationRequestAccepted = true;
+
+ switch (settings->unknownUrlSchemePolicy()) {
+ case WebEngineSettings::DisallowUnknownUrlSchemes:
+ break;
+ case WebEngineSettings::AllowUnknownUrlSchemesFromUserInteraction:
+ navigationAllowedByPolicy = has_user_gesture;
+ break;
+ case WebEngineSettings::AllowAllUnknownUrlSchemes:
+ navigationAllowedByPolicy = true;
+ break;
+ default:
+ Q_UNREACHABLE();
+ }
+
+ if (navigationAllowedByPolicy) {
+ int navigationRequestAction = WebContentsAdapterClient::AcceptRequest;
+ m_viewClient->navigationRequested(pageTransitionToNavigationType(page_transition), url, navigationRequestAction, is_main_frame);
+ navigationRequestAccepted = navigationRequestAction == WebContentsAdapterClient::AcceptRequest;
#ifndef QT_NO_DESKTOPSERVICES
- if (navigationRequestAction == WebContentsAdapterClient::AcceptRequest)
- QDesktopServices::openUrl(url);
+ if (navigationRequestAccepted)
+ QDesktopServices::openUrl(url);
#endif
+ }
+
+ if (!navigationAllowedByPolicy || !navigationRequestAccepted) {
+ if (!navigationAllowedByPolicy)
+ didFailLoad(url, 420, QStringLiteral("Launching external protocol forbidden by WebEngineSettings::UnknownUrlSchemePolicy"));
+ else
+ didFailLoad(url, 420, QStringLiteral("Launching external protocol suppressed by WebContentsAdapterClient::navigationRequested"));
+ if (settings->testAttribute(WebEngineSettings::ErrorPageEnabled)) {
+ EmitLoadStarted(toQt(GURL(content::kUnreachableWebDataURL)), true);
+ m_viewClient->webContentsAdapter()->load(toQt(GURL(content::kUnreachableWebDataURL)));
+ }
+ }
}
void WebContentsDelegateQt::ShowValidationMessage(content::WebContents *web_contents, const gfx::Rect &anchor_in_root_view, const base::string16 &main_text, const base::string16 &sub_text)
diff --git a/src/core/web_contents_delegate_qt.h b/src/core/web_contents_delegate_qt.h
index 44fb93093..87b7271f6 100644
--- a/src/core/web_contents_delegate_qt.h
+++ b/src/core/web_contents_delegate_qt.h
@@ -143,7 +143,7 @@ public:
void overrideWebPreferences(content::WebContents *, content::WebPreferences*);
void allowCertificateError(const QSharedPointer<CertificateErrorController> &) ;
void requestGeolocationPermission(const QUrl &requestingOrigin);
- void launchExternalURL(const QUrl &url, ui::PageTransition page_transition, bool is_main_frame);
+ void launchExternalURL(const QUrl &url, ui::PageTransition page_transition, bool is_main_frame, bool has_user_gesture);
FaviconManager *faviconManager();
void setSavePageInfo(const SavePageInfo &spi) { m_savePageInfo = spi; }
diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp
index f3818b194..d1f041c56 100644
--- a/src/core/web_engine_context.cpp
+++ b/src/core/web_engine_context.cpp
@@ -82,12 +82,14 @@
#include "content_browser_client_qt.h"
#include "content_client_qt.h"
#include "content_main_delegate_qt.h"
-#include "dev_tools_http_handler_delegate_qt.h"
+#include "devtools_manager_delegate_qt.h"
#include "gl_context_qt.h"
#include "media_capture_devices_dispatcher.h"
#include "type_conversion.h"
#include "surface_factory_qt.h"
#include "web_engine_library_info.h"
+#include "webui/webui_controller_factory_qt.h"
+
#include <QFileInfo>
#include <QGuiApplication>
#include <QOffscreenSurface>
@@ -512,6 +514,8 @@ WebEngineContext::WebEngineContext()
#if BUILDFLAG(ENABLE_BASIC_PRINTING)
m_printJobManager.reset(new printing::PrintJobManager());
#endif // defined(ENABLE_BASIC_PRINTING)
+
+ content::WebUIControllerFactory::RegisterFactory(WebUIControllerFactoryQt::GetInstance());
}
#if BUILDFLAG(ENABLE_BASIC_PRINTING)
diff --git a/src/core/web_engine_settings.cpp b/src/core/web_engine_settings.cpp
index 498c4e799..44ecaf2ef 100644
--- a/src/core/web_engine_settings.cpp
+++ b/src/core/web_engine_settings.cpp
@@ -110,6 +110,7 @@ WebEngineSettings::WebEngineSettings(WebEngineSettings *_parentSettings)
: m_adapter(0)
, m_batchTimer(new BatchTimer(this))
, parentSettings(_parentSettings)
+ , m_unknownUrlSchemePolicy(WebEngineSettings::InheritedUnknownUrlSchemePolicy)
{
if (parentSettings)
parentSettings->childSettings.insert(this);
@@ -212,6 +213,22 @@ QString WebEngineSettings::defaultTextEncoding() const
return m_defaultEncoding.isEmpty()? parentSettings->defaultTextEncoding() : m_defaultEncoding;
}
+void WebEngineSettings::setUnknownUrlSchemePolicy(WebEngineSettings::UnknownUrlSchemePolicy policy)
+{
+ m_unknownUrlSchemePolicy = policy;
+}
+
+WebEngineSettings::UnknownUrlSchemePolicy WebEngineSettings::unknownUrlSchemePolicy() const
+{
+ // value InheritedUnknownUrlSchemePolicy means it is taken from parent, if possible. If there
+ // is no parent, then AllowUnknownUrlSchemesFromUserInteraction (the default behavior) is used.
+ if (m_unknownUrlSchemePolicy != InheritedUnknownUrlSchemePolicy)
+ return m_unknownUrlSchemePolicy;
+ if (parentSettings)
+ return parentSettings->unknownUrlSchemePolicy();
+ return AllowUnknownUrlSchemesFromUserInteraction;
+}
+
void WebEngineSettings::initDefaults()
{
if (s_defaultAttributes.isEmpty()) {
@@ -284,6 +301,7 @@ void WebEngineSettings::initDefaults()
}
m_defaultEncoding = QStringLiteral("ISO-8859-1");
+ m_unknownUrlSchemePolicy = InheritedUnknownUrlSchemePolicy;
}
void WebEngineSettings::scheduleApply()
diff --git a/src/core/web_engine_settings.h b/src/core/web_engine_settings.h
index 18963344a..ea647a61f 100644
--- a/src/core/web_engine_settings.h
+++ b/src/core/web_engine_settings.h
@@ -107,6 +107,14 @@ public:
DefaultFixedFontSize
};
+ // Must match the values from the public API in qwebenginesettings.h.
+ enum UnknownUrlSchemePolicy {
+ InheritedUnknownUrlSchemePolicy = 0,
+ DisallowUnknownUrlSchemes = 1,
+ AllowUnknownUrlSchemesFromUserInteraction,
+ AllowAllUnknownUrlSchemes
+ };
+
explicit WebEngineSettings(WebEngineSettings *parentSettings = 0);
~WebEngineSettings();
@@ -129,6 +137,9 @@ public:
void setDefaultTextEncoding(const QString &encoding);
QString defaultTextEncoding() const;
+ void setUnknownUrlSchemePolicy(UnknownUrlSchemePolicy policy);
+ UnknownUrlSchemePolicy unknownUrlSchemePolicy() const;
+
void initDefaults();
void scheduleApply();
@@ -155,6 +166,7 @@ private:
static QHash<Attribute, bool> s_defaultAttributes;
static QHash<FontFamily, QString> s_defaultFontFamilies;
static QHash<FontSize, int> s_defaultFontSizes;
+ UnknownUrlSchemePolicy m_unknownUrlSchemePolicy;
friend class BatchTimer;
friend class WebContentsAdapter;
diff --git a/src/core/webui/webui_controller_factory_qt.cpp b/src/core/webui/webui_controller_factory_qt.cpp
new file mode 100644
index 000000000..3b13f03b8
--- /dev/null
+++ b/src/core/webui/webui_controller_factory_qt.cpp
@@ -0,0 +1,219 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtWebEngine module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+// Based on chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc:
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "webui_controller_factory_qt.h"
+
+#include "base/bind.h"
+#include "base/location.h"
+#include "base/threading/thread_task_runner_handle.h"
+#include "build/build_config.h"
+#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/ui/webui/devtools_ui.h"
+#include "chrome/browser/ui/webui/quota_internals/quota_internals_ui.h"
+#include "chrome/browser/ui/webui/task_scheduler_internals/task_scheduler_internals_ui.h"
+#include "chrome/common/url_constants.h"
+#include "content/public/browser/web_contents.h"
+#include "content/public/browser/web_ui.h"
+#include "content/public/common/content_client.h"
+#include "content/public/common/url_utils.h"
+#include "extensions/features/features.h"
+#include "media/media_features.h"
+#include "ppapi/features/features.h"
+#include "printing/features/features.h"
+#include "ui/web_dialogs/web_dialog_ui.h"
+#include "url/gurl.h"
+
+#if defined(OS_LINUX) || defined(OS_ANDROID)
+#include "chrome/browser/ui/webui/sandbox_internals_ui.h"
+#endif
+
+// The Following WebUIs are disabled because they currently doesn't build
+// or doesn't work, but would be interesting for us if they did:
+
+// #include "chrome/browser/ui/webui/inspect_ui.h"
+// #include "chrome/browser/ui/webui/user_actions/user_actions_ui.h"
+
+// #if BUILDFLAG(ENABLE_WEBRTC)
+// #include "chrome/browser/ui/webui/media/webrtc_logs_ui.h"
+// #endif
+
+// #if BUILDFLAG(ENABLE_PRINT_PREVIEW)
+// #include "chrome/browser/ui/webui/print_preview/print_preview_ui.h"
+// #endif
+
+// #if defined(USE_NSS_CERTS) && defined(USE_AURA)
+// #include "chrome/browser/ui/webui/certificate_viewer_ui.h"
+// #endif
+
+// #if BUILDFLAG(ENABLE_EXTENSIONS)
+// #include "chrome/browser/extensions/extension_web_ui.h"
+// #include "chrome/browser/ui/webui/extensions/extensions_ui.h"
+// #include "chrome/common/extensions/extension_constants.h"
+// #include "extensions/browser/extension_registry.h"
+// #include "extensions/browser/extension_system.h"
+// #include "extensions/common/constants.h"
+// #include "extensions/common/extension.h"
+// #include "extensions/common/feature_switch.h"
+// #include "extensions/common/manifest.h"
+// #endif
+
+using content::WebUI;
+using content::WebUIController;
+
+namespace {
+
+// A function for creating a new WebUI. The caller owns the return value, which
+// may be NULL (for example, if the URL refers to an non-existent extension).
+typedef WebUIController* (*WebUIFactoryFunction)(WebUI *web_ui, const GURL &url);
+
+// Template for defining WebUIFactoryFunction.
+template<class T>
+WebUIController *NewWebUI(WebUI *web_ui, const GURL &/*url*/)
+{
+ return new T(web_ui);
+}
+
+// Returns a function that can be used to create the right type of WebUI for a
+// tab, based on its URL. Returns NULL if the URL doesn't have WebUI associated
+// with it.
+WebUIFactoryFunction GetWebUIFactoryFunction(WebUI *web_ui, Profile *profile, const GURL &url)
+{
+ // This will get called a lot to check all URLs, so do a quick check of other
+ // schemes to filter out most URLs.
+ if (!content::HasWebUIScheme(url))
+ return NULL;
+
+ // We must compare hosts only since some of the Web UIs append extra stuff
+ // after the host name.
+ if (url.host() == chrome::kChromeUIQuotaInternalsHost)
+ return &NewWebUI<QuotaInternalsUI>;
+ if (url.host_piece() == chrome::kChromeUITaskSchedulerInternalsHost)
+ return &NewWebUI<TaskSchedulerInternalsUI>;
+
+ if (url.SchemeIs(content::kChromeDevToolsScheme)) {
+// if (!DevToolsUIBindings::IsValidFrontendURL(url))
+// return nullptr;
+ return &NewWebUI<DevToolsUI>;
+ }
+
+// if (url.host_piece() == chrome::kChromeUIUserActionsHost)
+// return &NewWebUI<UserActionsUI>;
+// if (url.host_piece() == chrome::kChromeUIInspectHost)
+// return &NewWebUI<InspectUI>;
+//
+//#if defined(USE_NSS_CERTS) && defined(USE_AURA)
+// if (url.host_piece() == chrome::kChromeUICertificateViewerHost)
+// return &NewWebUI<CertificateViewerUI>;
+//#endif // USE_NSS_CERTS && USE_AURA
+//#if BUILDFLAG(ENABLE_EXTENSIONS)
+// if (url.host_piece() == chrome::kChromeUIExtensionsFrameHost)
+// return &NewWebUI<extensions::ExtensionsUI>;
+//#endif
+//#if BUILDFLAG(ENABLE_PLUGINS)
+// if (url.host_piece() == chrome::kChromeUIFlashHost)
+// return &NewWebUI<FlashUI>;
+//#endif
+//#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
+// if (url.host_piece() == chrome::kChromeUIPrintHost &&
+// !profile->GetPrefs()->GetBoolean(prefs::kPrintPreviewDisabled)) {
+// return &NewWebUI<PrintPreviewUI>;
+// }
+//#endif
+//#if BUILDFLAG(ENABLE_WEBRTC)
+// if (url.host_piece() == chrome::kChromeUIWebRtcLogsHost)
+// return &NewWebUI<WebRtcLogsUI>;
+//#endif
+#if defined(OS_LINUX) || defined(OS_ANDROID)
+ if (url.host_piece() == chrome::kChromeUISandboxHost)
+ return &NewWebUI<SandboxInternalsUI>;
+#endif
+ return nullptr;
+}
+
+} // namespace
+
+namespace QtWebEngineCore {
+
+WebUI::TypeID WebUIControllerFactoryQt::GetWebUIType(content::BrowserContext *browser_context, const GURL &url) const
+{
+ Profile *profile = Profile::FromBrowserContext(browser_context);
+ WebUIFactoryFunction function = GetWebUIFactoryFunction(nullptr, profile, url);
+ return function ? reinterpret_cast<WebUI::TypeID>(function) : WebUI::kNoWebUI;
+}
+
+bool WebUIControllerFactoryQt::UseWebUIForURL(content::BrowserContext *browser_context, const GURL &url) const
+{
+ return GetWebUIType(browser_context, url) != WebUI::kNoWebUI;
+}
+
+bool WebUIControllerFactoryQt::UseWebUIBindingsForURL(content::BrowserContext *browser_context, const GURL &url) const
+{
+ return UseWebUIForURL(browser_context, url);
+}
+
+WebUIController *WebUIControllerFactoryQt::CreateWebUIControllerForURL(WebUI *web_ui, const GURL &url) const
+{
+ Profile *profile = Profile::FromWebUI(web_ui);
+ WebUIFactoryFunction function = GetWebUIFactoryFunction(web_ui, profile, url);
+ if (!function)
+ return nullptr;
+
+ return (*function)(web_ui, url);
+}
+
+// static
+WebUIControllerFactoryQt *WebUIControllerFactoryQt::GetInstance()
+{
+ return base::Singleton<WebUIControllerFactoryQt>::get();
+}
+
+WebUIControllerFactoryQt::WebUIControllerFactoryQt()
+{
+}
+
+WebUIControllerFactoryQt::~WebUIControllerFactoryQt()
+{
+}
+
+} // namespace QtWebEngineCore
diff --git a/src/core/webui/webui_controller_factory_qt.h b/src/core/webui/webui_controller_factory_qt.h
new file mode 100644
index 000000000..440dd5a13
--- /dev/null
+++ b/src/core/webui/webui_controller_factory_qt.h
@@ -0,0 +1,79 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtWebEngine module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef WEB_UI_CONTROLLER_FACTORY_QT_H_
+#define WEB_UI_CONTROLLER_FACTORY_QT_H_
+
+#include "base/macros.h"
+#include "base/memory/singleton.h"
+#include "components/favicon_base/favicon_callback.h"
+#include "content/public/browser/web_ui.h"
+#include "content/public/browser/web_ui_controller_factory.h"
+#include "ui/base/layout.h"
+
+class Profile;
+
+namespace base {
+class RefCountedMemory;
+}
+
+namespace QtWebEngineCore {
+
+class WebUIControllerFactoryQt : public content::WebUIControllerFactory {
+public:
+ content::WebUI::TypeID GetWebUIType(content::BrowserContext *browserContext, const GURL &url) const override;
+ bool UseWebUIForURL(content::BrowserContext *browserContext, const GURL &url) const override;
+ bool UseWebUIBindingsForURL(content::BrowserContext *browserContext, const GURL &url) const override;
+ content::WebUIController *CreateWebUIControllerForURL(content::WebUI *webUi, const GURL &url) const override;
+
+ static WebUIControllerFactoryQt *GetInstance();
+
+protected:
+ WebUIControllerFactoryQt();
+ ~WebUIControllerFactoryQt() override;
+
+private:
+ friend struct base::DefaultSingletonTraits<WebUIControllerFactoryQt>;
+
+ DISALLOW_COPY_AND_ASSIGN(WebUIControllerFactoryQt);
+};
+
+} // namespace QtWebEngineCore
+
+#endif // WEB_UI_CONTROLLER_FACTORY_QT_H_
diff --git a/src/plugins/qwebengineview/qwebengineview_plugin.h b/src/plugins/qwebengineview/qwebengineview_plugin.h
index 35b4a7480..dd7d38a72 100644
--- a/src/plugins/qwebengineview/qwebengineview_plugin.h
+++ b/src/plugins/qwebengineview/qwebengineview_plugin.h
@@ -86,17 +86,17 @@ class QWebEngineViewPlugin: public QObject, public QDesignerCustomWidgetInterfac
public:
explicit QWebEngineViewPlugin(QObject *parent = Q_NULLPTR);
- QString name() const Q_DECL_OVERRIDE;
- QString group() const Q_DECL_OVERRIDE;
- QString toolTip() const Q_DECL_OVERRIDE;
- QString whatsThis() const Q_DECL_OVERRIDE;
- QString includeFile() const Q_DECL_OVERRIDE;
- QIcon icon() const Q_DECL_OVERRIDE;
- bool isContainer() const Q_DECL_OVERRIDE;
- QWidget *createWidget(QWidget *parent) Q_DECL_OVERRIDE;
- bool isInitialized() const Q_DECL_OVERRIDE;
- void initialize(QDesignerFormEditorInterface *core) Q_DECL_OVERRIDE;
- QString domXml() const Q_DECL_OVERRIDE;
+ QString name() const override;
+ QString group() const override;
+ QString toolTip() const override;
+ QString whatsThis() const override;
+ QString includeFile() const override;
+ QIcon icon() const override;
+ bool isContainer() const override;
+ QWidget *createWidget(QWidget *parent) override;
+ bool isInitialized() const override;
+ void initialize(QDesignerFormEditorInterface *core) override;
+ QString domXml() const override;
private:
bool m_initialized;
diff --git a/src/webengine/api/qquickwebengineprofile_p.h b/src/webengine/api/qquickwebengineprofile_p.h
index 1828f8085..5be82a4f5 100644
--- a/src/webengine/api/qquickwebengineprofile_p.h
+++ b/src/webengine/api/qquickwebengineprofile_p.h
@@ -77,8 +77,8 @@ public:
void cancelDownload(quint32 downloadId);
void downloadDestroyed(quint32 downloadId);
- void downloadRequested(DownloadItemInfo &info) Q_DECL_OVERRIDE;
- void downloadUpdated(const DownloadItemInfo &info) Q_DECL_OVERRIDE;
+ void downloadRequested(DownloadItemInfo &info) override;
+ void downloadUpdated(const DownloadItemInfo &info) override;
// QQmlListPropertyHelpers
static void userScripts_append(QQmlListProperty<QQuickWebEngineScript> *p, QQuickWebEngineScript *script);
diff --git a/src/webengine/api/qquickwebenginesettings.cpp b/src/webengine/api/qquickwebenginesettings.cpp
index 3ce53337c..71af00d30 100644
--- a/src/webengine/api/qquickwebenginesettings.cpp
+++ b/src/webengine/api/qquickwebenginesettings.cpp
@@ -73,6 +73,22 @@ QQuickWebEngineSettings::~QQuickWebEngineSettings()
{ }
/*!
+ \enum QQuickWebEngineSettings::UnknownUrlSchemePolicy
+ \since WebEngine 1.7
+
+ This enum describes how navigation requests to URLs with unknown schemes are handled.
+
+ \value DisallowUnknownUrlSchemes
+ Disallows all navigation requests to URLs with unknown schemes.
+ \value AllowUnknownUrlSchemesFromUserInteraction
+ Allows navigation requests to URLs with unknown schemes that are issued from
+ user-interaction (like a mouse-click), whereas other navigation requests (for example
+ from JavaScript) are suppressed.
+ \value AllowAllUnknownUrlSchemes
+ Allows all navigation requests to URLs with unknown schemes.
+*/
+
+/*!
\qmlproperty bool WebEngineSettings::autoLoadImages
Automatically loads images on web pages.
@@ -395,6 +411,22 @@ QString QQuickWebEngineSettings::defaultTextEncoding() const
return d_ptr->defaultTextEncoding();
}
+ASSERT_ENUMS_MATCH(QQuickWebEngineSettings::DisallowUnknownUrlSchemes, WebEngineSettings::DisallowUnknownUrlSchemes)
+ASSERT_ENUMS_MATCH(QQuickWebEngineSettings::AllowUnknownUrlSchemesFromUserInteraction, WebEngineSettings::AllowUnknownUrlSchemesFromUserInteraction)
+ASSERT_ENUMS_MATCH(QQuickWebEngineSettings::AllowAllUnknownUrlSchemes, WebEngineSettings::AllowAllUnknownUrlSchemes)
+
+/*!
+ \qmlproperty WebEngineSettings::UnknownUrlSchemePolicy WebEngineSettings::unknownUrlSchemePolicy
+ \since QtWebEngine 1.7
+ Specifies how navigation requests to URLs with unknown schemes are handled.
+
+ Default is \l{QWebEngineSettings::UnknownUrlSchemePolicy}{WebEngineSettings.AllowUnknownUrlSchemesFromUserInteraction}.
+*/
+QQuickWebEngineSettings::UnknownUrlSchemePolicy QQuickWebEngineSettings::unknownUrlSchemePolicy() const
+{
+ return static_cast<QQuickWebEngineSettings::UnknownUrlSchemePolicy>(d_ptr->unknownUrlSchemePolicy());
+}
+
void QQuickWebEngineSettings::setAutoLoadImages(bool on)
{
bool wasOn = d_ptr->testAttribute(WebEngineSettings::AutoLoadImages);
@@ -599,6 +631,15 @@ void QQuickWebEngineSettings::setShowScrollBars(bool on)
Q_EMIT showScrollBarsChanged();
}
+void QQuickWebEngineSettings::setUnknownUrlSchemePolicy(QQuickWebEngineSettings::UnknownUrlSchemePolicy policy)
+{
+ WebEngineSettings::UnknownUrlSchemePolicy oldPolicy = d_ptr->unknownUrlSchemePolicy();
+ WebEngineSettings::UnknownUrlSchemePolicy newPolicy = static_cast<WebEngineSettings::UnknownUrlSchemePolicy>(policy);
+ d_ptr->setUnknownUrlSchemePolicy(newPolicy);
+ if (oldPolicy != newPolicy)
+ Q_EMIT unknownUrlSchemePolicyChanged();
+}
+
void QQuickWebEngineSettings::setParentSettings(QQuickWebEngineSettings *parentSettings)
{
d_ptr->setParentSettings(parentSettings->d_ptr.data());
diff --git a/src/webengine/api/qquickwebenginesettings_p.h b/src/webengine/api/qquickwebenginesettings_p.h
index a8b11c769..6e0900c58 100644
--- a/src/webengine/api/qquickwebenginesettings_p.h
+++ b/src/webengine/api/qquickwebenginesettings_p.h
@@ -88,8 +88,17 @@ class Q_WEBENGINE_PRIVATE_EXPORT QQuickWebEngineSettings : public QObject {
Q_PROPERTY(bool allowGeolocationOnInsecureOrigins READ allowGeolocationOnInsecureOrigins WRITE setAllowGeolocationOnInsecureOrigins NOTIFY allowGeolocationOnInsecureOriginsChanged REVISION 4 FINAL)
Q_PROPERTY(bool allowWindowActivationFromJavaScript READ allowWindowActivationFromJavaScript WRITE setAllowWindowActivationFromJavaScript NOTIFY allowWindowActivationFromJavaScriptChanged REVISION 5 FINAL)
Q_PROPERTY(bool showScrollBars READ showScrollBars WRITE setShowScrollBars NOTIFY showScrollBarsChanged REVISION 5 FINAL)
+ Q_PROPERTY(UnknownUrlSchemePolicy unknownUrlSchemePolicy READ unknownUrlSchemePolicy WRITE setUnknownUrlSchemePolicy NOTIFY unknownUrlSchemePolicyChanged REVISION 6 FINAL)
public:
+ enum UnknownUrlSchemePolicy {
+ DisallowUnknownUrlSchemes = 1,
+ AllowUnknownUrlSchemesFromUserInteraction,
+ AllowAllUnknownUrlSchemes
+ };
+
+ Q_ENUM(UnknownUrlSchemePolicy)
+
~QQuickWebEngineSettings();
bool autoLoadImages() const;
@@ -117,6 +126,7 @@ public:
bool allowGeolocationOnInsecureOrigins() const;
bool allowWindowActivationFromJavaScript() const;
bool showScrollBars() const;
+ UnknownUrlSchemePolicy unknownUrlSchemePolicy() const;
void setAutoLoadImages(bool on);
void setJavascriptEnabled(bool on);
@@ -143,6 +153,7 @@ public:
void setAllowGeolocationOnInsecureOrigins(bool on);
void setAllowWindowActivationFromJavaScript(bool on);
void setShowScrollBars(bool on);
+ void setUnknownUrlSchemePolicy(UnknownUrlSchemePolicy policy);
signals:
void autoLoadImagesChanged();
@@ -170,6 +181,7 @@ signals:
Q_REVISION(4) void allowGeolocationOnInsecureOriginsChanged();
Q_REVISION(5) void allowWindowActivationFromJavaScriptChanged();
Q_REVISION(5) void showScrollBarsChanged();
+ Q_REVISION(6) void unknownUrlSchemePolicyChanged();
private:
explicit QQuickWebEngineSettings(QQuickWebEngineSettings *parentSettings = 0);
diff --git a/src/webengine/api/qquickwebengineview.cpp b/src/webengine/api/qquickwebengineview.cpp
index 3da21fde5..e11147760 100644
--- a/src/webengine/api/qquickwebengineview.cpp
+++ b/src/webengine/api/qquickwebengineview.cpp
@@ -45,6 +45,7 @@
#include "certificate_error_controller.h"
#include "file_picker_controller.h"
#include "javascript_dialog_controller.h"
+#include "quota_permission_controller.h"
#include "qquickwebenginehistory_p.h"
#include "qquickwebenginecertificateerror_p.h"
#include "qquickwebenginecontextmenurequest_p.h"
@@ -723,6 +724,13 @@ void QQuickWebEngineViewPrivate::runMouseLockPermissionRequest(const QUrl &secur
adapter->grantMouseLockPermission(false);
}
+void QQuickWebEngineViewPrivate::runQuotaPermissionRequest(QSharedPointer<QtWebEngineCore::QuotaPermissionController> controller)
+{
+ Q_Q(QQuickWebEngineView);
+ QQuickWebEngineQuotaPermissionRequest request(controller);
+ Q_EMIT q->quotaPermissionRequested(request);
+}
+
QObject *QQuickWebEngineViewPrivate::accessibilityParentObject()
{
Q_Q(QQuickWebEngineView);
@@ -1183,6 +1191,12 @@ void QQuickWebEngineViewPrivate::renderProcessTerminated(
renderProcessExitStatus(terminationStatus)), exitCode);
}
+void QQuickWebEngineViewPrivate::requestGeometryChange(const QRect &geometry, const QRect &frameGeometry)
+{
+ Q_Q(QQuickWebEngineView);
+ Q_EMIT q->geometryChangeRequested(geometry, frameGeometry);
+}
+
void QQuickWebEngineViewPrivate::startDragging(const content::DropData &dropData,
Qt::DropActions allowedActions,
const QPixmap &pixmap, const QPoint &offset)
@@ -1862,5 +1876,34 @@ void QQuickWebEngineFullScreenRequest::reject()
m_viewPrivate->setFullScreenMode(!m_toggleOn);
}
+QQuickWebEngineQuotaPermissionRequest::QQuickWebEngineQuotaPermissionRequest(QSharedPointer<QtWebEngineCore::QuotaPermissionController> controller)
+ : d_ptr(controller)
+{
+}
+
+QQuickWebEngineQuotaPermissionRequest::~QQuickWebEngineQuotaPermissionRequest()
+{
+}
+
+void QQuickWebEngineQuotaPermissionRequest::accept()
+{
+ d_ptr->accept();
+}
+
+void QQuickWebEngineQuotaPermissionRequest::reject()
+{
+ d_ptr->cancel();
+}
+
+QUrl QQuickWebEngineQuotaPermissionRequest::origin() const
+{
+ return d_ptr->origin();
+}
+
+qint64 QQuickWebEngineQuotaPermissionRequest::requestedSize() const
+{
+ return d_ptr->requestedSize();
+}
+
QT_END_NAMESPACE
diff --git a/src/webengine/api/qquickwebengineview_p.h b/src/webengine/api/qquickwebengineview_p.h
index ae0523460..ee7e01f26 100644
--- a/src/webengine/api/qquickwebengineview_p.h
+++ b/src/webengine/api/qquickwebengineview_p.h
@@ -56,6 +56,12 @@
#include <QQuickItem>
#include <QtGui/qcolor.h>
+
+namespace QtWebEngineCore {
+ class QuotaPermissionController;
+}
+
+
QT_BEGIN_NAMESPACE
class QQmlWebChannel;
@@ -98,6 +104,26 @@ private:
const bool m_toggleOn;
};
+class Q_WEBENGINE_PRIVATE_EXPORT QQuickWebEngineQuotaPermissionRequest {
+ Q_GADGET
+ Q_PROPERTY(QUrl origin READ origin CONSTANT FINAL)
+ Q_PROPERTY(qint64 requestedSize READ requestedSize CONSTANT FINAL)
+public:
+ QQuickWebEngineQuotaPermissionRequest() {}
+ QQuickWebEngineQuotaPermissionRequest(QSharedPointer<QtWebEngineCore::QuotaPermissionController> controller);
+ ~QQuickWebEngineQuotaPermissionRequest();
+
+ Q_INVOKABLE void accept();
+ Q_INVOKABLE void reject();
+ QUrl origin() const;
+ qint64 requestedSize() const;
+
+private:
+ QSharedPointer<QtWebEngineCore::QuotaPermissionController> d_ptr;
+};
+
+#define LATEST_WEBENGINEVIEW_REVISION 7
+
class Q_WEBENGINE_PRIVATE_EXPORT QQuickWebEngineView : public QQuickItem {
Q_OBJECT
Q_PROPERTY(QUrl url READ url WRITE setUrl NOTIFY urlChanged FINAL)
@@ -450,7 +476,7 @@ public:
Q_ENUM(PrintedPageOrientation)
// QmlParserStatus
- virtual void componentComplete() Q_DECL_OVERRIDE;
+ void componentComplete() override;
QQuickWebEngineProfile *profile() const;
void setProfile(QQuickWebEngineProfile *);
@@ -529,18 +555,20 @@ Q_SIGNALS:
Q_REVISION(4) void fileDialogRequested(QQuickWebEngineFileDialogRequest *request);
Q_REVISION(4) void formValidationMessageRequested(QQuickWebEngineFormValidationMessageRequest *request);
Q_REVISION(5) void pdfPrintingFinished(const QString &filePath, bool success);
+ Q_REVISION(7) void quotaPermissionRequested(const QQuickWebEngineQuotaPermissionRequest &request);
+ Q_REVISION(7) void geometryChangeRequested(const QRect &geometry, const QRect &frameGeometry);
#ifdef ENABLE_QML_TESTSUPPORT_API
void testSupportChanged();
#endif
protected:
- void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry) Q_DECL_OVERRIDE;
- void itemChange(ItemChange, const ItemChangeData &) Q_DECL_OVERRIDE;
- void dragEnterEvent(QDragEnterEvent *e) Q_DECL_OVERRIDE;
- void dragLeaveEvent(QDragLeaveEvent *e) Q_DECL_OVERRIDE;
- void dragMoveEvent(QDragMoveEvent *e) Q_DECL_OVERRIDE;
- void dropEvent(QDropEvent *e) Q_DECL_OVERRIDE;
+ void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry) override;
+ void itemChange(ItemChange, const ItemChangeData &) override;
+ void dragEnterEvent(QDragEnterEvent *e) override;
+ void dragLeaveEvent(QDragLeaveEvent *e) override;
+ void dragMoveEvent(QDragMoveEvent *e) override;
+ void dropEvent(QDropEvent *e) override;
private:
Q_DECLARE_PRIVATE(QQuickWebEngineView)
@@ -557,5 +585,6 @@ QT_END_NAMESPACE
QML_DECLARE_TYPE(QQuickWebEngineView)
Q_DECLARE_METATYPE(QQuickWebEngineFullScreenRequest)
+Q_DECLARE_METATYPE(QQuickWebEngineQuotaPermissionRequest)
#endif // QQUICKWEBENGINEVIEW_P_H
diff --git a/src/webengine/api/qquickwebengineview_p_p.h b/src/webengine/api/qquickwebengineview_p_p.h
index bd9b2909b..708725787 100644
--- a/src/webengine/api/qquickwebengineview_p_p.h
+++ b/src/webengine/api/qquickwebengineview_p_p.h
@@ -89,66 +89,67 @@ public:
QtWebEngineCore::UIDelegatesManager *ui();
- virtual QtWebEngineCore::RenderWidgetHostViewQtDelegate* CreateRenderWidgetHostViewQtDelegate(QtWebEngineCore::RenderWidgetHostViewQtDelegateClient *client) Q_DECL_OVERRIDE;
- virtual QtWebEngineCore::RenderWidgetHostViewQtDelegate* CreateRenderWidgetHostViewQtDelegateForPopup(QtWebEngineCore::RenderWidgetHostViewQtDelegateClient *client) Q_DECL_OVERRIDE;
- virtual void titleChanged(const QString&) Q_DECL_OVERRIDE;
- virtual void urlChanged(const QUrl&) Q_DECL_OVERRIDE;
- virtual void iconChanged(const QUrl&) Q_DECL_OVERRIDE;
- virtual void loadProgressChanged(int progress) Q_DECL_OVERRIDE;
- virtual void didUpdateTargetURL(const QUrl&) Q_DECL_OVERRIDE;
- virtual void selectionChanged() Q_DECL_OVERRIDE { }
- virtual void recentlyAudibleChanged(bool recentlyAudible) Q_DECL_OVERRIDE;
- virtual QRectF viewportRect() const Q_DECL_OVERRIDE;
- virtual qreal dpiScale() const Q_DECL_OVERRIDE;
- virtual QColor backgroundColor() const Q_DECL_OVERRIDE;
- virtual void loadStarted(const QUrl &provisionalUrl, bool isErrorPage = false) Q_DECL_OVERRIDE;
- virtual void loadCommitted() Q_DECL_OVERRIDE;
- virtual void loadVisuallyCommitted() Q_DECL_OVERRIDE;
- virtual void loadFinished(bool success, const QUrl &url, bool isErrorPage = false, int errorCode = 0, const QString &errorDescription = QString()) Q_DECL_OVERRIDE;
- virtual void focusContainer() Q_DECL_OVERRIDE;
- virtual void unhandledKeyEvent(QKeyEvent *event) Q_DECL_OVERRIDE;
- virtual void adoptNewWindow(QSharedPointer<QtWebEngineCore::WebContentsAdapter> newWebContents, WindowOpenDisposition disposition, bool userGesture, const QRect &, const QUrl &targetUrl) Q_DECL_OVERRIDE;
- virtual bool isBeingAdopted() Q_DECL_OVERRIDE;
- virtual void close() Q_DECL_OVERRIDE;
- virtual void windowCloseRejected() Q_DECL_OVERRIDE;
- virtual void requestFullScreenMode(const QUrl &origin, bool fullscreen) Q_DECL_OVERRIDE;
- virtual bool isFullScreenMode() const Q_DECL_OVERRIDE;
- virtual bool contextMenuRequested(const QtWebEngineCore::WebEngineContextMenuData &) Q_DECL_OVERRIDE;
- virtual void navigationRequested(int navigationType, const QUrl &url, int &navigationRequestAction, bool isMainFrame) Q_DECL_OVERRIDE;
- virtual void javascriptDialog(QSharedPointer<QtWebEngineCore::JavaScriptDialogController>) Q_DECL_OVERRIDE;
- virtual void runFileChooser(QSharedPointer<QtWebEngineCore::FilePickerController>) Q_DECL_OVERRIDE;
- virtual void showColorDialog(QSharedPointer<QtWebEngineCore::ColorChooserController>) Q_DECL_OVERRIDE;
- virtual void didRunJavaScript(quint64, const QVariant&) Q_DECL_OVERRIDE;
- virtual void didFetchDocumentMarkup(quint64, const QString&) Q_DECL_OVERRIDE { }
- virtual void didFetchDocumentInnerText(quint64, const QString&) Q_DECL_OVERRIDE { }
- virtual void didFindText(quint64, int) Q_DECL_OVERRIDE;
- virtual void didPrintPage(quint64 requestId, const QByteArray &result) Q_DECL_OVERRIDE;
- virtual void didPrintPageToPdf(const QString &filePath, bool success) Q_DECL_OVERRIDE;
- virtual void passOnFocus(bool reverse) Q_DECL_OVERRIDE;
- virtual void javaScriptConsoleMessage(JavaScriptConsoleMessageLevel level, const QString& message, int lineNumber, const QString& sourceID) Q_DECL_OVERRIDE;
- virtual void authenticationRequired(QSharedPointer<QtWebEngineCore::AuthenticationDialogController>) Q_DECL_OVERRIDE;
- virtual void runMediaAccessPermissionRequest(const QUrl &securityOrigin, MediaRequestFlags requestFlags) Q_DECL_OVERRIDE;
- virtual void runMouseLockPermissionRequest(const QUrl &securityOrigin) Q_DECL_OVERRIDE;
- virtual QObject *accessibilityParentObject() Q_DECL_OVERRIDE;
- virtual QtWebEngineCore::WebEngineSettings *webEngineSettings() const Q_DECL_OVERRIDE;
- virtual void allowCertificateError(const QSharedPointer<CertificateErrorController> &errorController) Q_DECL_OVERRIDE;
- virtual void runGeolocationPermissionRequest(QUrl const&) Q_DECL_OVERRIDE;
- virtual void showValidationMessage(const QRect &anchor, const QString &mainText, const QString &subText) Q_DECL_OVERRIDE;
- virtual void hideValidationMessage() Q_DECL_OVERRIDE;
- virtual void moveValidationMessage(const QRect &anchor) Q_DECL_OVERRIDE;
+ QtWebEngineCore::RenderWidgetHostViewQtDelegate* CreateRenderWidgetHostViewQtDelegate(QtWebEngineCore::RenderWidgetHostViewQtDelegateClient *client) override;
+ QtWebEngineCore::RenderWidgetHostViewQtDelegate* CreateRenderWidgetHostViewQtDelegateForPopup(QtWebEngineCore::RenderWidgetHostViewQtDelegateClient *client) override;
+ void titleChanged(const QString&) override;
+ void urlChanged(const QUrl&) override;
+ void iconChanged(const QUrl&) override;
+ void loadProgressChanged(int progress) override;
+ void didUpdateTargetURL(const QUrl&) override;
+ void selectionChanged() override { }
+ void recentlyAudibleChanged(bool recentlyAudible) override;
+ QRectF viewportRect() const override;
+ qreal dpiScale() const override;
+ QColor backgroundColor() const override;
+ void loadStarted(const QUrl &provisionalUrl, bool isErrorPage = false) override;
+ void loadCommitted() override;
+ void loadVisuallyCommitted() override;
+ void loadFinished(bool success, const QUrl &url, bool isErrorPage = false, int errorCode = 0, const QString &errorDescription = QString()) override;
+ void focusContainer() override;
+ void unhandledKeyEvent(QKeyEvent *event) override;
+ void adoptNewWindow(QSharedPointer<QtWebEngineCore::WebContentsAdapter> newWebContents, WindowOpenDisposition disposition, bool userGesture, const QRect &, const QUrl &targetUrl) override;
+ bool isBeingAdopted() override;
+ void close() override;
+ void windowCloseRejected() override;
+ void requestFullScreenMode(const QUrl &origin, bool fullscreen) override;
+ bool isFullScreenMode() const override;
+ bool contextMenuRequested(const QtWebEngineCore::WebEngineContextMenuData &) override;
+ void navigationRequested(int navigationType, const QUrl &url, int &navigationRequestAction, bool isMainFrame) override;
+ void javascriptDialog(QSharedPointer<QtWebEngineCore::JavaScriptDialogController>) override;
+ void runFileChooser(QSharedPointer<QtWebEngineCore::FilePickerController>) override;
+ void showColorDialog(QSharedPointer<QtWebEngineCore::ColorChooserController>) override;
+ void didRunJavaScript(quint64, const QVariant&) override;
+ void didFetchDocumentMarkup(quint64, const QString&) override { }
+ void didFetchDocumentInnerText(quint64, const QString&) override { }
+ void didFindText(quint64, int) override;
+ void didPrintPage(quint64 requestId, const QByteArray &result) override;
+ void didPrintPageToPdf(const QString &filePath, bool success) override;
+ void passOnFocus(bool reverse) override;
+ void javaScriptConsoleMessage(JavaScriptConsoleMessageLevel level, const QString& message, int lineNumber, const QString& sourceID) override;
+ void authenticationRequired(QSharedPointer<QtWebEngineCore::AuthenticationDialogController>) override;
+ void runMediaAccessPermissionRequest(const QUrl &securityOrigin, MediaRequestFlags requestFlags) override;
+ void runMouseLockPermissionRequest(const QUrl &securityOrigin) override;
+ void runQuotaPermissionRequest(QSharedPointer<QtWebEngineCore::QuotaPermissionController>) override;
+ QObject *accessibilityParentObject() override;
+ QtWebEngineCore::WebEngineSettings *webEngineSettings() const override;
+ void allowCertificateError(const QSharedPointer<CertificateErrorController> &errorController) override;
+ void runGeolocationPermissionRequest(QUrl const&) override;
+ void showValidationMessage(const QRect &anchor, const QString &mainText, const QString &subText) override;
+ void hideValidationMessage() override;
+ void moveValidationMessage(const QRect &anchor) override;
virtual void renderProcessTerminated(RenderProcessTerminationStatus terminationStatus,
- int exitCode) Q_DECL_OVERRIDE;
- virtual void requestGeometryChange(const QRect &geometry) Q_DECL_OVERRIDE { Q_UNUSED(geometry); }
- virtual void updateScrollPosition(const QPointF &position) Q_DECL_OVERRIDE;
- virtual void updateContentsSize(const QSizeF &size) Q_DECL_OVERRIDE;
+ int exitCode) override;
+ void requestGeometryChange(const QRect &geometry, const QRect &frameGeometry) override;
+ void updateScrollPosition(const QPointF &position) override;
+ void updateContentsSize(const QSizeF &size) override;
void startDragging(const content::DropData &dropData, Qt::DropActions allowedActions,
- const QPixmap &pixmap, const QPoint &offset) Q_DECL_OVERRIDE;
- virtual bool isEnabled() const Q_DECL_OVERRIDE;
- virtual void setToolTip(const QString &toolTipText) Q_DECL_OVERRIDE;
- const QObject *holdingQObject() const Q_DECL_OVERRIDE;
+ const QPixmap &pixmap, const QPoint &offset) override;
+ bool isEnabled() const override;
+ void setToolTip(const QString &toolTipText) override;
+ const QObject *holdingQObject() const override;
- virtual QSharedPointer<QtWebEngineCore::BrowserContextAdapter> browserContextAdapter() Q_DECL_OVERRIDE;
- QtWebEngineCore::WebContentsAdapter *webContentsAdapter() Q_DECL_OVERRIDE;
+ QSharedPointer<QtWebEngineCore::BrowserContextAdapter> browserContextAdapter() override;
+ QtWebEngineCore::WebContentsAdapter *webContentsAdapter() override;
void setDevicePixelRatio(qreal);
void adoptWebContents(QtWebEngineCore::WebContentsAdapter *webContents);
@@ -200,13 +201,13 @@ class QQuickWebEngineViewAccessible : public QAccessibleObject
{
public:
QQuickWebEngineViewAccessible(QQuickWebEngineView *o);
- QAccessibleInterface *parent() const Q_DECL_OVERRIDE;
- int childCount() const Q_DECL_OVERRIDE;
- QAccessibleInterface *child(int index) const Q_DECL_OVERRIDE;
- int indexOfChild(const QAccessibleInterface*) const Q_DECL_OVERRIDE;
- QString text(QAccessible::Text) const Q_DECL_OVERRIDE;
- QAccessible::Role role() const Q_DECL_OVERRIDE;
- QAccessible::State state() const Q_DECL_OVERRIDE;
+ QAccessibleInterface *parent() const override;
+ int childCount() const override;
+ QAccessibleInterface *child(int index) const override;
+ int indexOfChild(const QAccessibleInterface*) const override;
+ QString text(QAccessible::Text) const override;
+ QAccessible::Role role() const override;
+ QAccessible::State state() const override;
private:
QQuickWebEngineView *engineView() const { return static_cast<QQuickWebEngineView*>(object()); }
diff --git a/src/webengine/doc/src/webengineview_lgpl.qdoc b/src/webengine/doc/src/webengineview_lgpl.qdoc
index 9cd7e3f27..20db51793 100644
--- a/src/webengine/doc/src/webengineview_lgpl.qdoc
+++ b/src/webengine/doc/src/webengineview_lgpl.qdoc
@@ -1297,3 +1297,83 @@
/*! \qmlsignal WebEngineView::navigationRequested(WebEngineNavigationRequest request)
This signal is emitted when the navigation request \a request is issued.
*/
+
+/*!
+ \qmlsignal WebEngineView::quotaPermissionRequested(QuotaPermissionRequest request)
+ \since QtWebEngine 1.7
+
+ This signal is emitted when the web page requests larger persistent storage
+ than the application's current allocation in File System API. The default quota
+ is 0 bytes.
+
+ \sa QuotaPermissionRequest
+*/
+
+/*!
+ \qmltype QuotaPermissionRequest
+ \instantiates QQuickWebEngineQuotaPermissionRequest
+ \inqmlmodule QtWebEngine
+ \since QtWebEngine 1.7
+
+ \brief A utility type for the WebEngineView::quotaPermissionRequested() signal.
+
+ \sa WebEngineView::quotaPermissionRequested()
+*/
+
+/*!
+ \qmlproperty url QuotaPermissionRequest::origin
+ \readonly
+
+ The URL of the web page that issued the quota permission request.
+*/
+
+/*!
+ \qmlproperty qint64 QuotaPermissionRequest::requestedSize
+ \readonly
+
+ Contains the size of the requested disk space in bytes.
+*/
+
+/*!
+ \qmlmethod void QuotaPermissionRequest::accept()
+
+ Accepts the quota permission request.
+
+ \qml
+ WebEngineView {
+ onQuotaPermissionRequested: function(request) {
+ if (request.requestedSize <= 5 * 1024 * 1024)
+ request.accept();
+ else
+ request.reject();
+ }
+ }
+ \endqml
+*/
+
+/*!
+ \qmlmethod void QuotaPermissionRequest::reject()
+ Rejects a quota permission request.
+*/
+
+/*!
+ \qmlsignal WebEngineView::geometryChangeRequested(rect geometry, rect frameGeometry)
+ \since QtWebEngine 1.7
+
+ This signal is emitted whenever the document wants to change the position and size of the
+ page to \a frameGeometry. This can happen for example through JavaScript.
+
+ While \a frameGeometry includes, \a geometry excludes the size of frame margins.
+
+ \note Geometry related properties of QML Window expect a size excluding the window
+ decoration. You have to use \a geometry to handle this signal correctly.
+
+ \qml
+ onGeometryChangeRequested: {
+ window.x = geometry.x
+ window.y = geometry.y
+ window.width = geometry.width
+ window.height = geometry.height
+ }
+ \endqml
+*/
diff --git a/src/webengine/plugin/plugin.cpp b/src/webengine/plugin/plugin.cpp
index 5ab792699..03ce5a332 100644
--- a/src/webengine/plugin/plugin.cpp
+++ b/src/webengine/plugin/plugin.cpp
@@ -66,13 +66,13 @@ class QtWebEnginePlugin : public QQmlExtensionPlugin
Q_OBJECT
Q_PLUGIN_METADATA(IID QQmlExtensionInterface_iid)
public:
- virtual void initializeEngine(QQmlEngine *engine, const char *uri) Q_DECL_OVERRIDE
+ void initializeEngine(QQmlEngine *engine, const char *uri) override
{
Q_UNUSED(uri);
engine->addImageProvider(QQuickWebEngineFaviconProvider::identifier(), new QQuickWebEngineFaviconProvider);
}
- virtual void registerTypes(const char *uri) Q_DECL_OVERRIDE
+ void registerTypes(const char *uri) override
{
Q_ASSERT(QLatin1String(uri) == QLatin1String("QtWebEngine"));
@@ -86,6 +86,7 @@ public:
qmlRegisterType<QQuickWebEngineView, 4>(uri, 1, 4, "WebEngineView");
qmlRegisterType<QQuickWebEngineView, 5>(uri, 1, 5, "WebEngineView");
qmlRegisterType<QQuickWebEngineView, 6>(uri, 1, 6, "WebEngineView");
+ qmlRegisterType<QQuickWebEngineView, 7>(uri, 1, 7, "WebEngineView");
qmlRegisterType<QQuickWebEngineProfile>(uri, 1, 1, "WebEngineProfile");
qmlRegisterType<QQuickWebEngineProfile, 1>(uri, 1, 2, "WebEngineProfile");
qmlRegisterType<QQuickWebEngineProfile, 2>(uri, 1, 3, "WebEngineProfile");
@@ -113,6 +114,7 @@ public:
qmlRegisterUncreatableType<QQuickWebEngineSettings, 3>(uri, 1, 4, "WebEngineSettings", tr("Cannot create a separate instance of WebEngineSettings"));
qmlRegisterUncreatableType<QQuickWebEngineSettings, 4>(uri, 1, 5, "WebEngineSettings", tr("Cannot create a separate instance of WebEngineSettings"));
qmlRegisterUncreatableType<QQuickWebEngineSettings, 5>(uri, 1, 6, "WebEngineSettings", tr("Cannot create a separate instance of WebEngineSettings"));
+ qmlRegisterUncreatableType<QQuickWebEngineSettings, 6>(uri, 1, 7, "WebEngineSettings", tr("Cannot create a separate instance of WebEngineSettings"));
qmlRegisterSingletonType<QQuickWebEngineSingleton>(uri, 1, 1, "WebEngine", webEngineSingletonProvider);
qmlRegisterUncreatableType<QQuickWebEngineHistory>(uri, 1, 1, "NavigationHistory",
tr("Cannot create a separate instance of NavigationHistory"));
@@ -133,6 +135,8 @@ public:
msgUncreatableType("FileDialogRequest"));
qmlRegisterUncreatableType<QQuickWebEngineFormValidationMessageRequest>(uri, 1, 4, "FormValidationMessageRequest",
msgUncreatableType("FormValidationMessageRequest"));
+ qmlRegisterUncreatableType<QQuickWebEngineQuotaPermissionRequest>(uri, 1, 7, "QuotaPermissionRequest",
+ tr("Cannot create a separate instance of QuotaPermissionRequest"));
}
private:
diff --git a/src/webengine/plugin/plugin.pro b/src/webengine/plugin/plugin.pro
index 1f9ef00c5..84b497e34 100644
--- a/src/webengine/plugin/plugin.pro
+++ b/src/webengine/plugin/plugin.pro
@@ -1,7 +1,7 @@
CXX_MODULE = qml
TARGET = qtwebengineplugin
TARGETPATH = QtWebEngine
-IMPORT_VERSION = 1.6
+IMPORT_VERSION = 1.7
QT += webengine qml quick
QT_PRIVATE += webengine-private
diff --git a/src/webengine/plugin/plugins.qmltypes b/src/webengine/plugin/plugins.qmltypes
index 321c462b5..b57aa4498 100644
--- a/src/webengine/plugin/plugins.qmltypes
+++ b/src/webengine/plugin/plugins.qmltypes
@@ -4,7 +4,7 @@ import QtQuick.tooling 1.2
// It is used for QML tooling purposes only.
//
// This file was auto-generated by:
-// 'qmlplugindump -defaultplatform -dependencies dependencies.json -nonrelocatable QtWebEngine 1.6'
+// 'qmlplugindump -defaultplatform -dependencies dependencies.json -nonrelocatable QtWebEngine 1.7'
Module {
dependencies: ["QtQuick 2.6"]
@@ -119,10 +119,11 @@ Module {
"QtWebEngine/WebEngineDownloadItem 1.2",
"QtWebEngine/WebEngineDownloadItem 1.3",
"QtWebEngine/WebEngineDownloadItem 1.4",
- "QtWebEngine/WebEngineDownloadItem 1.5"
+ "QtWebEngine/WebEngineDownloadItem 1.5",
+ "QtWebEngine/WebEngineDownloadItem 1.6"
]
isCreatable: false
- exportMetaObjectRevisions: [0, 1, 2, 3, 4]
+ exportMetaObjectRevisions: [0, 1, 2, 3, 4, 5]
Enum {
name: "DownloadState"
values: {
@@ -195,12 +196,18 @@ Module {
isReadonly: true
}
Property { name: "interruptReasonString"; revision: 4; type: "string"; isReadonly: true }
+ Property { name: "isFinished"; revision: 5; type: "bool"; isReadonly: true }
+ Property { name: "isPaused"; revision: 5; type: "bool"; isReadonly: true }
Signal { name: "savePageFormatChanged"; revision: 2 }
Signal { name: "mimeTypeChanged"; revision: 1 }
Signal { name: "typeChanged"; revision: 3 }
Signal { name: "interruptReasonChanged"; revision: 4 }
+ Signal { name: "isFinishedChanged"; revision: 5 }
+ Signal { name: "isPausedChanged"; revision: 5 }
Method { name: "accept" }
Method { name: "cancel" }
+ Method { name: "pause" }
+ Method { name: "resume" }
}
Component {
name: "QQuickWebEngineFileDialogRequest"
@@ -425,6 +432,16 @@ Module {
Method { name: "clearHttpCache"; revision: 2 }
}
Component {
+ name: "QQuickWebEngineQuotaPermissionRequest"
+ exports: ["QtWebEngine/QuotaPermissionRequest 1.7"]
+ isCreatable: false
+ exportMetaObjectRevisions: [0]
+ Property { name: "origin"; type: "QUrl"; isReadonly: true }
+ Property { name: "requestedSize"; type: "qlonglong"; isReadonly: true }
+ Method { name: "accept" }
+ Method { name: "reject" }
+ }
+ Component {
name: "QQuickWebEngineScript"
prototype: "QObject"
exports: ["QtWebEngine/WebEngineScript 1.1"]
@@ -514,6 +531,14 @@ Module {
]
isCreatable: false
exportMetaObjectRevisions: [0, 1, 2, 3, 4, 5]
+ Enum {
+ name: "UnknownUrlSchemePolicy"
+ values: {
+ "DisallowUnknownUrlSchemes": 1,
+ "AllowUnknownUrlSchemesFromUserInteraction": 2,
+ "AllowAllUnknownUrlSchemes": 3
+ }
+ }
Property { name: "autoLoadImages"; type: "bool" }
Property { name: "javascriptEnabled"; type: "bool" }
Property { name: "javascriptCanOpenWindows"; type: "bool" }
@@ -538,6 +563,8 @@ Module {
Property { name: "allowRunningInsecureContent"; revision: 3; type: "bool" }
Property { name: "allowGeolocationOnInsecureOrigins"; revision: 4; type: "bool" }
Property { name: "allowWindowActivationFromJavaScript"; revision: 5; type: "bool" }
+ Property { name: "showScrollBars"; revision: 5; type: "bool" }
+ Property { name: "unknownUrlSchemePolicy"; revision: 6; type: "UnknownUrlSchemePolicy" }
Signal { name: "fullScreenSupportEnabledChanged"; revision: 1 }
Signal { name: "screenCaptureEnabledChanged"; revision: 2 }
Signal { name: "webGLEnabledChanged"; revision: 2 }
@@ -549,6 +576,8 @@ Module {
Signal { name: "allowRunningInsecureContentChanged"; revision: 3 }
Signal { name: "allowGeolocationOnInsecureOriginsChanged"; revision: 4 }
Signal { name: "allowWindowActivationFromJavaScriptChanged"; revision: 5 }
+ Signal { name: "showScrollBarsChanged"; revision: 5 }
+ Signal { name: "unknownUrlSchemePolicyChanged"; revision: 6 }
}
Component {
name: "QQuickWebEngineSingleton"
@@ -892,7 +921,6 @@ Module {
Property { name: "audioMuted"; revision: 3; type: "bool" }
Property { name: "recentlyAudible"; revision: 3; type: "bool"; isReadonly: true }
Property { name: "webChannelWorld"; revision: 3; type: "uint" }
- Property { name: "testSupport"; type: "QQuickWebEngineTestSupport"; isPointer: true }
Signal {
name: "loadingChanged"
Parameter { name: "loadRequest"; type: "QQuickWebEngineLoadRequest"; isPointer: true }
@@ -1023,6 +1051,11 @@ Module {
Parameter { name: "filePath"; type: "string" }
Parameter { name: "success"; type: "bool" }
}
+ Signal {
+ name: "quotaPermissionRequested"
+ revision: 7
+ Parameter { name: "request"; type: "QQuickWebEngineQuotaPermissionRequest" }
+ }
Method {
name: "runJavaScript"
Parameter { type: "string" }
diff --git a/src/webengine/render_widget_host_view_qt_delegate_quick.h b/src/webengine/render_widget_host_view_qt_delegate_quick.h
index d93fd539a..cbcb58c11 100644
--- a/src/webengine/render_widget_host_view_qt_delegate_quick.h
+++ b/src/webengine/render_widget_host_view_qt_delegate_quick.h
@@ -52,49 +52,49 @@ class RenderWidgetHostViewQtDelegateQuick : public QQuickItem, public RenderWidg
public:
RenderWidgetHostViewQtDelegateQuick(RenderWidgetHostViewQtDelegateClient *client, bool isPopup);
- virtual void initAsChild(WebContentsAdapterClient* container) Q_DECL_OVERRIDE;
- virtual void initAsPopup(const QRect&) Q_DECL_OVERRIDE;
- virtual QRectF screenRect() const Q_DECL_OVERRIDE;
- virtual QRectF contentsRect() const Q_DECL_OVERRIDE;
- virtual void setKeyboardFocus() Q_DECL_OVERRIDE;
- virtual bool hasKeyboardFocus() Q_DECL_OVERRIDE;
- virtual void lockMouse() Q_DECL_OVERRIDE;
- virtual void unlockMouse() Q_DECL_OVERRIDE;
- virtual void show() Q_DECL_OVERRIDE;
- virtual void hide() Q_DECL_OVERRIDE;
- virtual bool isVisible() const Q_DECL_OVERRIDE;
- virtual QWindow* window() const Q_DECL_OVERRIDE;
- virtual QSGTexture *createTextureFromImage(const QImage &) Q_DECL_OVERRIDE;
- virtual QSGLayer *createLayer() Q_DECL_OVERRIDE;
- virtual QSGInternalImageNode *createImageNode() Q_DECL_OVERRIDE;
- virtual QSGTextureNode *createTextureNode() Q_DECL_OVERRIDE;
- virtual QSGRectangleNode *createRectangleNode() Q_DECL_OVERRIDE;
- virtual void update() Q_DECL_OVERRIDE;
- virtual void updateCursor(const QCursor &) Q_DECL_OVERRIDE;
- virtual void resize(int width, int height) Q_DECL_OVERRIDE;
- virtual void move(const QPoint&) Q_DECL_OVERRIDE { }
- virtual void inputMethodStateChanged(bool editorVisible, bool isPasswordInput) Q_DECL_OVERRIDE;
- virtual void setInputMethodHints(Qt::InputMethodHints) Q_DECL_OVERRIDE { }
+ void initAsChild(WebContentsAdapterClient* container) override;
+ void initAsPopup(const QRect&) override;
+ QRectF screenRect() const override;
+ QRectF contentsRect() const override;
+ void setKeyboardFocus() override;
+ bool hasKeyboardFocus() override;
+ void lockMouse() override;
+ void unlockMouse() override;
+ void show() override;
+ void hide() override;
+ bool isVisible() const override;
+ QWindow* window() const override;
+ QSGTexture *createTextureFromImage(const QImage &) override;
+ QSGLayer *createLayer() override;
+ QSGInternalImageNode *createImageNode() override;
+ QSGTextureNode *createTextureNode() override;
+ QSGRectangleNode *createRectangleNode() override;
+ void update() override;
+ void updateCursor(const QCursor &) override;
+ void resize(int width, int height) override;
+ void move(const QPoint&) override { }
+ void inputMethodStateChanged(bool editorVisible, bool isPasswordInput) override;
+ void setInputMethodHints(Qt::InputMethodHints) override { }
// The QtQuick view doesn't have a backbuffer of its own and doesn't need this
- virtual void setClearColor(const QColor &) Q_DECL_OVERRIDE { }
+ void setClearColor(const QColor &) override { }
protected:
- virtual bool event(QEvent *event) Q_DECL_OVERRIDE;
- virtual void focusInEvent(QFocusEvent *event) Q_DECL_OVERRIDE;
- virtual void focusOutEvent(QFocusEvent *event) Q_DECL_OVERRIDE;
- virtual void mousePressEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
- virtual void mouseMoveEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
- virtual void mouseReleaseEvent(QMouseEvent *event) Q_DECL_OVERRIDE;
- virtual void keyPressEvent(QKeyEvent *event) Q_DECL_OVERRIDE;
- virtual void keyReleaseEvent(QKeyEvent *event) Q_DECL_OVERRIDE;
- virtual void wheelEvent(QWheelEvent *event) Q_DECL_OVERRIDE;
- virtual void touchEvent(QTouchEvent *event) Q_DECL_OVERRIDE;
- virtual void hoverMoveEvent(QHoverEvent *event) Q_DECL_OVERRIDE;
- virtual QVariant inputMethodQuery(Qt::InputMethodQuery query) const Q_DECL_OVERRIDE;
- virtual void inputMethodEvent(QInputMethodEvent *event) Q_DECL_OVERRIDE;
- virtual void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry) Q_DECL_OVERRIDE;
- virtual void itemChange(ItemChange change, const ItemChangeData &value) Q_DECL_OVERRIDE;
- virtual QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *) Q_DECL_OVERRIDE;
+ bool event(QEvent *event) override;
+ void focusInEvent(QFocusEvent *event) override;
+ void focusOutEvent(QFocusEvent *event) override;
+ void mousePressEvent(QMouseEvent *event) override;
+ void mouseMoveEvent(QMouseEvent *event) override;
+ void mouseReleaseEvent(QMouseEvent *event) override;
+ void keyPressEvent(QKeyEvent *event) override;
+ void keyReleaseEvent(QKeyEvent *event) override;
+ void wheelEvent(QWheelEvent *event) override;
+ void touchEvent(QTouchEvent *event) override;
+ void hoverMoveEvent(QHoverEvent *event) override;
+ QVariant inputMethodQuery(Qt::InputMethodQuery query) const override;
+ void inputMethodEvent(QInputMethodEvent *event) override;
+ void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry) override;
+ void itemChange(ItemChange change, const ItemChangeData &value) override;
+ QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *) override;
private slots:
void onWindowPosChanged();
diff --git a/src/webengine/render_widget_host_view_qt_delegate_quickwindow.h b/src/webengine/render_widget_host_view_qt_delegate_quickwindow.h
index 6244ee6ce..be4033728 100644
--- a/src/webengine/render_widget_host_view_qt_delegate_quickwindow.h
+++ b/src/webengine/render_widget_host_view_qt_delegate_quickwindow.h
@@ -55,30 +55,30 @@ public:
RenderWidgetHostViewQtDelegateQuickWindow(RenderWidgetHostViewQtDelegate *realDelegate);
~RenderWidgetHostViewQtDelegateQuickWindow();
- virtual void initAsChild(WebContentsAdapterClient* container) Q_DECL_OVERRIDE;
- virtual void initAsPopup(const QRect&) Q_DECL_OVERRIDE;
- virtual QRectF screenRect() const Q_DECL_OVERRIDE;
- virtual QRectF contentsRect() const Q_DECL_OVERRIDE;
- virtual void setKeyboardFocus() Q_DECL_OVERRIDE {}
- virtual bool hasKeyboardFocus() Q_DECL_OVERRIDE { return false; }
- virtual void lockMouse() Q_DECL_OVERRIDE {}
- virtual void unlockMouse() Q_DECL_OVERRIDE {}
- virtual void show() Q_DECL_OVERRIDE;
- virtual void hide() Q_DECL_OVERRIDE;
- virtual bool isVisible() const Q_DECL_OVERRIDE;
- virtual QWindow* window() const Q_DECL_OVERRIDE;
- virtual QSGTexture *createTextureFromImage(const QImage &) Q_DECL_OVERRIDE;
- virtual QSGLayer *createLayer() Q_DECL_OVERRIDE;
- virtual QSGInternalImageNode *createImageNode() Q_DECL_OVERRIDE;
- virtual QSGTextureNode *createTextureNode() Q_DECL_OVERRIDE;
- virtual QSGRectangleNode *createRectangleNode() Q_DECL_OVERRIDE;
- virtual void update() Q_DECL_OVERRIDE;
- virtual void updateCursor(const QCursor &) Q_DECL_OVERRIDE;
- virtual void resize(int width, int height) Q_DECL_OVERRIDE;
- virtual void move(const QPoint &screenPos) Q_DECL_OVERRIDE;
- virtual void inputMethodStateChanged(bool, bool) Q_DECL_OVERRIDE {}
- virtual void setInputMethodHints(Qt::InputMethodHints) Q_DECL_OVERRIDE { }
- virtual void setClearColor(const QColor &) Q_DECL_OVERRIDE { }
+ void initAsChild(WebContentsAdapterClient* container) override;
+ void initAsPopup(const QRect&) override;
+ QRectF screenRect() const override;
+ QRectF contentsRect() const override;
+ void setKeyboardFocus() override {}
+ bool hasKeyboardFocus() override { return false; }
+ void lockMouse() override {}
+ void unlockMouse() override {}
+ void show() override;
+ void hide() override;
+ bool isVisible() const override;
+ QWindow* window() const override;
+ QSGTexture *createTextureFromImage(const QImage &) override;
+ QSGLayer *createLayer() override;
+ QSGInternalImageNode *createImageNode() override;
+ QSGTextureNode *createTextureNode() override;
+ QSGRectangleNode *createRectangleNode() override;
+ void update() override;
+ void updateCursor(const QCursor &) override;
+ void resize(int width, int height) override;
+ void move(const QPoint &screenPos) override;
+ void inputMethodStateChanged(bool, bool) override {}
+ void setInputMethodHints(Qt::InputMethodHints) override { }
+ void setClearColor(const QColor &) override { }
private:
QScopedPointer<RenderWidgetHostViewQtDelegate> m_realDelegate;
diff --git a/src/webenginewidgets/api/qwebenginepage.cpp b/src/webenginewidgets/api/qwebenginepage.cpp
index 76c705c6e..dc525db93 100644
--- a/src/webenginewidgets/api/qwebenginepage.cpp
+++ b/src/webenginewidgets/api/qwebenginepage.cpp
@@ -53,6 +53,7 @@
#include "qwebenginehistory_p.h"
#include "qwebengineprofile.h"
#include "qwebengineprofile_p.h"
+#include "qwebenginequotapermissionrequest.h"
#include "qwebenginescriptcollection_p.h"
#include "qwebenginesettings.h"
#include "qwebengineview.h"
@@ -579,6 +580,13 @@ void QWebEnginePagePrivate::runMouseLockPermissionRequest(const QUrl &securityOr
Q_EMIT q->featurePermissionRequested(securityOrigin, QWebEnginePage::MouseLock);
}
+void QWebEnginePagePrivate::runQuotaPermissionRequest(QSharedPointer<QtWebEngineCore::QuotaPermissionController> controller)
+{
+ Q_Q(QWebEnginePage);
+ QWebEngineQuotaPermissionRequest request(controller);
+ Q_EMIT q->quotaPermissionRequested(request);
+}
+
QObject *QWebEnginePagePrivate::accessibilityParentObject()
{
return view;
@@ -740,6 +748,17 @@ QWebEnginePage::QWebEnginePage(QObject* parent)
*/
/*!
+ \fn QWebEnginePage::quotaPermissionRequested(QWebEngineQuotaPermissionRequest request)
+ \since 5.11
+
+ This signal is emitted when the web page requests larger persistent storage
+ than the application's current allocation in File System API. The default quota
+ is 0 bytes.
+
+ The request object \a request can be used to accept or reject the request.
+*/
+
+/*!
\fn void QWebEnginePage::pdfPrintingFinished(const QString &filePath, bool success)
\since 5.9
@@ -1597,10 +1616,11 @@ void QWebEnginePagePrivate::renderProcessTerminated(RenderProcessTerminationStat
terminationStatus), exitCode);
}
-void QWebEnginePagePrivate::requestGeometryChange(const QRect &geometry)
+void QWebEnginePagePrivate::requestGeometryChange(const QRect &geometry, const QRect &frameGeometry)
{
+ Q_UNUSED(geometry);
Q_Q(QWebEnginePage);
- Q_EMIT q->geometryChangeRequested(geometry);
+ Q_EMIT q->geometryChangeRequested(frameGeometry);
}
void QWebEnginePagePrivate::startDragging(const content::DropData &dropData,
diff --git a/src/webenginewidgets/api/qwebenginepage.h b/src/webenginewidgets/api/qwebenginepage.h
index 295527e74..3fad6ca09 100644
--- a/src/webenginewidgets/api/qwebenginepage.h
+++ b/src/webenginewidgets/api/qwebenginepage.h
@@ -64,6 +64,7 @@ class QWebEngineHistory;
class QWebEnginePage;
class QWebEnginePagePrivate;
class QWebEngineProfile;
+class QWebEngineQuotaPermissionRequest;
class QWebEngineScriptCollection;
class QWebEngineSettings;
@@ -330,6 +331,7 @@ Q_SIGNALS:
void featurePermissionRequested(const QUrl &securityOrigin, QWebEnginePage::Feature feature);
void featurePermissionRequestCanceled(const QUrl &securityOrigin, QWebEnginePage::Feature feature);
void fullScreenRequested(QWebEngineFullScreenRequest fullScreenRequest);
+ void quotaPermissionRequested(QWebEngineQuotaPermissionRequest quotaPermissionRequest);
void authenticationRequired(const QUrl &requestUrl, QAuthenticator *authenticator);
void proxyAuthenticationRequired(const QUrl &requestUrl, QAuthenticator *authenticator, const QString &proxyHost);
diff --git a/src/webenginewidgets/api/qwebenginepage_p.h b/src/webenginewidgets/api/qwebenginepage_p.h
index ec84f05e1..2d44d1849 100644
--- a/src/webenginewidgets/api/qwebenginepage_p.h
+++ b/src/webenginewidgets/api/qwebenginepage_p.h
@@ -82,69 +82,70 @@ public:
QWebEnginePagePrivate(QWebEngineProfile *profile = 0);
~QWebEnginePagePrivate();
- virtual QtWebEngineCore::RenderWidgetHostViewQtDelegate* CreateRenderWidgetHostViewQtDelegate(QtWebEngineCore::RenderWidgetHostViewQtDelegateClient *client) Q_DECL_OVERRIDE;
- virtual QtWebEngineCore::RenderWidgetHostViewQtDelegate* CreateRenderWidgetHostViewQtDelegateForPopup(QtWebEngineCore::RenderWidgetHostViewQtDelegateClient *client) Q_DECL_OVERRIDE { return CreateRenderWidgetHostViewQtDelegate(client); }
- virtual void titleChanged(const QString&) Q_DECL_OVERRIDE;
- virtual void urlChanged(const QUrl&) Q_DECL_OVERRIDE;
- virtual void iconChanged(const QUrl&) Q_DECL_OVERRIDE;
- virtual void loadProgressChanged(int progress) Q_DECL_OVERRIDE;
- virtual void didUpdateTargetURL(const QUrl&) Q_DECL_OVERRIDE;
- virtual void selectionChanged() Q_DECL_OVERRIDE;
- virtual void recentlyAudibleChanged(bool recentlyAudible) Q_DECL_OVERRIDE;
- virtual QRectF viewportRect() const Q_DECL_OVERRIDE;
- virtual qreal dpiScale() const Q_DECL_OVERRIDE;
- virtual QColor backgroundColor() const Q_DECL_OVERRIDE;
- virtual void loadStarted(const QUrl &provisionalUrl, bool isErrorPage = false) Q_DECL_OVERRIDE;
- virtual void loadCommitted() Q_DECL_OVERRIDE;
- virtual void loadVisuallyCommitted() Q_DECL_OVERRIDE { }
- virtual void loadFinished(bool success, const QUrl &url, bool isErrorPage = false, int errorCode = 0, const QString &errorDescription = QString()) Q_DECL_OVERRIDE;
- virtual void focusContainer() Q_DECL_OVERRIDE;
- virtual void unhandledKeyEvent(QKeyEvent *event) Q_DECL_OVERRIDE;
- virtual void adoptNewWindow(QSharedPointer<QtWebEngineCore::WebContentsAdapter> newWebContents, WindowOpenDisposition disposition, bool userGesture, const QRect &initialGeometry, const QUrl &targetUrl) Q_DECL_OVERRIDE;
+ QtWebEngineCore::RenderWidgetHostViewQtDelegate* CreateRenderWidgetHostViewQtDelegate(QtWebEngineCore::RenderWidgetHostViewQtDelegateClient *client) override;
+ QtWebEngineCore::RenderWidgetHostViewQtDelegate* CreateRenderWidgetHostViewQtDelegateForPopup(QtWebEngineCore::RenderWidgetHostViewQtDelegateClient *client) override { return CreateRenderWidgetHostViewQtDelegate(client); }
+ void titleChanged(const QString&) override;
+ void urlChanged(const QUrl&) override;
+ void iconChanged(const QUrl&) override;
+ void loadProgressChanged(int progress) override;
+ void didUpdateTargetURL(const QUrl&) override;
+ void selectionChanged() override;
+ void recentlyAudibleChanged(bool recentlyAudible) override;
+ QRectF viewportRect() const override;
+ qreal dpiScale() const override;
+ QColor backgroundColor() const override;
+ void loadStarted(const QUrl &provisionalUrl, bool isErrorPage = false) override;
+ void loadCommitted() override;
+ void loadVisuallyCommitted() override { }
+ void loadFinished(bool success, const QUrl &url, bool isErrorPage = false, int errorCode = 0, const QString &errorDescription = QString()) override;
+ void focusContainer() override;
+ void unhandledKeyEvent(QKeyEvent *event) override;
+ void adoptNewWindow(QSharedPointer<QtWebEngineCore::WebContentsAdapter> newWebContents, WindowOpenDisposition disposition, bool userGesture, const QRect &initialGeometry, const QUrl &targetUrl) override;
void adoptNewWindowImpl(QWebEnginePage *newPage,
const QSharedPointer<QtWebEngineCore::WebContentsAdapter> &newWebContents,
const QRect &initialGeometry);
- virtual bool isBeingAdopted() Q_DECL_OVERRIDE;
- virtual void close() Q_DECL_OVERRIDE;
- virtual void windowCloseRejected() Q_DECL_OVERRIDE;
- virtual bool contextMenuRequested(const QtWebEngineCore::WebEngineContextMenuData &data) Q_DECL_OVERRIDE;
- virtual void navigationRequested(int navigationType, const QUrl &url, int &navigationRequestAction, bool isMainFrame) Q_DECL_OVERRIDE;
- virtual void requestFullScreenMode(const QUrl &origin, bool fullscreen) Q_DECL_OVERRIDE;
- virtual bool isFullScreenMode() const Q_DECL_OVERRIDE;
- virtual void javascriptDialog(QSharedPointer<QtWebEngineCore::JavaScriptDialogController>) Q_DECL_OVERRIDE;
- virtual void runFileChooser(QSharedPointer<QtWebEngineCore::FilePickerController>) Q_DECL_OVERRIDE;
- virtual void showColorDialog(QSharedPointer<QtWebEngineCore::ColorChooserController>) Q_DECL_OVERRIDE;
- virtual void didRunJavaScript(quint64 requestId, const QVariant& result) Q_DECL_OVERRIDE;
- virtual void didFetchDocumentMarkup(quint64 requestId, const QString& result) Q_DECL_OVERRIDE;
- virtual void didFetchDocumentInnerText(quint64 requestId, const QString& result) Q_DECL_OVERRIDE;
- virtual void didFindText(quint64 requestId, int matchCount) Q_DECL_OVERRIDE;
- virtual void didPrintPage(quint64 requestId, const QByteArray &result) Q_DECL_OVERRIDE;
- virtual void didPrintPageToPdf(const QString &filePath, bool success) Q_DECL_OVERRIDE;
- virtual void passOnFocus(bool reverse) Q_DECL_OVERRIDE;
- virtual void javaScriptConsoleMessage(JavaScriptConsoleMessageLevel level, const QString& message, int lineNumber, const QString& sourceID) Q_DECL_OVERRIDE;
- virtual void authenticationRequired(QSharedPointer<QtWebEngineCore::AuthenticationDialogController>) Q_DECL_OVERRIDE;
- virtual void runMediaAccessPermissionRequest(const QUrl &securityOrigin, MediaRequestFlags requestFlags) Q_DECL_OVERRIDE;
- virtual void runGeolocationPermissionRequest(const QUrl &securityOrigin) Q_DECL_OVERRIDE;
- virtual void runMouseLockPermissionRequest(const QUrl &securityOrigin) Q_DECL_OVERRIDE;
- virtual QObject *accessibilityParentObject() Q_DECL_OVERRIDE;
- virtual QtWebEngineCore::WebEngineSettings *webEngineSettings() const Q_DECL_OVERRIDE;
- virtual void allowCertificateError(const QSharedPointer<CertificateErrorController> &controller) Q_DECL_OVERRIDE;
- virtual void showValidationMessage(const QRect &anchor, const QString &mainText, const QString &subText) Q_DECL_OVERRIDE;
- virtual void hideValidationMessage() Q_DECL_OVERRIDE;
- virtual void moveValidationMessage(const QRect &anchor) Q_DECL_OVERRIDE;
+ bool isBeingAdopted() override;
+ void close() override;
+ void windowCloseRejected() override;
+ bool contextMenuRequested(const QtWebEngineCore::WebEngineContextMenuData &data) override;
+ void navigationRequested(int navigationType, const QUrl &url, int &navigationRequestAction, bool isMainFrame) override;
+ void requestFullScreenMode(const QUrl &origin, bool fullscreen) override;
+ bool isFullScreenMode() const override;
+ void javascriptDialog(QSharedPointer<QtWebEngineCore::JavaScriptDialogController>) override;
+ void runFileChooser(QSharedPointer<QtWebEngineCore::FilePickerController>) override;
+ void showColorDialog(QSharedPointer<QtWebEngineCore::ColorChooserController>) override;
+ void didRunJavaScript(quint64 requestId, const QVariant& result) override;
+ void didFetchDocumentMarkup(quint64 requestId, const QString& result) override;
+ void didFetchDocumentInnerText(quint64 requestId, const QString& result) override;
+ void didFindText(quint64 requestId, int matchCount) override;
+ void didPrintPage(quint64 requestId, const QByteArray &result) override;
+ void didPrintPageToPdf(const QString &filePath, bool success) override;
+ void passOnFocus(bool reverse) override;
+ void javaScriptConsoleMessage(JavaScriptConsoleMessageLevel level, const QString& message, int lineNumber, const QString& sourceID) override;
+ void authenticationRequired(QSharedPointer<QtWebEngineCore::AuthenticationDialogController>) override;
+ void runMediaAccessPermissionRequest(const QUrl &securityOrigin, MediaRequestFlags requestFlags) override;
+ void runGeolocationPermissionRequest(const QUrl &securityOrigin) override;
+ void runMouseLockPermissionRequest(const QUrl &securityOrigin) override;
+ void runQuotaPermissionRequest(QSharedPointer<QtWebEngineCore::QuotaPermissionController>) override;
+ QObject *accessibilityParentObject() override;
+ QtWebEngineCore::WebEngineSettings *webEngineSettings() const override;
+ void allowCertificateError(const QSharedPointer<CertificateErrorController> &controller) override;
+ void showValidationMessage(const QRect &anchor, const QString &mainText, const QString &subText) override;
+ void hideValidationMessage() override;
+ void moveValidationMessage(const QRect &anchor) override;
virtual void renderProcessTerminated(RenderProcessTerminationStatus terminationStatus,
- int exitCode) Q_DECL_OVERRIDE;
- virtual void requestGeometryChange(const QRect &geometry) Q_DECL_OVERRIDE;
- virtual void updateScrollPosition(const QPointF &position) Q_DECL_OVERRIDE;
- virtual void updateContentsSize(const QSizeF &size) Q_DECL_OVERRIDE;
+ int exitCode) override;
+ void requestGeometryChange(const QRect &geometry, const QRect &frameGeometry) override;
+ void updateScrollPosition(const QPointF &position) override;
+ void updateContentsSize(const QSizeF &size) override;
void startDragging(const content::DropData &dropData, Qt::DropActions allowedActions,
- const QPixmap &pixmap, const QPoint &offset) Q_DECL_OVERRIDE;
- virtual bool isEnabled() const Q_DECL_OVERRIDE;
- virtual void setToolTip(const QString &toolTipText) Q_DECL_OVERRIDE;
- const QObject *holdingQObject() const Q_DECL_OVERRIDE;
+ const QPixmap &pixmap, const QPoint &offset) override;
+ bool isEnabled() const override;
+ void setToolTip(const QString &toolTipText) override;
+ const QObject *holdingQObject() const override;
- virtual QSharedPointer<QtWebEngineCore::BrowserContextAdapter> browserContextAdapter() Q_DECL_OVERRIDE;
- QtWebEngineCore::WebContentsAdapter *webContentsAdapter() Q_DECL_OVERRIDE;
+ QSharedPointer<QtWebEngineCore::BrowserContextAdapter> browserContextAdapter() override;
+ QtWebEngineCore::WebContentsAdapter *webContentsAdapter() override;
void updateAction(QWebEnginePage::WebAction) const;
void updateNavigationActions();
diff --git a/src/webenginewidgets/api/qwebengineprofile_p.h b/src/webenginewidgets/api/qwebengineprofile_p.h
index c5a75f6d4..ffb28ec6d 100644
--- a/src/webenginewidgets/api/qwebengineprofile_p.h
+++ b/src/webenginewidgets/api/qwebengineprofile_p.h
@@ -78,8 +78,8 @@ public:
void downloadDestroyed(quint32 downloadId);
- void downloadRequested(DownloadItemInfo &info) Q_DECL_OVERRIDE;
- void downloadUpdated(const DownloadItemInfo &info) Q_DECL_OVERRIDE;
+ void downloadRequested(DownloadItemInfo &info) override;
+ void downloadUpdated(const DownloadItemInfo &info) override;
private:
QWebEngineProfile *q_ptr;
diff --git a/src/webenginewidgets/api/qwebenginequotapermissionrequest.cpp b/src/webenginewidgets/api/qwebenginequotapermissionrequest.cpp
new file mode 100644
index 000000000..0841854ea
--- /dev/null
+++ b/src/webenginewidgets/api/qwebenginequotapermissionrequest.cpp
@@ -0,0 +1,98 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtWebEngine module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qwebenginequotapermissionrequest.h"
+
+#include "quota_permission_controller.h"
+
+QT_BEGIN_NAMESPACE
+
+/*!
+ \class QWebEngineQuotaPermissionRequest
+ \brief The QWebEngineQuotaPermissionRequest class enables accepting or rejecting
+ requests for larger persistent storage than the application's current allocation
+ in File System API.
+
+ \since 5.11
+
+ \inmodule QtWebEngineWidgets
+*/
+
+QWebEngineQuotaPermissionRequest::QWebEngineQuotaPermissionRequest(QSharedPointer<QtWebEngineCore::QuotaPermissionController> controller)
+ : d_ptr(controller)
+{
+}
+
+/*!
+ Rejects a request for larger persistent storage.
+*/
+void QWebEngineQuotaPermissionRequest::reject()
+{
+ d_ptr->cancel();
+}
+
+/*!
+ Accepts a request for larger persistent storage.
+*/
+void QWebEngineQuotaPermissionRequest::accept()
+{
+ d_ptr->accept();
+}
+
+/*!
+ \property QWebEngineQuotaPermissionRequest::origin
+ \brief The URL of the web page that issued the quota permission request.
+*/
+
+QUrl QWebEngineQuotaPermissionRequest::origin() const
+{
+ return d_ptr->origin();
+}
+
+/*!
+ \property QWebEngineQuotaPermissionRequest::requestedSize
+ \brief Contains the size of the requested disk space in bytes.
+*/
+
+qint64 QWebEngineQuotaPermissionRequest::requestedSize() const
+{
+ return d_ptr->requestedSize();
+}
+
+QT_END_NAMESPACE
diff --git a/src/webenginewidgets/api/qwebenginequotapermissionrequest.h b/src/webenginewidgets/api/qwebenginequotapermissionrequest.h
new file mode 100644
index 000000000..aa0184fad
--- /dev/null
+++ b/src/webenginewidgets/api/qwebenginequotapermissionrequest.h
@@ -0,0 +1,71 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtWebEngine module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 3 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL3 included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 3 requirements
+** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 2.0 or (at your option) the GNU General
+** Public license version 3 or any later version approved by the KDE Free
+** Qt Foundation. The licenses are as published by the Free Software
+** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-2.0.html and
+** https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QWEBENGINEQUOTAPERMISSIONREQUEST_H
+#define QWEBENGINEQUOTAPERMISSIONREQUEST_H
+
+#include <QtCore/qsharedpointer.h>
+#include <QtCore/qurl.h>
+#include <QtWebEngineWidgets/qtwebenginewidgetsglobal.h>
+
+namespace QtWebEngineCore {
+ class QuotaPermissionController;
+}
+
+QT_BEGIN_NAMESPACE
+
+class QWEBENGINEWIDGETS_EXPORT QWebEngineQuotaPermissionRequest {
+ Q_GADGET
+ Q_PROPERTY(QUrl origin READ origin)
+ Q_PROPERTY(qint64 requestedSize READ requestedSize)
+public:
+ Q_INVOKABLE void accept();
+ Q_INVOKABLE void reject();
+ QUrl origin() const;
+ qint64 requestedSize() const;
+
+private:
+ QWebEngineQuotaPermissionRequest(QSharedPointer<QtWebEngineCore::QuotaPermissionController> controller);
+ QSharedPointer<QtWebEngineCore::QuotaPermissionController> d_ptr;
+ friend class QWebEnginePagePrivate;
+};
+
+QT_END_NAMESPACE
+
+#endif // QWEBENGINEQUOTAPERMISSIONREQUEST_H
diff --git a/src/webenginewidgets/api/qwebenginesettings.cpp b/src/webenginewidgets/api/qwebenginesettings.cpp
index 1def61cb6..2d7c68926 100644
--- a/src/webenginewidgets/api/qwebenginesettings.cpp
+++ b/src/webenginewidgets/api/qwebenginesettings.cpp
@@ -182,7 +182,6 @@ void QWebEngineSettings::resetFontSize(QWebEngineSettings::FontSize type)
d->resetFontSize(static_cast<WebEngineSettings::FontSize>(type));
}
-
void QWebEngineSettings::setDefaultTextEncoding(const QString &encoding)
{
Q_D(QWebEngineSettings);
@@ -195,6 +194,30 @@ QString QWebEngineSettings::defaultTextEncoding() const
return d->defaultTextEncoding();
}
+ASSERT_ENUMS_MATCH(WebEngineSettings::DisallowUnknownUrlSchemes, QWebEngineSettings::DisallowUnknownUrlSchemes)
+ASSERT_ENUMS_MATCH(WebEngineSettings::AllowUnknownUrlSchemesFromUserInteraction, QWebEngineSettings::AllowUnknownUrlSchemesFromUserInteraction)
+ASSERT_ENUMS_MATCH(WebEngineSettings::AllowAllUnknownUrlSchemes, QWebEngineSettings::AllowAllUnknownUrlSchemes)
+
+QWebEngineSettings::UnknownUrlSchemePolicy QWebEngineSettings::unknownUrlSchemePolicy() const
+{
+ Q_D(const QWebEngineSettings);
+ WebEngineSettings::UnknownUrlSchemePolicy result = d->unknownUrlSchemePolicy();
+ Q_ASSERT(result != WebEngineSettings::InheritedUnknownUrlSchemePolicy);
+ return static_cast<QWebEngineSettings::UnknownUrlSchemePolicy>(result);
+}
+
+void QWebEngineSettings::setUnknownUrlSchemePolicy(QWebEngineSettings::UnknownUrlSchemePolicy policy)
+{
+ Q_D(QWebEngineSettings);
+ d->setUnknownUrlSchemePolicy(static_cast<WebEngineSettings::UnknownUrlSchemePolicy>(policy));
+}
+
+void QWebEngineSettings::resetUnknownUrlSchemePolicy()
+{
+ Q_D(QWebEngineSettings);
+ d->setUnknownUrlSchemePolicy(WebEngineSettings::InheritedUnknownUrlSchemePolicy);
+}
+
void QWebEngineSettings::setAttribute(QWebEngineSettings::WebAttribute attr, bool on)
{
Q_D(QWebEngineSettings);
diff --git a/src/webenginewidgets/api/qwebenginesettings.h b/src/webenginewidgets/api/qwebenginesettings.h
index 470609227..fc9372968 100644
--- a/src/webenginewidgets/api/qwebenginesettings.h
+++ b/src/webenginewidgets/api/qwebenginesettings.h
@@ -101,6 +101,12 @@ public:
DefaultFixedFontSize
};
+ enum UnknownUrlSchemePolicy {
+ DisallowUnknownUrlSchemes = 1,
+ AllowUnknownUrlSchemesFromUserInteraction,
+ AllowAllUnknownUrlSchemes
+ };
+
#if QT_DEPRECATED_SINCE(5, 5)
static QWebEngineSettings *globalSettings();
#endif
@@ -121,6 +127,10 @@ public:
void setDefaultTextEncoding(const QString &encoding);
QString defaultTextEncoding() const;
+ UnknownUrlSchemePolicy unknownUrlSchemePolicy() const;
+ void setUnknownUrlSchemePolicy(UnknownUrlSchemePolicy policy);
+ void resetUnknownUrlSchemePolicy();
+
private:
Q_DISABLE_COPY(QWebEngineSettings)
typedef ::QtWebEngineCore::WebEngineSettings QWebEngineSettingsPrivate;
diff --git a/src/webenginewidgets/api/qwebengineview.h b/src/webenginewidgets/api/qwebengineview.h
index 487cc2316..795e011ad 100644
--- a/src/webenginewidgets/api/qwebengineview.h
+++ b/src/webenginewidgets/api/qwebengineview.h
@@ -103,7 +103,7 @@ public:
void findText(const QString &subString, QWebEnginePage::FindFlags options = QWebEnginePage::FindFlags(), const QWebEngineCallback<bool> &resultCallback = QWebEngineCallback<bool>());
#endif
- virtual QSize sizeHint() const Q_DECL_OVERRIDE;
+ QSize sizeHint() const override;
QWebEngineSettings *settings() const;
public Q_SLOTS:
@@ -126,14 +126,14 @@ Q_SIGNALS:
protected:
virtual QWebEngineView *createWindow(QWebEnginePage::WebWindowType type);
- virtual void contextMenuEvent(QContextMenuEvent*) Q_DECL_OVERRIDE;
- virtual bool event(QEvent*) Q_DECL_OVERRIDE;
- virtual void showEvent(QShowEvent *) Q_DECL_OVERRIDE;
- virtual void hideEvent(QHideEvent *) Q_DECL_OVERRIDE;
- void dragEnterEvent(QDragEnterEvent *e) Q_DECL_OVERRIDE;
- void dragLeaveEvent(QDragLeaveEvent *e) Q_DECL_OVERRIDE;
- void dragMoveEvent(QDragMoveEvent *e) Q_DECL_OVERRIDE;
- void dropEvent(QDropEvent *e) Q_DECL_OVERRIDE;
+ void contextMenuEvent(QContextMenuEvent*) override;
+ bool event(QEvent*) override;
+ void showEvent(QShowEvent *) override;
+ void hideEvent(QHideEvent *) override;
+ void dragEnterEvent(QDragEnterEvent *e) override;
+ void dragLeaveEvent(QDragLeaveEvent *e) override;
+ void dragMoveEvent(QDragMoveEvent *e) override;
+ void dropEvent(QDropEvent *e) override;
private:
Q_DISABLE_COPY(QWebEngineView)
diff --git a/src/webenginewidgets/api/qwebengineview_p.h b/src/webenginewidgets/api/qwebengineview_p.h
index f3a37225b..7f0cdac45 100644
--- a/src/webenginewidgets/api/qwebengineview_p.h
+++ b/src/webenginewidgets/api/qwebengineview_p.h
@@ -80,9 +80,9 @@ public:
QWebEngineViewAccessible(QWebEngineView *o) : QAccessibleWidget(o)
{}
- int childCount() const Q_DECL_OVERRIDE;
- QAccessibleInterface *child(int index) const Q_DECL_OVERRIDE;
- int indexOfChild(const QAccessibleInterface *child) const Q_DECL_OVERRIDE;
+ int childCount() const override;
+ QAccessibleInterface *child(int index) const override;
+ int indexOfChild(const QAccessibleInterface *child) const override;
private:
QWebEngineView *view() const { return static_cast<QWebEngineView*>(object()); }
diff --git a/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc b/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc
index 5248a383a..47370a63c 100644
--- a/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc
+++ b/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc
@@ -581,6 +581,14 @@
This signal is emitted whenever the document wants to change the position and size of the
page to \a geom. This can happen for example through JavaScript.
+
+ \note \l{QWindow::}{setGeometry()} expects a size excluding the window
+ decoration, while \a geom includes it. You have to remove the size of the frame margins
+ from \a geom to handle this signal correctly.
+
+ \code
+ window->setGeometry(geom.marginsRemoved(window->frameMargins()));
+ \endcode
*/
/*!
diff --git a/src/webenginewidgets/doc/src/qwebenginesettings_lgpl.qdoc b/src/webenginewidgets/doc/src/qwebenginesettings_lgpl.qdoc
index d3b16a935..fb5ed019e 100644
--- a/src/webenginewidgets/doc/src/qwebenginesettings_lgpl.qdoc
+++ b/src/webenginewidgets/doc/src/qwebenginesettings_lgpl.qdoc
@@ -168,7 +168,24 @@
\value ShowScrollBars
Shows scroll bars.
Enabled by default. (Added in Qt 5.10)
+*/
+
+/*!
+ \enum QWebEngineSettings::UnknownUrlSchemePolicy
+ \since Qt 5.11
+
+ This enum describes how navigation requests to URLs with unknown schemes are handled.
+ \value DisallowUnknownUrlSchemes
+ Disallows all navigation requests to URLs with unknown schemes.
+ \value AllowUnknownUrlSchemesFromUserInteraction
+ Allows navigation requests to URLs with unknown schemes that are issued from
+ user-interaction (like a mouse-click), whereas other navigation requests (for example
+ from JavaScript) are suppressed.
+ \value AllowAllUnknownUrlSchemes
+ Allows all navigation requests to URLs with unknown schemes.
+
+ \sa unknownUrlSchemePolicy setUnknownUrlSchemePolicy resetUnknownUrlSchemePolicy
*/
/*!
@@ -224,6 +241,29 @@
*/
/*!
+ \fn QWebEngineSettings::UnknownUrlSchemePolicy QWebEngineSettings::unknownUrlSchemePolicy() const
+ \since Qt 5.11
+ Returns the currently selected policy for handling navigation requests to URLs with
+ unknown schemes. Default is \l{QWebEngineSettings::AllowUnknownUrlSchemesFromUserInteraction}.
+ \sa setUnknownUrlSchemePolicy resetUnknownUrlSchemePolicy
+*/
+
+/*!
+ \fn void QWebEngineSettings::setUnknownUrlSchemePolicy(QWebEngineSettings::UnknownUrlSchemePolicy policy)
+ \since Qt 5.11
+ Sets the policy for handling navigation requests to URLs with unknown schemes to \a policy.
+ Default is \l{QWebEngineSettings::AllowUnknownUrlSchemesFromUserInteraction}.
+ \sa unknownUrlSchemePolicy resetUnknownUrlSchemePolicy
+*/
+
+/*!
+ \fn void QWebEngineSettings::resetUnknownUrlSchemePolicy()
+ \since Qt 5.11
+ Removes the policy for handling navigation requests to URLs with unknown schemes.
+ \sa unknownUrlSchemePolicy setUnknownUrlSchemePolicy
+*/
+
+/*!
\fn void QWebEngineSettings::setAttribute(WebAttribute attribute, bool on)
Enables or disables the specified \a attribute feature depending on the
diff --git a/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.h b/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.h
index f3e9da2cc..79958132c 100644
--- a/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.h
+++ b/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.h
@@ -53,38 +53,38 @@ class RenderWidgetHostViewQtDelegateWidget : public QQuickWidget, public RenderW
public:
RenderWidgetHostViewQtDelegateWidget(RenderWidgetHostViewQtDelegateClient *client, QWidget *parent = 0);
- virtual void initAsChild(WebContentsAdapterClient* container) Q_DECL_OVERRIDE;
- virtual void initAsPopup(const QRect&) Q_DECL_OVERRIDE;
- virtual QRectF screenRect() const Q_DECL_OVERRIDE;
- virtual QRectF contentsRect() const Q_DECL_OVERRIDE;
- virtual void setKeyboardFocus() Q_DECL_OVERRIDE;
- virtual bool hasKeyboardFocus() Q_DECL_OVERRIDE;
- virtual void lockMouse() Q_DECL_OVERRIDE;
- virtual void unlockMouse() Q_DECL_OVERRIDE;
- virtual void show() Q_DECL_OVERRIDE;
- virtual void hide() Q_DECL_OVERRIDE;
- virtual bool isVisible() const Q_DECL_OVERRIDE;
- virtual QWindow* window() const Q_DECL_OVERRIDE;
- virtual QSGTexture *createTextureFromImage(const QImage &) Q_DECL_OVERRIDE;
- virtual QSGLayer *createLayer() Q_DECL_OVERRIDE;
- virtual QSGInternalImageNode *createImageNode() Q_DECL_OVERRIDE;
- virtual QSGTextureNode *createTextureNode() Q_DECL_OVERRIDE;
- virtual QSGRectangleNode *createRectangleNode() Q_DECL_OVERRIDE;
- virtual void update() Q_DECL_OVERRIDE;
- virtual void updateCursor(const QCursor &) Q_DECL_OVERRIDE;
- virtual void resize(int width, int height) Q_DECL_OVERRIDE;
- virtual void move(const QPoint &screenPos) Q_DECL_OVERRIDE;
- virtual void inputMethodStateChanged(bool editorVisible, bool passwordInput) Q_DECL_OVERRIDE;
- virtual void setInputMethodHints(Qt::InputMethodHints) Q_DECL_OVERRIDE;
- virtual void setClearColor(const QColor &color) Q_DECL_OVERRIDE;
+ void initAsChild(WebContentsAdapterClient* container) override;
+ void initAsPopup(const QRect&) override;
+ QRectF screenRect() const override;
+ QRectF contentsRect() const override;
+ void setKeyboardFocus() override;
+ bool hasKeyboardFocus() override;
+ void lockMouse() override;
+ void unlockMouse() override;
+ void show() override;
+ void hide() override;
+ bool isVisible() const override;
+ QWindow* window() const override;
+ QSGTexture *createTextureFromImage(const QImage &) override;
+ QSGLayer *createLayer() override;
+ QSGInternalImageNode *createImageNode() override;
+ QSGTextureNode *createTextureNode() override;
+ QSGRectangleNode *createRectangleNode() override;
+ void update() override;
+ void updateCursor(const QCursor &) override;
+ void resize(int width, int height) override;
+ void move(const QPoint &screenPos) override;
+ void inputMethodStateChanged(bool editorVisible, bool passwordInput) override;
+ void setInputMethodHints(Qt::InputMethodHints) override;
+ void setClearColor(const QColor &color) override;
protected:
- bool event(QEvent *event) Q_DECL_OVERRIDE;
- void resizeEvent(QResizeEvent *resizeEvent) Q_DECL_OVERRIDE;
- void showEvent(QShowEvent *) Q_DECL_OVERRIDE;
- void hideEvent(QHideEvent *) Q_DECL_OVERRIDE;
+ bool event(QEvent *event) override;
+ void resizeEvent(QResizeEvent *resizeEvent) override;
+ void showEvent(QShowEvent *) override;
+ void hideEvent(QHideEvent *) override;
- QVariant inputMethodQuery(Qt::InputMethodQuery query) const Q_DECL_OVERRIDE;
+ QVariant inputMethodQuery(Qt::InputMethodQuery query) const override;
private slots:
void onWindowPosChanged();
diff --git a/src/webenginewidgets/ui/messagebubblewidget_p.h b/src/webenginewidgets/ui/messagebubblewidget_p.h
index 8815d1ba4..6898aea13 100644
--- a/src/webenginewidgets/ui/messagebubblewidget_p.h
+++ b/src/webenginewidgets/ui/messagebubblewidget_p.h
@@ -73,7 +73,7 @@ public:
static void moveBubble(QWebEngineView *view, const QRect &anchor);
protected:
- void paintEvent(QPaintEvent *) Q_DECL_OVERRIDE;
+ void paintEvent(QPaintEvent *) override;
private:
void createBubble(const int maxWidth, const QString &mainText, const QString &subText);
diff --git a/src/webenginewidgets/webenginewidgets.pro b/src/webenginewidgets/webenginewidgets.pro
index a5c22e7be..29c961c80 100644
--- a/src/webenginewidgets/webenginewidgets.pro
+++ b/src/webenginewidgets/webenginewidgets.pro
@@ -20,6 +20,7 @@ SOURCES = \
api/qwebenginehistory.cpp \
api/qwebenginepage.cpp \
api/qwebengineprofile.cpp \
+ api/qwebenginequotapermissionrequest.cpp \
api/qwebenginescript.cpp \
api/qwebenginescriptcollection.cpp \
api/qwebenginesettings.cpp \
@@ -38,6 +39,7 @@ HEADERS = \
api/qwebenginepage_p.h \
api/qwebengineprofile.h \
api/qwebengineprofile_p.h \
+ api/qwebenginequotapermissionrequest.h \
api/qwebenginescriptcollection.h \
api/qwebenginescriptcollection_p.h \
api/qwebenginesettings.h \
diff --git a/tests/auto/quick/publicapi/tst_publicapi.cpp b/tests/auto/quick/publicapi/tst_publicapi.cpp
index 5cc0d18df..7d793f1b3 100644
--- a/tests/auto/quick/publicapi/tst_publicapi.cpp
+++ b/tests/auto/quick/publicapi/tst_publicapi.cpp
@@ -66,6 +66,7 @@ static QList<const QMetaObject *> typesToCheck = QList<const QMetaObject *>()
<< &QQuickWebEngineScript::staticMetaObject
<< &QQuickWebEngineSettings::staticMetaObject
<< &QQuickWebEngineFullScreenRequest::staticMetaObject
+ << &QQuickWebEngineQuotaPermissionRequest::staticMetaObject
<< &QQuickWebEngineSingleton::staticMetaObject
<< &QQuickWebEngineAuthenticationDialogRequest::staticMetaObject
<< &QQuickWebEngineJavaScriptDialogRequest::staticMetaObject
@@ -183,6 +184,7 @@ static QStringList expectedAPI = QStringList()
<< "QQuickWebEngineView.javaScriptConsoleMessage(JavaScriptConsoleMessageLevel,QString,int,QString) --> void"
<< "QQuickWebEngineView.certificateError(QQuickWebEngineCertificateError*) --> void"
<< "QQuickWebEngineView.fullScreenRequested(QQuickWebEngineFullScreenRequest) --> void"
+ << "QQuickWebEngineView.quotaPermissionRequested(QQuickWebEngineQuotaPermissionRequest) --> void"
<< "QQuickWebEngineView.isFullScreenChanged() --> void"
<< "QQuickWebEngineView.featurePermissionRequested(QUrl,Feature) --> void"
<< "QQuickWebEngineView.newViewRequested(QQuickWebEngineNewViewRequest*) --> void"
@@ -529,6 +531,10 @@ static QStringList expectedAPI = QStringList()
<< "QQuickWebEngineFullScreenRequest.toggleOn --> bool"
<< "QQuickWebEngineFullScreenRequest.accept() --> void"
<< "QQuickWebEngineFullScreenRequest.reject() --> void"
+ << "QQuickWebEngineQuotaPermissionRequest.origin --> QUrl"
+ << "QQuickWebEngineQuotaPermissionRequest.requestedSize --> qlonglong"
+ << "QQuickWebEngineQuotaPermissionRequest.accept() --> void"
+ << "QQuickWebEngineQuotaPermissionRequest.reject() --> void"
<< "QQuickWebEngineSingleton.settings --> QQuickWebEngineSettings*"
<< "QQuickWebEngineSingleton.defaultProfile --> QQuickWebEngineProfile*"
;
diff --git a/tests/auto/quick/qmltests/data/TestWebEngineView.qml b/tests/auto/quick/qmltests/data/TestWebEngineView.qml
index 8304a993a..9fb8c4bfe 100644
--- a/tests/auto/quick/qmltests/data/TestWebEngineView.qml
+++ b/tests/auto/quick/qmltests/data/TestWebEngineView.qml
@@ -28,7 +28,7 @@
import QtQuick 2.0
import QtTest 1.1
-import QtWebEngine 1.3
+import QtWebEngine 1.7
WebEngineView {
property var loadStatus: null
diff --git a/tests/auto/widgets/qwebenginefaviconmanager/tst_qwebenginefaviconmanager.cpp b/tests/auto/widgets/qwebenginefaviconmanager/tst_qwebenginefaviconmanager.cpp
index 38311cad2..710561cce 100644
--- a/tests/auto/widgets/qwebenginefaviconmanager/tst_qwebenginefaviconmanager.cpp
+++ b/tests/auto/widgets/qwebenginefaviconmanager/tst_qwebenginefaviconmanager.cpp
@@ -238,7 +238,7 @@ void tst_QWebEngineFaviconManager::errorPageEnabled()
QUrl url("invalid://url");
m_page->load(url);
- QTRY_COMPARE(loadFinishedSpy.count(), 1);
+ QTRY_COMPARE(loadFinishedSpy.count(), 2);
QCOMPARE(iconUrlChangedSpy.count(), 0);
QCOMPARE(iconChangedSpy.count(), 0);
diff --git a/tests/auto/widgets/qwebenginehistory/tst_qwebenginehistory.cpp b/tests/auto/widgets/qwebenginehistory/tst_qwebenginehistory.cpp
index d9bbce173..7c8497fef 100644
--- a/tests/auto/widgets/qwebenginehistory/tst_qwebenginehistory.cpp
+++ b/tests/auto/widgets/qwebenginehistory/tst_qwebenginehistory.cpp
@@ -65,6 +65,7 @@ private Q_SLOTS:
void saveAndRestore_crash_2();
void saveAndRestore_crash_3();
void saveAndRestore_crash_4();
+ void saveAndRestore_InternalPage();
void popPushState_data();
void popPushState();
@@ -420,6 +421,26 @@ void tst_QWebEngineHistory::saveAndRestore_crash_4()
QTRY_COMPARE(loadFinishedSpy2.count(), 1);
}
+void tst_QWebEngineHistory::saveAndRestore_InternalPage()
+{
+ QWebEngineView view;
+ view.show();
+ QSignalSpy loadFinishedSpy(&view, &QWebEngineView::loadFinished);
+ view.load(QUrl("view-source:http://qt.io"));
+ QTRY_LOOP_IMPL((loadFinishedSpy.size() == 1), 30000, 200)
+ if (loadFinishedSpy.size() != 1 || !loadFinishedSpy.at(0).at(0).toBool())
+ QSKIP("Couldn't load page from network, skipping test.");
+
+ // get history
+ QByteArray data;
+ QDataStream stream1(&data, QIODevice::WriteOnly);
+ stream1 << *view.history();
+
+ // restore history - this should not crash. see QTBUG-57826
+ QDataStream stream2(data);
+ stream2 >> *view.history();
+}
+
void tst_QWebEngineHistory::popPushState_data()
{
QTest::addColumn<QString>("script");
diff --git a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
index b4b1abc8c..63569bd4b 100644
--- a/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
+++ b/tests/auto/widgets/qwebenginepage/tst_qwebenginepage.cpp
@@ -47,6 +47,7 @@
#include <qwebenginehistory.h>
#include <qwebenginepage.h>
#include <qwebengineprofile.h>
+#include <qwebenginequotapermissionrequest.h>
#include <qwebenginescript.h>
#include <qwebenginescriptcollection.h>
#include <qwebenginesettings.h>
@@ -165,6 +166,7 @@ private Q_SLOTS:
void runJavaScript();
void fullScreenRequested();
+ void quotaPermissionRequested();
// Tests from tst_QWebEngineFrame
@@ -3107,6 +3109,46 @@ void tst_QWebEnginePage::fullScreenRequested()
QVERIFY(watcher.wait());
}
+void tst_QWebEnginePage::quotaPermissionRequested()
+{
+ ConsolePage page;
+ QWebEngineView view;
+ view.setPage(&page);
+ QSignalSpy loadFinishedSpy(&page, SIGNAL(loadFinished(bool)));
+ page.load(QUrl("qrc:///resources/content.html"));
+ QVERIFY(loadFinishedSpy.wait());
+
+ connect(&page, &QWebEnginePage::quotaPermissionRequested,
+ [] (QWebEngineQuotaPermissionRequest request)
+ {
+ if (request.requestedSize() <= 5000)
+ request.accept();
+ else
+ request.reject();
+ });
+
+ evaluateJavaScriptSync(&page,
+ "navigator.webkitPersistentStorage.requestQuota(1024, function(grantedSize) {" \
+ "console.log(grantedSize);" \
+ "});");
+ QTRY_COMPARE(page.messages.count(), 1);
+ QTRY_COMPARE(page.messages[0], QString("1024"));
+
+ evaluateJavaScriptSync(&page,
+ "navigator.webkitPersistentStorage.requestQuota(6000, function(grantedSize) {" \
+ "console.log(grantedSize);" \
+ "});");
+ QTRY_COMPARE(page.messages.count(), 2);
+ QTRY_COMPARE(page.messages[1], QString("1024"));
+
+ evaluateJavaScriptSync(&page,
+ "navigator.webkitPersistentStorage.queryUsageAndQuota(function(usedBytes, grantedBytes) {" \
+ "console.log(usedBytes + ', ' + grantedBytes);" \
+ "});");
+ QTRY_COMPARE(page.messages.count(), 3);
+ QTRY_COMPARE(page.messages[2], QString("0, 1024"));
+}
+
void tst_QWebEnginePage::symmetricUrl()
{
QWebEngineView view;
diff --git a/tests/auto/widgets/qwebengineschemes/BLACKLIST b/tests/auto/widgets/qwebengineschemes/BLACKLIST
new file mode 100644
index 000000000..e69de29bb
--- /dev/null
+++ b/tests/auto/widgets/qwebengineschemes/BLACKLIST
diff --git a/tests/auto/widgets/qwebengineschemes/qwebengineschemes.pro b/tests/auto/widgets/qwebengineschemes/qwebengineschemes.pro
new file mode 100644
index 000000000..e56bbe8f7
--- /dev/null
+++ b/tests/auto/widgets/qwebengineschemes/qwebengineschemes.pro
@@ -0,0 +1,3 @@
+include(../tests.pri)
+exists($${TARGET}.qrc):RESOURCES += $${TARGET}.qrc
+QT *= core-private gui-private
diff --git a/tests/auto/widgets/qwebengineschemes/tst_qwebengineschemes.cpp b/tests/auto/widgets/qwebengineschemes/tst_qwebengineschemes.cpp
new file mode 100644
index 000000000..09d495ad5
--- /dev/null
+++ b/tests/auto/widgets/qwebengineschemes/tst_qwebengineschemes.cpp
@@ -0,0 +1,110 @@
+/****************************************************************************
+**
+** Copyright (C) 2017 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
+**
+** This file is part of the QtWebEngine module of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:GPL-EXCEPT$
+** Commercial License Usage
+** Licensees holding valid commercial Qt licenses may use this file in
+** accordance with the commercial license agreement provided with the
+** Software or, alternatively, in accordance with the terms contained in
+** a written agreement between you and The Qt Company. For licensing terms
+** and conditions see https://www.qt.io/terms-conditions. For further
+** information use the contact form at https://www.qt.io/contact-us.
+**
+** GNU General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU
+** General Public License version 3 as published by the Free Software
+** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
+** included in the packaging of this file. Please review the following
+** information to ensure the GNU General Public License requirements will
+** be met: https://www.gnu.org/licenses/gpl-3.0.html.
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <QtTest/QtTest>
+
+#include <qwebengineview.h>
+#include <qwebenginepage.h>
+#include <qwebengineprofile.h>
+#include <qwebenginesettings.h>
+
+class tst_QWebEngineSchemes : public QObject
+{
+ Q_OBJECT
+
+private Q_SLOTS:
+ void unknownUrlSchemePolicy();
+};
+
+class AcceptNavigationRequestHandler : public QWebEnginePage
+{
+public:
+ AcceptNavigationRequestHandler(QObject* parent = nullptr)
+ : QWebEnginePage(parent)
+ {
+ }
+ int acceptNavigationRequestCalls = 0;
+ bool acceptNavigationRequest(const QUrl &/*url*/, NavigationType /*type*/, bool /*isMainFrame*/) override
+ {
+ this->acceptNavigationRequestCalls++;
+ return false;
+ }
+};
+
+void tst_QWebEngineSchemes::unknownUrlSchemePolicy()
+{
+ QWebEngineView view;
+ AcceptNavigationRequestHandler page;
+ view.setPage(&page);
+ view.resize(400, 40);
+ view.show();
+ QTest::qWaitForWindowExposed(&view);
+ QWebEngineSettings *settings = view.page()->profile()->settings();
+ settings->setAttribute(QWebEngineSettings::FocusOnNavigationEnabled, true);
+ QSignalSpy loadFinishedSpy(&view, &QWebEngineView::loadFinished);
+
+ QWebEngineSettings::UnknownUrlSchemePolicy policies[6] = {QWebEngineSettings::DisallowUnknownUrlSchemes,
+ QWebEngineSettings::DisallowUnknownUrlSchemes,
+ QWebEngineSettings::AllowUnknownUrlSchemesFromUserInteraction,
+ QWebEngineSettings::AllowUnknownUrlSchemesFromUserInteraction,
+ QWebEngineSettings::AllowAllUnknownUrlSchemes,
+ QWebEngineSettings::AllowAllUnknownUrlSchemes};
+ // even iterations are for navigation-requests from javascript,
+ // odd iterations are for navigations-requests from user-interaction
+ for (int i = 0; i < 8; i++) {
+ if (i <= 5)
+ settings->setUnknownUrlSchemePolicy(policies[i]);
+ else
+ settings->resetUnknownUrlSchemePolicy();
+ loadFinishedSpy.clear();
+ page.acceptNavigationRequestCalls = 0;
+ bool shouldAccept;
+
+ if (i % 2 == 0) { // navigation request coming from javascript
+ shouldAccept = (4 <= i && i <= 5); // only case AllowAllUnknownUrlSchemes
+ view.setHtml("<html><script>setTimeout(function(){ window.location.href='nonexistentscheme://somewhere'; }, 10);</script><body>testing...</body></html>");
+ } else { // navigation request coming from user interaction
+ shouldAccept = (2 <= i); // all cases except DisallowUnknownUrlSchemes
+ view.setHtml("<html><body><a id='nonexlink' href='nonexistentscheme://somewhere'>nonexistentscheme://somewhere</a></body></html>");
+ QTRY_COMPARE_WITH_TIMEOUT(loadFinishedSpy.size(), 1, 30000);
+ // focus and trigger the link
+ view.page()->runJavaScript("document.getElementById('nonexlink').focus();", [&view](const QVariant &result) {
+ Q_UNUSED(result);
+ QTest::sendKeyEvent(QTest::Press, view.focusProxy(), Qt::Key_Return, QString("\r"), Qt::NoModifier);
+ QTest::sendKeyEvent(QTest::Release, view.focusProxy(), Qt::Key_Return, QString("\r"), Qt::NoModifier);
+ });
+ }
+
+ bool errorPageEnabled = settings->testAttribute(QWebEngineSettings::ErrorPageEnabled);
+ QTRY_COMPARE_WITH_TIMEOUT(loadFinishedSpy.size(), 2 + (errorPageEnabled ? 1 : 0), 30000);
+ QCOMPARE(page.acceptNavigationRequestCalls, shouldAccept ? 1 : 0);
+ }
+}
+
+QTEST_MAIN(tst_QWebEngineSchemes)
+#include "tst_qwebengineschemes.moc"
diff --git a/tests/auto/widgets/widgets.pro b/tests/auto/widgets/widgets.pro
index 60e5cc11f..e007df711 100644
--- a/tests/auto/widgets/widgets.pro
+++ b/tests/auto/widgets/widgets.pro
@@ -13,6 +13,7 @@ SUBDIRS += \
qwebenginehistoryinterface \
qwebengineinspector \
qwebengineprofile \
+ qwebengineschemes \
qwebenginescript \
qwebenginesettings \
qwebengineview
@@ -28,5 +29,6 @@ qtConfig(spellchecker):!cross_compile {
# QTBUG-60268
boot2qt: SUBDIRS -= qwebengineaccessibility qwebenginedefaultsurfaceformat \
qwebenginefaviconmanager qwebenginepage qwebenginehistory \
- qwebengineprofile qwebenginescript qwebengineview \
- qwebenginedownloads
+ qwebengineprofile qwebengineschemes qwebenginescript \
+ qwebengineview qwebenginedownloads
+