diff options
Diffstat (limited to 'src/webengine/api/qquickwebengineprofile.cpp')
-rw-r--r-- | src/webengine/api/qquickwebengineprofile.cpp | 39 |
1 files changed, 36 insertions, 3 deletions
diff --git a/src/webengine/api/qquickwebengineprofile.cpp b/src/webengine/api/qquickwebengineprofile.cpp index 68884f967..a678fe5fa 100644 --- a/src/webengine/api/qquickwebengineprofile.cpp +++ b/src/webengine/api/qquickwebengineprofile.cpp @@ -40,6 +40,7 @@ #include "qquickwebenginedownloaditem_p_p.h" #include "qquickwebengineprofile_p_p.h" #include "qquickwebenginesettings_p.h" +#include "qwebenginecookiestoreclient.h" #include <QQmlEngine> @@ -56,6 +57,9 @@ QQuickWebEngineProfilePrivate::QQuickWebEngineProfilePrivate(BrowserContextAdapt { m_browserContextRef->addClient(this); m_settings->d_ptr->initDefaults(browserContext->isOffTheRecord()); + // Fullscreen API was implemented before the supported setting, so we must + // make it default true to avoid change in default API behavior. + m_settings->d_ptr->setAttribute(QtWebEngineCore::WebEngineSettings::FullScreenSupportEnabled, true); } QQuickWebEngineProfilePrivate::~QQuickWebEngineProfilePrivate() @@ -131,10 +135,11 @@ void QQuickWebEngineProfilePrivate::downloadUpdated(const DownloadItemInfo &info \instantiates QQuickWebEngineProfile \inqmlmodule QtWebEngine 1.1 \since QtWebEngine 1.1 - \brief Contains common settings for multiple web engine views. + \brief Contains settings, scripts, and visited links common to multiple web engine views. - Contains settings and history shared by all the web engine views that belong - to the profile. + WebEngineProfile contains settings, scripts, and the list of visited links shared by all + views that belong to the profile. As such, profiles can be used to isolate views + from each other. A typical use case is a dedicated profile for a 'private browsing' mode. Each web engine view has an associated profile. Views that do not have a specific profile set share a common default one. @@ -384,6 +389,28 @@ void QQuickWebEngineProfile::setHttpCacheMaximumSize(int maximumSize) emit httpCacheMaximumSizeChanged(); } +/*! + \qmlproperty QString WebEngineProfile::httpAcceptLanguage + + The value of the Accept-Language HTTP request-header field. + + \since QtWebEngine 1.2 +*/ +QString QQuickWebEngineProfile::httpAcceptLanguage() const +{ + Q_D(const QQuickWebEngineProfile); + return d->browserContext()->httpAcceptLanguage(); +} + +void QQuickWebEngineProfile::setHttpAcceptLanguage(const QString &httpAcceptLanguage) +{ + Q_D(QQuickWebEngineProfile); + if (d->browserContext()->httpAcceptLanguage() == httpAcceptLanguage) + return; + d->browserContext()->setHttpAcceptLanguage(httpAcceptLanguage); + emit httpAcceptLanguageChanged(); +} + QQuickWebEngineProfile *QQuickWebEngineProfile::defaultProfile() { static QQuickWebEngineProfile *profile = new QQuickWebEngineProfile( @@ -392,6 +419,12 @@ QQuickWebEngineProfile *QQuickWebEngineProfile::defaultProfile() return profile; } +QWebEngineCookieStoreClient *QQuickWebEngineProfile::cookieStoreClient() const +{ + const Q_D(QQuickWebEngineProfile); + return d->browserContext()->cookieStoreClient(); +} + QQuickWebEngineSettings *QQuickWebEngineProfile::settings() const { const Q_D(QQuickWebEngineProfile); |