summaryrefslogtreecommitdiffstats
path: root/src/webengine/api
diff options
context:
space:
mode:
Diffstat (limited to 'src/webengine/api')
-rw-r--r--src/webengine/api/qquickwebengineview.cpp26
-rw-r--r--src/webengine/api/qquickwebengineview_p_p.h1
2 files changed, 27 insertions, 0 deletions
diff --git a/src/webengine/api/qquickwebengineview.cpp b/src/webengine/api/qquickwebengineview.cpp
index 352c3dcf2..e9c5232ab 100644
--- a/src/webengine/api/qquickwebengineview.cpp
+++ b/src/webengine/api/qquickwebengineview.cpp
@@ -52,6 +52,8 @@
#include "ui_delegates_manager.h"
#include "web_contents_adapter.h"
#include "web_engine_error.h"
+#include "web_engine_settings.h"
+#include "web_engine_visited_links_manager.h"
#include <QGuiApplication>
#include <QQmlComponent>
@@ -396,6 +398,30 @@ QObject *QQuickWebEngineViewPrivate::accessibilityParentObject()
return q;
}
+namespace {
+class DummySettingsDelegate : public WebEngineSettingsDelegate {
+public:
+ DummySettingsDelegate()
+ : settings(0) {}
+ void apply() { }
+ WebEngineSettings* fallbackSettings() const { return settings; }
+ WebEngineSettings *settings;
+};
+
+}// anonymous namespace
+
+WebEngineSettings *QQuickWebEngineViewPrivate::webEngineSettings() const
+{
+ static WebEngineSettings *dummySettings = 0;
+ if (!dummySettings) {
+ DummySettingsDelegate *dummyDelegate = new DummySettingsDelegate;
+ dummySettings = new WebEngineSettings(dummyDelegate);
+ dummyDelegate->settings = dummySettings;
+ dummySettings->initDefaults();
+ }
+ return dummySettings;
+}
+
void QQuickWebEngineViewPrivate::setDevicePixelRatio(qreal devicePixelRatio)
{
Q_Q(QQuickWebEngineView);
diff --git a/src/webengine/api/qquickwebengineview_p_p.h b/src/webengine/api/qquickwebengineview_p_p.h
index 831e91a0b..332d9e280 100644
--- a/src/webengine/api/qquickwebengineview_p_p.h
+++ b/src/webengine/api/qquickwebengineview_p_p.h
@@ -179,6 +179,7 @@ public:
virtual void authenticationRequired(const QUrl&, const QString&, bool, const QString&, QString*, QString*) Q_DECL_OVERRIDE { }
virtual void runMediaAccessPermissionRequest(const QUrl &securityOrigin, MediaRequestFlags requestFlags) Q_DECL_OVERRIDE;
virtual QObject *accessibilityParentObject() Q_DECL_OVERRIDE;
+ virtual WebEngineSettings *webEngineSettings() const Q_DECL_OVERRIDE;
void setDevicePixelRatio(qreal);
void adoptWebContents(WebContentsAdapter *webContents);