summaryrefslogtreecommitdiffstats
path: root/src/webengine/api
diff options
context:
space:
mode:
Diffstat (limited to 'src/webengine/api')
-rw-r--r--src/webengine/api/qquickwebenginecertificateerror.cpp28
-rw-r--r--src/webengine/api/qquickwebenginecertificateerror_p.h26
-rw-r--r--src/webengine/api/qquickwebenginecontextmenudata.cpp209
-rw-r--r--src/webengine/api/qquickwebenginecontextmenudata_p.h132
-rw-r--r--src/webengine/api/qquickwebenginedownloaditem.cpp59
-rw-r--r--src/webengine/api/qquickwebenginedownloaditem_p.h37
-rw-r--r--src/webengine/api/qquickwebenginedownloaditem_p_p.h26
-rw-r--r--src/webengine/api/qquickwebenginefaviconprovider.cpp187
-rw-r--r--src/webengine/api/qquickwebenginefaviconprovider_p_p.h87
-rw-r--r--src/webengine/api/qquickwebenginehistory.cpp44
-rw-r--r--src/webengine/api/qquickwebenginehistory_p.h26
-rw-r--r--src/webengine/api/qquickwebenginehistory_p_p.h25
-rw-r--r--src/webengine/api/qquickwebengineloadrequest.cpp25
-rw-r--r--src/webengine/api/qquickwebengineloadrequest_p.h25
-rw-r--r--src/webengine/api/qquickwebenginenavigationrequest.cpp25
-rw-r--r--src/webengine/api/qquickwebenginenavigationrequest_p.h25
-rw-r--r--src/webengine/api/qquickwebenginenewviewrequest.cpp25
-rw-r--r--src/webengine/api/qquickwebenginenewviewrequest_p.h25
-rw-r--r--src/webengine/api/qquickwebengineprofile.cpp66
-rw-r--r--src/webengine/api/qquickwebengineprofile.h31
-rw-r--r--src/webengine/api/qquickwebengineprofile_p.h25
-rw-r--r--src/webengine/api/qquickwebenginescript.cpp33
-rw-r--r--src/webengine/api/qquickwebenginescript_p.h25
-rw-r--r--src/webengine/api/qquickwebenginescript_p_p.h31
-rw-r--r--src/webengine/api/qquickwebenginesettings.cpp131
-rw-r--r--src/webengine/api/qquickwebenginesettings_p.h51
-rw-r--r--src/webengine/api/qquickwebenginesingleton.cpp25
-rw-r--r--src/webengine/api/qquickwebenginesingleton_p.h25
-rw-r--r--src/webengine/api/qquickwebenginetestsupport.cpp25
-rw-r--r--src/webengine/api/qquickwebenginetestsupport_p.h25
-rw-r--r--src/webengine/api/qquickwebengineview.cpp385
-rw-r--r--src/webengine/api/qquickwebengineview_p.h219
-rw-r--r--src/webengine/api/qquickwebengineview_p_p.h45
-rw-r--r--src/webengine/api/qtwebengineglobal.cpp25
-rw-r--r--src/webengine/api/qtwebengineglobal.h25
-rw-r--r--src/webengine/api/qtwebengineglobal_p.h25
36 files changed, 1808 insertions, 445 deletions
diff --git a/src/webengine/api/qquickwebenginecertificateerror.cpp b/src/webengine/api/qquickwebenginecertificateerror.cpp
index ceb5842bd..51a942abe 100644
--- a/src/webengine/api/qquickwebenginecertificateerror.cpp
+++ b/src/webengine/api/qquickwebenginecertificateerror.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** 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 http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** 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.LGPLv3 included in the
+** 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.html.
+** 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 later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** 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$
**
@@ -189,6 +192,9 @@ QUrl QQuickWebEngineCertificateError::url() const
\value WebEngineCertificateError.CertificateNameConstraintViolation
The certificate claimed DNS names that are in violation of name
constraints.
+ \value WebEngineCertificateError.CertificateValidityTooLong
+ The certificate has a validity period that is too long.
+ (Added in 5.7)
*/
QQuickWebEngineCertificateError::Error QQuickWebEngineCertificateError::error() const
{
diff --git a/src/webengine/api/qquickwebenginecertificateerror_p.h b/src/webengine/api/qquickwebenginecertificateerror_p.h
index 7deeac932..d04dc2c62 100644
--- a/src/webengine/api/qquickwebenginecertificateerror_p.h
+++ b/src/webengine/api/qquickwebenginecertificateerror_p.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** 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 http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** 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.LGPLv3 included in the
+** 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.html.
+** 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 later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** 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$
**
@@ -80,6 +83,7 @@ public:
CertificateNonUniqueName = -210,
CertificateWeakKey = -211,
CertificateNameConstraintViolation = -212,
+ CertificateValidityTooLong = -213,
};
Q_ENUM(Error)
diff --git a/src/webengine/api/qquickwebenginecontextmenudata.cpp b/src/webengine/api/qquickwebenginecontextmenudata.cpp
new file mode 100644
index 000000000..2cc6eaf4b
--- /dev/null
+++ b/src/webengine/api/qquickwebenginecontextmenudata.cpp
@@ -0,0 +1,209 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 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 "qquickwebenginecontextmenudata_p.h"
+
+#include "web_contents_adapter_client.h"
+
+QT_BEGIN_NAMESPACE
+
+ASSERT_ENUMS_MATCH(QtWebEngineCore::WebEngineContextMenuData::MediaTypeNone, QQuickWebEngineContextMenuData::MediaTypeNone)
+ASSERT_ENUMS_MATCH(QtWebEngineCore::WebEngineContextMenuData::MediaTypeImage, QQuickWebEngineContextMenuData::MediaTypeImage)
+ASSERT_ENUMS_MATCH(QtWebEngineCore::WebEngineContextMenuData::MediaTypeAudio, QQuickWebEngineContextMenuData::MediaTypeAudio)
+ASSERT_ENUMS_MATCH(QtWebEngineCore::WebEngineContextMenuData::MediaTypeVideo, QQuickWebEngineContextMenuData::MediaTypeVideo)
+ASSERT_ENUMS_MATCH(QtWebEngineCore::WebEngineContextMenuData::MediaTypeCanvas, QQuickWebEngineContextMenuData::MediaTypeCanvas)
+ASSERT_ENUMS_MATCH(QtWebEngineCore::WebEngineContextMenuData::MediaTypeFile, QQuickWebEngineContextMenuData::MediaTypeFile)
+ASSERT_ENUMS_MATCH(QtWebEngineCore::WebEngineContextMenuData::MediaTypePlugin, QQuickWebEngineContextMenuData::MediaTypePlugin)
+
+/*!
+ \qmltype WebEngineContextMenuData
+ \instantiates QQuickWebEngineContextMenuData
+ \inqmlmodule QtWebEngine
+ \since QtWebEngine 1.3
+ \brief Provides context data for populating or extending a context menu with actions.
+
+
+ WebEngineContextMenuData is returned by WebEngineView::contextMenuData() after a context menu event,
+ and contains information about where the context menu event took place. This is also in the context
+ in which any context specific WebEngineView::WebAction will be performed.
+*/
+
+QQuickWebEngineContextMenuData::QQuickWebEngineContextMenuData() : d(nullptr)
+{
+}
+
+QQuickWebEngineContextMenuData::~QQuickWebEngineContextMenuData()
+{
+ delete d;
+}
+
+/*!
+ \qmlproperty bool WebEngineContextMenuData::isValid
+
+ Is \c true if the context data is valid; otherwise \c false.
+*/
+bool QQuickWebEngineContextMenuData::isValid() const
+{
+ return d;
+}
+
+/*!
+ \qmlproperty point WebEngineContextMenuData::position
+
+
+ Returns the position of the context, usually the mouse position where the context menu event was triggered.
+*/
+QPoint QQuickWebEngineContextMenuData::position() const
+{
+ return d ? d->pos : QPoint();
+}
+
+/*!
+ \qmlproperty string WebEngineContextMenuData::linkText
+
+ Returns the text of a link if the context is a link.
+*/
+QString QQuickWebEngineContextMenuData::linkText() const
+{
+ return d ? d->linkText : QString();
+}
+
+/*!
+ \qmlproperty url WebEngineContextMenuData::linkUrl
+
+ Returns the URL of a link if the context is a link.
+*/
+QUrl QQuickWebEngineContextMenuData::linkUrl() const
+{
+ return d ? d->linkUrl : QUrl();
+}
+
+/*!
+ \qmlproperty string WebEngineContextMenuData::selectedText
+
+ Returns the selected text of the context.
+*/
+QString QQuickWebEngineContextMenuData::selectedText() const
+{
+ return d ? d->selectedText : QString();
+}
+
+/*!
+ \qmlproperty url WebEngineContextMenuData::mediaUrl
+
+ If the context is a media element, returns the URL of that media.
+*/
+QUrl QQuickWebEngineContextMenuData::mediaUrl() const
+{
+ return d ? d->mediaUrl : QUrl();
+}
+
+/*!
+ \qmlproperty enumeration WebEngineContextMenuData::mediaType
+
+ Returns the type of the media element or \c MediaTypeNone if the context is not a media element.
+
+ \value WebEngineContextMenuData.MediaTypeNone
+ The context is not a media element.
+ \value WebEngineContextMenuData.MediaTypeImage
+ The context is an image element
+ \value WebEngineContextMenuData.MediaTypeVideo
+ The context is a video element
+ \value WebEngineContextMenuData.MediaTypeAudio
+ The context is an audio element
+ \value WebEngineContextMenuData.MediaTypeCanvas
+ The context is a canvas element
+ \value WebEngineContextMenuData.MediaTypeFile
+ The context is a file
+ \value WebEngineContextMenuData.MediaTypePlugin
+ The context is a plugin
+*/
+
+QQuickWebEngineContextMenuData::MediaType QQuickWebEngineContextMenuData::mediaType() const
+{
+ return d ? static_cast<QQuickWebEngineContextMenuData::MediaType>(d->mediaType) : MediaTypeNone;
+}
+
+/*!
+ \qmlproperty bool WebEngineContextMenuData::isContentEditable
+
+ Returns \c true if the content is editable by the user; otherwise returns \c false.
+*/
+bool QQuickWebEngineContextMenuData::isContentEditable() const
+{
+ return d ? d->isEditable : false;
+}
+
+void QQuickWebEngineContextMenuData::update(const QtWebEngineCore::WebEngineContextMenuData &update)
+{
+ const QQuickWebEngineContextMenuData old(d);
+ d = new QtWebEngineCore::WebEngineContextMenuData(update);
+
+ if (isValid() != old.isValid())
+ Q_EMIT isValidChanged();
+
+ if (position() != old.position())
+ Q_EMIT positionChanged();
+
+ if (selectedText() != old.selectedText())
+ Q_EMIT selectedTextChanged();
+
+ if (linkText() != old.linkText())
+ Q_EMIT linkTextChanged();
+
+ if (linkUrl() != old.linkUrl())
+ Q_EMIT linkUrlChanged();
+
+ if (mediaUrl() != old.mediaUrl())
+ Q_EMIT mediaUrlChanged();
+
+ if (mediaType() != old.mediaType())
+ Q_EMIT mediaTypeChanged();
+
+ if (isContentEditable() != old.isContentEditable())
+ Q_EMIT isContentEditableChanged();
+}
+
+QQuickWebEngineContextMenuData::QQuickWebEngineContextMenuData(const QQuickWebEngineContextMenuDataPrivate *p, QObject *parent)
+ : QObject(parent)
+ , d(p)
+{
+}
+
+QT_END_NAMESPACE
diff --git a/src/webengine/api/qquickwebenginecontextmenudata_p.h b/src/webengine/api/qquickwebenginecontextmenudata_p.h
new file mode 100644
index 000000000..aa081cbe6
--- /dev/null
+++ b/src/webengine/api/qquickwebenginecontextmenudata_p.h
@@ -0,0 +1,132 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 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 QQUICKWEBENGINECONTEXTMENUDATA_P_H
+#define QQUICKWEBENGINECONTEXTMENUDATA_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <private/qtwebengineglobal_p.h>
+#include <QtCore/QObject>
+#include <QtCore/QPoint>
+#include <QtCore/QString>
+#include <QtCore/QUrl>
+#include <QtQuick/QQuickItem>
+
+namespace QtWebEngineCore {
+class WebEngineContextMenuData;
+}
+
+QT_BEGIN_NAMESPACE
+
+class QQuickWebEngineView;
+class QQuickWebEngineViewPrivate;
+
+class Q_WEBENGINE_PRIVATE_EXPORT QQuickWebEngineContextMenuData : public QObject {
+ Q_OBJECT
+public:
+ QQuickWebEngineContextMenuData();
+ ~QQuickWebEngineContextMenuData();
+
+ enum MediaType {
+ MediaTypeNone,
+ MediaTypeImage,
+ MediaTypeVideo,
+ MediaTypeAudio,
+ MediaTypeCanvas,
+ MediaTypeFile,
+ MediaTypePlugin
+ };
+ Q_ENUM(MediaType)
+
+ Q_PROPERTY(bool isValid READ isValid NOTIFY isValidChanged)
+ Q_PROPERTY(QPoint position READ position NOTIFY positionChanged)
+ Q_PROPERTY(QString selectedText READ selectedText NOTIFY selectedTextChanged)
+ Q_PROPERTY(QString linkText READ linkText NOTIFY linkTextChanged)
+ Q_PROPERTY(QUrl linkUrl READ linkUrl NOTIFY linkUrlChanged)
+ Q_PROPERTY(QUrl mediaUrl READ mediaUrl NOTIFY mediaUrlChanged)
+ Q_PROPERTY(MediaType mediaType READ mediaType NOTIFY mediaTypeChanged)
+ Q_PROPERTY(bool isContentEditable READ isContentEditable NOTIFY isContentEditableChanged)
+
+ bool isValid() const;
+
+ QPoint position() const;
+ QString selectedText() const;
+ QString linkText() const;
+ QUrl linkUrl() const;
+ QUrl mediaUrl() const;
+ MediaType mediaType() const;
+ bool isContentEditable() const;
+
+Q_SIGNALS:
+ void isValidChanged();
+ void positionChanged();
+ void selectedTextChanged();
+ void linkTextChanged();
+ void linkUrlChanged();
+ void mediaUrlChanged();
+ void mediaTypeChanged();
+ void isContentEditableChanged();
+
+private:
+ void update(const QtWebEngineCore::WebEngineContextMenuData &update);
+
+ friend class QQuickWebEngineView;
+ friend class QQuickWebEngineViewPrivate;
+ Q_DISABLE_COPY(QQuickWebEngineContextMenuData)
+ typedef QtWebEngineCore::WebEngineContextMenuData QQuickWebEngineContextMenuDataPrivate;
+ QQuickWebEngineContextMenuData(const QQuickWebEngineContextMenuDataPrivate *priv, QObject *parent = 0);
+ QQuickWebEngineContextMenuData &operator=(const QQuickWebEngineContextMenuDataPrivate *priv);
+ const QQuickWebEngineContextMenuDataPrivate *d;
+};
+
+QT_END_NAMESPACE
+
+QML_DECLARE_TYPE(const QQuickWebEngineContextMenuData);
+
+#endif // QQUICKWEBENGINECONTEXTMENUDATA_P_H
diff --git a/src/webengine/api/qquickwebenginedownloaditem.cpp b/src/webengine/api/qquickwebenginedownloaditem.cpp
index 08a8f15e9..9f0c747f9 100644
--- a/src/webengine/api/qquickwebenginedownloaditem.cpp
+++ b/src/webengine/api/qquickwebenginedownloaditem.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** 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 http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** 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.LGPLv3 included in the
+** 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.html.
+** 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 later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** 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$
**
@@ -62,6 +65,7 @@ QQuickWebEngineDownloadItemPrivate::QQuickWebEngineDownloadItemPrivate(QQuickWeb
: profile(p)
, downloadId(-1)
, downloadState(QQuickWebEngineDownloadItem::DownloadCancelled)
+ , savePageFormat(QQuickWebEngineDownloadItem::UnknownSaveFormat)
, totalBytes(-1)
, receivedBytes(0)
{
@@ -262,6 +266,39 @@ void QQuickWebEngineDownloadItem::setPath(QString path)
}
}
+/*!
+ \qmlproperty enumeration WebEngineDownloadItem::savePageFormat
+ \since QtWebEngine 1.3
+
+ Describes the format that is used to save a web page.
+
+ \value WebEngineDownloadItem.UnknownSaveFormat
+ This is not a request for downloading a complete web page.
+ \value WebEngineDownloadItem.SingleHtmlSaveFormat
+ The page is saved as a single HTML page. Resources such as images
+ are not saved.
+ \value WebEngineDownloadItem.CompleteHtmlSaveFormat
+ The page is saved as a complete HTML page, for example a directory
+ containing the single HTML page and the resources.
+ \value WebEngineDownloadItem.MimeHtmlSaveFormat
+ The page is saved as a complete web page in the MIME HTML format.
+*/
+
+QQuickWebEngineDownloadItem::SavePageFormat QQuickWebEngineDownloadItem::savePageFormat() const
+{
+ Q_D(const QQuickWebEngineDownloadItem);
+ return d->savePageFormat;
+}
+
+void QQuickWebEngineDownloadItem::setSavePageFormat(QQuickWebEngineDownloadItem::SavePageFormat format)
+{
+ Q_D(QQuickWebEngineDownloadItem);
+ if (d->savePageFormat != format) {
+ d->savePageFormat = format;
+ Q_EMIT savePageFormatChanged();
+ }
+}
+
QQuickWebEngineDownloadItem::QQuickWebEngineDownloadItem(QQuickWebEngineDownloadItemPrivate *p, QObject *parent)
: QObject(parent)
, d_ptr(p)
diff --git a/src/webengine/api/qquickwebenginedownloaditem_p.h b/src/webengine/api/qquickwebenginedownloaditem_p.h
index a7f60199b..0b01fe6fc 100644
--- a/src/webengine/api/qquickwebenginedownloaditem_p.h
+++ b/src/webengine/api/qquickwebenginedownloaditem_p.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** 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 http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** 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.LGPLv3 included in the
+** 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.html.
+** 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 later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** 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$
**
@@ -71,8 +74,17 @@ public:
};
Q_ENUM(DownloadState)
+ enum SavePageFormat {
+ UnknownSaveFormat = -1,
+ SingleHtmlSaveFormat,
+ CompleteHtmlSaveFormat,
+ MimeHtmlSaveFormat
+ };
+ Q_ENUM(SavePageFormat)
+
Q_PROPERTY(quint32 id READ id CONSTANT FINAL)
Q_PROPERTY(DownloadState state READ state NOTIFY stateChanged)
+ Q_PROPERTY(SavePageFormat savePageFormat READ savePageFormat WRITE setSavePageFormat NOTIFY savePageFormatChanged REVISION 2 FINAL)
Q_PROPERTY(qint64 totalBytes READ totalBytes NOTIFY totalBytesChanged)
Q_PROPERTY(qint64 receivedBytes READ receivedBytes NOTIFY receivedBytesChanged)
Q_PROPERTY(QString mimeType READ mimeType NOTIFY mimeTypeChanged REVISION 1)
@@ -88,9 +100,12 @@ public:
QString mimeType() const;
QString path() const;
void setPath(QString path);
+ SavePageFormat savePageFormat() const;
+ void setSavePageFormat(SavePageFormat format);
Q_SIGNALS:
void stateChanged();
+ Q_REVISION(2) void savePageFormatChanged();
void receivedBytesChanged();
void totalBytesChanged();
Q_REVISION(1) void mimeTypeChanged();
diff --git a/src/webengine/api/qquickwebenginedownloaditem_p_p.h b/src/webengine/api/qquickwebenginedownloaditem_p_p.h
index 8e502c736..bdae54ca4 100644
--- a/src/webengine/api/qquickwebenginedownloaditem_p_p.h
+++ b/src/webengine/api/qquickwebenginedownloaditem_p_p.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** 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 http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** 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.LGPLv3 included in the
+** 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.html.
+** 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 later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** 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$
**
@@ -69,6 +72,7 @@ public:
quint32 downloadId;
QQuickWebEngineDownloadItem::DownloadState downloadState;
+ QQuickWebEngineDownloadItem::SavePageFormat savePageFormat;
qint64 totalBytes;
qint64 receivedBytes;
QString mimeType;
diff --git a/src/webengine/api/qquickwebenginefaviconprovider.cpp b/src/webengine/api/qquickwebenginefaviconprovider.cpp
new file mode 100644
index 000000000..fe8436d6c
--- /dev/null
+++ b/src/webengine/api/qquickwebenginefaviconprovider.cpp
@@ -0,0 +1,187 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 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 "qquickwebenginefaviconprovider_p_p.h"
+
+#include "favicon_manager.h"
+#include "qquickwebengineview_p.h"
+#include "qquickwebengineview_p_p.h"
+#include "web_contents_adapter.h"
+
+#include <QtGui/QIcon>
+#include <QtGui/QPixmap>
+
+QT_BEGIN_NAMESPACE
+
+using QtWebEngineCore::FaviconInfo;
+using QtWebEngineCore::FaviconManager;
+
+static inline unsigned area(const QSize &size)
+{
+ return size.width() * size.height();
+}
+
+QString QQuickWebEngineFaviconProvider::identifier()
+{
+ return QStringLiteral("favicon");
+}
+
+QUrl QQuickWebEngineFaviconProvider::faviconProviderUrl(const QUrl &url)
+{
+ if (url.isEmpty())
+ return url;
+
+ QUrl providerUrl;
+ providerUrl.setScheme(QStringLiteral("image"));
+ providerUrl.setHost(identifier());
+ providerUrl.setPath(QStringLiteral("/%1").arg(url.toString()));
+
+ return providerUrl;
+}
+
+QQuickWebEngineFaviconProvider::QQuickWebEngineFaviconProvider()
+ : QQuickImageProvider(QQuickImageProvider::Pixmap)
+ , m_latestView(0)
+{
+}
+
+QQuickWebEngineFaviconProvider::~QQuickWebEngineFaviconProvider()
+{
+ qDeleteAll(m_iconUrlMap);
+}
+
+QUrl QQuickWebEngineFaviconProvider::attach(QQuickWebEngineView *view, const QUrl &iconUrl)
+{
+ if (iconUrl.isEmpty())
+ return QUrl();
+
+ m_latestView = view;
+
+ if (!m_iconUrlMap.contains(view))
+ m_iconUrlMap.insert(view, new QList<QUrl>());
+
+ QList<QUrl> *iconUrls = m_iconUrlMap[view];
+ if (!iconUrls->contains(iconUrl))
+ iconUrls->append(iconUrl);
+
+ return faviconProviderUrl(iconUrl);
+}
+
+void QQuickWebEngineFaviconProvider::detach(QQuickWebEngineView *view)
+{
+ QList<QUrl> *iconUrls = m_iconUrlMap.take(view);
+ delete iconUrls;
+}
+
+QPixmap QQuickWebEngineFaviconProvider::requestPixmap(const QString &id, QSize *size, const QSize &requestedSize)
+{
+ Q_UNUSED(size);
+ Q_UNUSED(requestedSize);
+
+ QUrl iconUrl(id);
+ QQuickWebEngineView *view = viewForIconUrl(iconUrl);
+
+ if (!view || iconUrl.isEmpty())
+ return QPixmap();
+
+ FaviconManager *faviconManager = view->d_ptr->adapter->faviconManager();
+
+ Q_ASSERT(faviconManager);
+ const FaviconInfo &faviconInfo = faviconManager->getFaviconInfo(iconUrl);
+ const QIcon &icon = faviconManager->getIcon(faviconInfo.candidate ? QUrl() : iconUrl);
+
+ Q_ASSERT(!icon.isNull());
+ const QSize &bestSize = faviconInfo.size;
+
+ // If source size is not specified, use the best quality
+ if (!requestedSize.isValid()) {
+ if (size)
+ *size = bestSize;
+
+ return icon.pixmap(bestSize).copy();
+ }
+
+ const QSize &fitSize = findFitSize(icon.availableSizes(), requestedSize, bestSize);
+ const QPixmap &iconPixmap = icon.pixmap(fitSize);
+
+ if (size)
+ *size = iconPixmap.size();
+
+ return iconPixmap.scaled(requestedSize, Qt::KeepAspectRatio, Qt::SmoothTransformation).copy();
+}
+
+QQuickWebEngineView *QQuickWebEngineFaviconProvider::viewForIconUrl(const QUrl &iconUrl) const
+{
+ // The most common use case is that the requested iconUrl belongs to the
+ // latest WebEngineView which was raised an iconChanged signal.
+ if (m_latestView) {
+ QList<QUrl> *iconUrls = m_iconUrlMap[m_latestView];
+ if (iconUrls->contains(iconUrl))
+ return m_latestView;
+ }
+
+ for (auto it = m_iconUrlMap.cbegin(), end = m_iconUrlMap.cend(); it != end; ++it) {
+ if (it.value()->contains(iconUrl))
+ return it.key();
+ }
+
+ return 0;
+}
+
+QSize QQuickWebEngineFaviconProvider::findFitSize(const QList<QSize> &availableSizes,
+ const QSize &requestedSize,
+ const QSize &bestSize) const
+{
+ Q_ASSERT(availableSizes.count());
+ if (availableSizes.count() == 1 || area(requestedSize) >= area(bestSize))
+ return bestSize;
+
+ QSize fitSize = bestSize;
+ for (const QSize &size : availableSizes) {
+ if (area(size) == area(requestedSize))
+ return size;
+
+ if (area(requestedSize) < area(size) && area(size) < area(fitSize))
+ fitSize = size;
+ }
+
+ return fitSize;
+}
+
+QT_END_NAMESPACE
diff --git a/src/webengine/api/qquickwebenginefaviconprovider_p_p.h b/src/webengine/api/qquickwebenginefaviconprovider_p_p.h
new file mode 100644
index 000000000..52f3fb7a9
--- /dev/null
+++ b/src/webengine/api/qquickwebenginefaviconprovider_p_p.h
@@ -0,0 +1,87 @@
+/****************************************************************************
+**
+** Copyright (C) 2016 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 QQUICKWEBENGINEFAVICONPROVIDER_P_P_H
+#define QQUICKWEBENGINEFAVICONPROVIDER_P_P_H
+
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
+#include <private/qtwebengineglobal_p.h>
+#include <QtQuick/QQuickImageProvider>
+
+#include <QtCore/QMap>
+
+QT_BEGIN_NAMESPACE
+
+class QQuickWebEngineView;
+
+class Q_WEBENGINE_PRIVATE_EXPORT QQuickWebEngineFaviconProvider : public QQuickImageProvider {
+public:
+ static QString identifier();
+ static QUrl faviconProviderUrl(const QUrl &);
+
+ QQuickWebEngineFaviconProvider();
+ ~QQuickWebEngineFaviconProvider();
+
+ QUrl attach(QQuickWebEngineView *, const QUrl &);
+ void detach(QQuickWebEngineView *);
+
+
+ virtual QPixmap requestPixmap(const QString &, QSize *, const QSize &);
+
+private:
+ QQuickWebEngineView *viewForIconUrl(const QUrl &) const;
+ QSize findFitSize(const QList<QSize> &, const QSize &, const QSize &) const;
+
+ QMap<QQuickWebEngineView *, QList<QUrl> *> m_iconUrlMap;
+ QQuickWebEngineView *m_latestView;
+};
+
+QT_END_NAMESPACE
+
+#endif // QQUICKWEBENGINEFAVICONPROVIDER_P_P_H
diff --git a/src/webengine/api/qquickwebenginehistory.cpp b/src/webengine/api/qquickwebenginehistory.cpp
index b6be54b4c..970bfb22d 100644
--- a/src/webengine/api/qquickwebenginehistory.cpp
+++ b/src/webengine/api/qquickwebenginehistory.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** 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 http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** 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.LGPLv3 included in the
+** 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.html.
+** 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 later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** 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$
**
@@ -36,6 +39,8 @@
#include "qquickwebenginehistory_p.h"
#include "qquickwebenginehistory_p_p.h"
+
+#include "qquickwebenginefaviconprovider_p_p.h"
#include "qquickwebengineloadrequest_p.h"
#include "qquickwebengineview_p_p.h"
#include "web_contents_adapter.h"
@@ -130,8 +135,9 @@ int QQuickWebEngineForwardHistoryListModelPrivate::offsetForIndex(int index) con
\brief A data model that represents the history of a web engine page.
- The WebEngineHistoryListModel type exposes the \e title, \e url, and \e offset roles. The
- \e title and \e url specify the title and URL of the visited page. The \e offset specifies
+ The WebEngineHistoryListModel type exposes the \e title, \e url, \e icon, and \e offset roles.
+ The \e title, \e url and \e icon specify the title, URL, and favicon of the visited page.
+ The \e offset specifies
the position of the page in respect to the current page (0). A positive number indicates that
the page was visited after the current page, whereas a negative number indicates that the page
was visited before the current page.
@@ -163,6 +169,7 @@ QHash<int, QByteArray> QQuickWebEngineHistoryListModel::roleNames() const
roles[QQuickWebEngineHistory::UrlRole] = "url";
roles[QQuickWebEngineHistory::TitleRole] = "title";
roles[QQuickWebEngineHistory::OffsetRole] = "offset";
+ roles[QQuickWebEngineHistory::IconUrlRole] = "icon";
return roles;
}
@@ -180,7 +187,7 @@ QVariant QQuickWebEngineHistoryListModel::data(const QModelIndex &index, int rol
if (!index.isValid())
return QVariant();
- if (role < QQuickWebEngineHistory::UrlRole || role > QQuickWebEngineHistory::OffsetRole)
+ if (role < QQuickWebEngineHistory::UrlRole || role > QQuickWebEngineHistory::IconUrlRole)
return QVariant();
if (role == QQuickWebEngineHistory::UrlRole)
@@ -191,6 +198,12 @@ QVariant QQuickWebEngineHistoryListModel::data(const QModelIndex &index, int rol
if (role == QQuickWebEngineHistory::OffsetRole)
return d->offsetForIndex(index.row());
+
+ if (role == QQuickWebEngineHistory::IconUrlRole) {
+ QUrl iconUrl = QUrl(d->adapter()->getNavigationEntryIconUrl(d->index(index.row())));
+ return QQuickWebEngineFaviconProvider::faviconProviderUrl(iconUrl);
+ }
+
return QVariant();
}
@@ -250,7 +263,8 @@ QQuickWebEngineHistoryPrivate::~QQuickWebEngineHistoryPrivate()
format of the list items. The appearance of each item of the list in the delegate can be defined
separately (it is not web engine specific).
- The model roles \e title and \e url specify the title and URL of the visited page. The \e offset
+ The model roles \e title, \e url, and \e icon specify the title, URL, and favicon of the
+ visited page. The \e offset
role specifies the position of the page in respect to the current page (0). A positive number
indicates that the page was visited after the current page, whereas a negative number indicates
that the page was visited before the current page.
diff --git a/src/webengine/api/qquickwebenginehistory_p.h b/src/webengine/api/qquickwebenginehistory_p.h
index fdde01737..22340e483 100644
--- a/src/webengine/api/qquickwebenginehistory_p.h
+++ b/src/webengine/api/qquickwebenginehistory_p.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** 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 http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** 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.LGPLv3 included in the
+** 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.html.
+** 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 later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** 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$
**
@@ -98,6 +101,7 @@ public:
UrlRole = Qt::UserRole + 1,
TitleRole = Qt::UserRole + 2,
OffsetRole = Qt::UserRole + 3,
+ IconUrlRole = Qt::UserRole + 4,
};
QQuickWebEngineHistoryListModel *items() const;
diff --git a/src/webengine/api/qquickwebenginehistory_p_p.h b/src/webengine/api/qquickwebenginehistory_p_p.h
index 2280d05fc..019c6f0ad 100644
--- a/src/webengine/api/qquickwebenginehistory_p_p.h
+++ b/src/webengine/api/qquickwebenginehistory_p_p.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** 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 http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** 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.LGPLv3 included in the
+** 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.html.
+** 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 later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** 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$
**
diff --git a/src/webengine/api/qquickwebengineloadrequest.cpp b/src/webengine/api/qquickwebengineloadrequest.cpp
index 3dbbb852c..47ec17c16 100644
--- a/src/webengine/api/qquickwebengineloadrequest.cpp
+++ b/src/webengine/api/qquickwebengineloadrequest.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** 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 http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** 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.LGPLv3 included in the
+** 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.html.
+** 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 later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** 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$
**
diff --git a/src/webengine/api/qquickwebengineloadrequest_p.h b/src/webengine/api/qquickwebengineloadrequest_p.h
index 744d03625..a50ffc42a 100644
--- a/src/webengine/api/qquickwebengineloadrequest_p.h
+++ b/src/webengine/api/qquickwebengineloadrequest_p.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** 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 http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** 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.LGPLv3 included in the
+** 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.html.
+** 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 later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** 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$
**
diff --git a/src/webengine/api/qquickwebenginenavigationrequest.cpp b/src/webengine/api/qquickwebenginenavigationrequest.cpp
index d50991b21..a738ece80 100644
--- a/src/webengine/api/qquickwebenginenavigationrequest.cpp
+++ b/src/webengine/api/qquickwebenginenavigationrequest.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** 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 http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** 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.LGPLv3 included in the
+** 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.html.
+** 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 later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** 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$
**
diff --git a/src/webengine/api/qquickwebenginenavigationrequest_p.h b/src/webengine/api/qquickwebenginenavigationrequest_p.h
index 9b6da4969..852cd03c4 100644
--- a/src/webengine/api/qquickwebenginenavigationrequest_p.h
+++ b/src/webengine/api/qquickwebenginenavigationrequest_p.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** 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 http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** 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.LGPLv3 included in the
+** 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.html.
+** 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 later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** 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$
**
diff --git a/src/webengine/api/qquickwebenginenewviewrequest.cpp b/src/webengine/api/qquickwebenginenewviewrequest.cpp
index 74729ddf1..36df9023a 100644
--- a/src/webengine/api/qquickwebenginenewviewrequest.cpp
+++ b/src/webengine/api/qquickwebenginenewviewrequest.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** 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 http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** 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.LGPLv3 included in the
+** 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.html.
+** 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 later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** 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$
**
diff --git a/src/webengine/api/qquickwebenginenewviewrequest_p.h b/src/webengine/api/qquickwebenginenewviewrequest_p.h
index c08ef0aba..fd7fc42f4 100644
--- a/src/webengine/api/qquickwebenginenewviewrequest_p.h
+++ b/src/webengine/api/qquickwebenginenewviewrequest_p.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** 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 http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** 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.LGPLv3 included in the
+** 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.html.
+** 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 later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** 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$
**
diff --git a/src/webengine/api/qquickwebengineprofile.cpp b/src/webengine/api/qquickwebengineprofile.cpp
index 3af027b73..d660f639d 100644
--- a/src/webengine/api/qquickwebengineprofile.cpp
+++ b/src/webengine/api/qquickwebengineprofile.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** 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 http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** 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.LGPLv3 included in the
+** 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.html.
+** 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 later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** 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$
**
@@ -45,12 +48,17 @@
#include <QQmlEngine>
#include "browser_context_adapter.h"
+#include <qtwebenginecoreglobal.h>
#include "web_engine_settings.h"
using QtWebEngineCore::BrowserContextAdapter;
QT_BEGIN_NAMESPACE
+ASSERT_ENUMS_MATCH(QQuickWebEngineDownloadItem::UnknownSaveFormat, QtWebEngineCore::BrowserContextAdapterClient::UnknownSavePageFormat)
+ASSERT_ENUMS_MATCH(QQuickWebEngineDownloadItem::SingleHtmlSaveFormat, QtWebEngineCore::BrowserContextAdapterClient::SingleHtmlSaveFormat)
+ASSERT_ENUMS_MATCH(QQuickWebEngineDownloadItem::CompleteHtmlSaveFormat, QtWebEngineCore::BrowserContextAdapterClient::CompleteHtmlSaveFormat)
+ASSERT_ENUMS_MATCH(QQuickWebEngineDownloadItem::MimeHtmlSaveFormat, QtWebEngineCore::BrowserContextAdapterClient::MimeHtmlSaveFormat)
/*!
\class QQuickWebEngineProfile
@@ -87,6 +95,7 @@ QT_BEGIN_NAMESPACE
\value MemoryHttpCache Use an in-memory cache. This is the only setting possible if
\c off-the-record is set or no cache path is available.
\value DiskHttpCache Use a disk cache. This is the default.
+ \value NoCache Disable both in-memory and disk caching. (Added in Qt 5.7)
*/
/*!
@@ -169,6 +178,8 @@ void QQuickWebEngineProfilePrivate::downloadRequested(DownloadItemInfo &info)
itemPrivate->totalBytes = info.totalBytes;
itemPrivate->mimeType = info.mimeType;
itemPrivate->downloadPath = info.path;
+ itemPrivate->savePageFormat = static_cast<QQuickWebEngineDownloadItem::SavePageFormat>(
+ info.savePageFormat);
QQuickWebEngineDownloadItem *download = new QQuickWebEngineDownloadItem(itemPrivate, q);
@@ -179,8 +190,16 @@ void QQuickWebEngineProfilePrivate::downloadRequested(DownloadItemInfo &info)
QQuickWebEngineDownloadItem::DownloadState state = download->state();
info.path = download->path();
+ info.savePageFormat = itemPrivate->savePageFormat;
info.accepted = state != QQuickWebEngineDownloadItem::DownloadCancelled
&& state != QQuickWebEngineDownloadItem::DownloadRequested;
+
+ if (state == QQuickWebEngineDownloadItem::DownloadRequested) {
+ // Delete unaccepted downloads.
+ info.accepted = false;
+ m_ongoingDownloads.remove(info.id);
+ delete download;
+ }
}
void QQuickWebEngineProfilePrivate::downloadUpdated(const DownloadItemInfo &info)
@@ -452,6 +471,8 @@ void QQuickWebEngineProfile::setHttpUserAgent(const QString &userAgent)
no persistentStoragePath is available.
\value WebEngineProfile.DiskHttpCache
Uses a disk cache. This is the default value.
+ \value WebEngineProfile.NoCache
+ Disables caching. (Added in 5.7)
*/
/*!
@@ -601,6 +622,29 @@ QWebEngineCookieStore *QQuickWebEngineProfile::cookieStore() const
}
/*!
+ \qmlmethod void WebEngineProfile::clearHttpCache()
+ \since QtWebEngine 1.3
+
+ Removes the profile's cache entries.
+
+ \sa WebEngineProfile::cachePath
+*/
+
+/*!
+ \since 5.7
+
+ Removes the profile's cache entries.
+
+ \sa WebEngineProfile::clearHttpCache
+*/
+void QQuickWebEngineProfile::clearHttpCache()
+{
+ Q_D(QQuickWebEngineProfile);
+ d->browserContext()->clearHttpCache();
+}
+
+
+/*!
Registers a request interceptor singleton \a interceptor to intercept URL requests.
The profile does not take ownership of the pointer.
diff --git a/src/webengine/api/qquickwebengineprofile.h b/src/webengine/api/qquickwebengineprofile.h
index 1d8608e0f..dc5aa7df8 100644
--- a/src/webengine/api/qquickwebengineprofile.h
+++ b/src/webengine/api/qquickwebengineprofile.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** 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 http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** 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.LGPLv3 included in the
+** 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.html.
+** 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 later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** 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$
**
@@ -68,13 +71,15 @@ class Q_WEBENGINE_EXPORT QQuickWebEngineProfile : public QObject {
Q_PROPERTY(QString httpAcceptLanguage READ httpAcceptLanguage WRITE setHttpAcceptLanguage NOTIFY httpAcceptLanguageChanged FINAL REVISION 1)
Q_PROPERTY(PersistentCookiesPolicy persistentCookiesPolicy READ persistentCookiesPolicy WRITE setPersistentCookiesPolicy NOTIFY persistentCookiesPolicyChanged FINAL)
Q_PROPERTY(int httpCacheMaximumSize READ httpCacheMaximumSize WRITE setHttpCacheMaximumSize NOTIFY httpCacheMaximumSizeChanged FINAL)
+
public:
QQuickWebEngineProfile(QObject *parent = Q_NULLPTR);
~QQuickWebEngineProfile();
enum HttpCacheType {
MemoryHttpCache,
- DiskHttpCache
+ DiskHttpCache,
+ NoCache
};
Q_ENUM(HttpCacheType)
@@ -122,6 +127,8 @@ public:
void removeUrlSchemeHandler(QWebEngineUrlSchemeHandler *);
void removeAllUrlSchemeHandlers();
+ Q_REVISION(2) Q_INVOKABLE void clearHttpCache();
+
static QQuickWebEngineProfile *defaultProfile();
Q_SIGNALS:
diff --git a/src/webengine/api/qquickwebengineprofile_p.h b/src/webengine/api/qquickwebengineprofile_p.h
index e405f1319..1ba1eb53f 100644
--- a/src/webengine/api/qquickwebengineprofile_p.h
+++ b/src/webengine/api/qquickwebengineprofile_p.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** 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 http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** 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.LGPLv3 included in the
+** 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.html.
+** 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 later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** 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$
**
diff --git a/src/webengine/api/qquickwebenginescript.cpp b/src/webengine/api/qquickwebenginescript.cpp
index c57c0f21b..7e08e2fd5 100644
--- a/src/webengine/api/qquickwebenginescript.cpp
+++ b/src/webengine/api/qquickwebenginescript.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** 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 http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** 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.LGPLv3 included in the
+** 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.html.
+** 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 later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** 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$
**
@@ -41,7 +44,7 @@
#include <QtCore/QDebug>
#include <QtCore/QFile>
#include <QtCore/QTimerEvent>
-#include "user_script_controller_host.h"
+#include "user_resource_controller_host.h"
using QtWebEngineCore::UserScript;
@@ -102,7 +105,7 @@ QString QQuickWebEngineScript::toString() const
}
/*!
- \qmlproperty QString WebEngineScript::name
+ \qmlproperty string WebEngineScript::name
The name of the script. Can be useful to retrieve a particular script from
\l{WebEngineView::userScripts}{WebEngineView.userScripts}.
@@ -301,11 +304,11 @@ void QQuickWebEngineScript::timerEvent(QTimerEvent *e)
d->m_controllerHost->addUserScript(d->coreScript, d->m_adapter);
}
-void QQuickWebEngineScriptPrivate::bind(QtWebEngineCore::UserScriptControllerHost *scriptController, QtWebEngineCore::WebContentsAdapter *adapter)
+void QQuickWebEngineScriptPrivate::bind(QtWebEngineCore::UserResourceControllerHost *resourceController, QtWebEngineCore::WebContentsAdapter *adapter)
{
aboutToUpdateUnderlyingScript();
m_adapter = adapter;
- m_controllerHost = scriptController;
+ m_controllerHost = resourceController;
}
QQuickWebEngineScriptPrivate::QQuickWebEngineScriptPrivate()
diff --git a/src/webengine/api/qquickwebenginescript_p.h b/src/webengine/api/qquickwebenginescript_p.h
index c9d6f5d26..2c3b87d9b 100644
--- a/src/webengine/api/qquickwebenginescript_p.h
+++ b/src/webengine/api/qquickwebenginescript_p.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** 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 http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** 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.LGPLv3 included in the
+** 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.html.
+** 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 later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** 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$
**
diff --git a/src/webengine/api/qquickwebenginescript_p_p.h b/src/webengine/api/qquickwebenginescript_p_p.h
index 133e2dc0b..4525505c6 100644
--- a/src/webengine/api/qquickwebenginescript_p_p.h
+++ b/src/webengine/api/qquickwebenginescript_p_p.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** 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 http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** 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.LGPLv3 included in the
+** 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.html.
+** 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 later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** 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$
**
@@ -55,7 +58,7 @@
#include "web_contents_adapter.h"
namespace QtWebEngineCore {
-class UserScriptControllerHost;
+class UserResourceControllerHost;
class WebContentsAdapter;
} // namespace
@@ -66,11 +69,11 @@ public:
Q_DECLARE_PUBLIC(QQuickWebEngineScript)
QQuickWebEngineScriptPrivate();
void aboutToUpdateUnderlyingScript();
- void bind(QtWebEngineCore::UserScriptControllerHost *, QtWebEngineCore::WebContentsAdapter * = 0);
+ void bind(QtWebEngineCore::UserResourceControllerHost *, QtWebEngineCore::WebContentsAdapter * = 0);
QtWebEngineCore::UserScript coreScript;
QBasicTimer m_basicTimer;
- QtWebEngineCore::UserScriptControllerHost *m_controllerHost;
+ QtWebEngineCore::UserResourceControllerHost *m_controllerHost;
QtWebEngineCore::WebContentsAdapter *m_adapter;
QUrl m_sourceUrl;
diff --git a/src/webengine/api/qquickwebenginesettings.cpp b/src/webengine/api/qquickwebenginesettings.cpp
index bcb461ffd..b12e59576 100644
--- a/src/webengine/api/qquickwebenginesettings.cpp
+++ b/src/webengine/api/qquickwebenginesettings.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** 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 http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** 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.LGPLv3 included in the
+** 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.html.
+** 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 later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** 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$
**
@@ -235,6 +238,72 @@ bool QQuickWebEngineSettings::fullScreenSupportEnabled() const
}
/*!
+ \qmlproperty bool WebEngineSettings::screenCaptureEnabled
+ \since QtWebEngine 1.3
+
+ Tells the web engine whether screen capture is supported in this application or not.
+
+ Disabled by default.
+*/
+bool QQuickWebEngineSettings::screenCaptureEnabled() const
+{
+ return d_ptr->testAttribute(WebEngineSettings::ScreenCaptureEnabled);
+}
+
+/*!
+ \qmlproperty bool WebEngineSettings::webGLEnabled
+ \since QtWebEngine 1.3
+
+ Enables support for HTML 5 WebGL.
+
+ Enabled by default if available.
+*/
+bool QQuickWebEngineSettings::webGLEnabled() const
+{
+ return d_ptr->testAttribute(WebEngineSettings::WebGLEnabled);
+}
+
+/*!
+ \qmlproperty bool WebEngineSettings::accelerated2dCanvasEnabled
+ \since QtWebEngine 1.3
+
+ Specifies whether the HTML 5 2D canvas should be a OpenGL framebuffer.
+ This makes many painting operations faster, but slows down pixel access.
+
+ Enabled by default if available.
+*/
+bool QQuickWebEngineSettings::accelerated2dCanvasEnabled() const
+{
+ return d_ptr->testAttribute(WebEngineSettings::Accelerated2dCanvasEnabled);
+}
+
+/*!
+ \qmlproperty bool WebEngineSettings::autoLoadIconsForPage
+ \since QtWebEngine 1.3
+
+ Automatically downloads icons for web pages.
+
+ Enabled by default.
+*/
+bool QQuickWebEngineSettings::autoLoadIconsForPage() const
+{
+ return d_ptr->testAttribute(WebEngineSettings::AutoLoadIconsForPage);
+}
+
+/*!
+ \qmlproperty bool WebEngineSettings::touchIconsEnabled
+ \since QtWebEngine 1.3
+
+ Enables support for touch icons and precomposed touch icons.
+
+ Disabled by default.
+*/
+bool QQuickWebEngineSettings::touchIconsEnabled() const
+{
+ return d_ptr->testAttribute(WebEngineSettings::TouchIconsEnabled);
+}
+
+/*!
\qmlproperty string WebEngineSettings::defaultTextEncoding
\since QtWebEngine 1.2
@@ -355,6 +424,46 @@ void QQuickWebEngineSettings::setFullScreenSupportEnabled(bool on)
Q_EMIT fullScreenSupportEnabledChanged();
}
+void QQuickWebEngineSettings::setScreenCaptureEnabled(bool on)
+{
+ bool wasOn = d_ptr->testAttribute(WebEngineSettings::ScreenCaptureEnabled);
+ d_ptr->setAttribute(WebEngineSettings::ScreenCaptureEnabled, on);
+ if (wasOn != on)
+ Q_EMIT screenCaptureEnabledChanged();
+}
+
+void QQuickWebEngineSettings::setWebGLEnabled(bool on)
+{
+ bool wasOn = d_ptr->testAttribute(WebEngineSettings::WebGLEnabled);
+ d_ptr->setAttribute(WebEngineSettings::WebGLEnabled, on);
+ if (wasOn != on)
+ Q_EMIT webGLEnabledChanged();
+}
+
+void QQuickWebEngineSettings::setAccelerated2dCanvasEnabled(bool on)
+{
+ bool wasOn = d_ptr->testAttribute(WebEngineSettings::Accelerated2dCanvasEnabled);
+ d_ptr->setAttribute(WebEngineSettings::Accelerated2dCanvasEnabled, on);
+ if (wasOn != on)
+ Q_EMIT accelerated2dCanvasEnabledChanged();
+}
+
+void QQuickWebEngineSettings::setAutoLoadIconsForPage(bool on)
+{
+ bool wasOn = d_ptr->testAttribute(WebEngineSettings::AutoLoadIconsForPage);
+ d_ptr->setAttribute(WebEngineSettings::AutoLoadIconsForPage, on);
+ if (wasOn != on)
+ Q_EMIT autoLoadIconsForPageChanged();
+}
+
+void QQuickWebEngineSettings::setTouchIconsEnabled(bool on)
+{
+ bool wasOn = d_ptr->testAttribute(WebEngineSettings::TouchIconsEnabled);
+ d_ptr->setAttribute(WebEngineSettings::TouchIconsEnabled, on);
+ if (wasOn != on)
+ Q_EMIT touchIconsEnabledChanged();
+}
+
void QQuickWebEngineSettings::setDefaultTextEncoding(QString encoding)
{
const QString oldDefaultTextEncoding = d_ptr->defaultTextEncoding();
diff --git a/src/webengine/api/qquickwebenginesettings_p.h b/src/webengine/api/qquickwebenginesettings_p.h
index 030762ed3..584027260 100644
--- a/src/webengine/api/qquickwebenginesettings_p.h
+++ b/src/webengine/api/qquickwebenginesettings_p.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** 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 http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** 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.LGPLv3 included in the
+** 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.html.
+** 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 later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** 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$
**
@@ -72,9 +75,13 @@ class Q_WEBENGINE_PRIVATE_EXPORT QQuickWebEngineSettings : public QObject {
Q_PROPERTY(bool hyperlinkAuditingEnabled READ hyperlinkAuditingEnabled WRITE setHyperlinkAuditingEnabled NOTIFY hyperlinkAuditingEnabledChanged)
Q_PROPERTY(bool errorPageEnabled READ errorPageEnabled WRITE setErrorPageEnabled NOTIFY errorPageEnabledChanged)
Q_PROPERTY(bool pluginsEnabled READ pluginsEnabled WRITE setPluginsEnabled NOTIFY pluginsEnabledChanged)
- // FIXME(QTBUG-40043): Mark fullScreenSupportEnabled with REVISION 1
- Q_PROPERTY(bool fullScreenSupportEnabled READ fullScreenSupportEnabled WRITE setFullScreenSupportEnabled NOTIFY fullScreenSupportEnabledChanged)
+ Q_PROPERTY(bool fullScreenSupportEnabled READ fullScreenSupportEnabled WRITE setFullScreenSupportEnabled NOTIFY fullScreenSupportEnabledChanged REVISION 1)
Q_PROPERTY(QString defaultTextEncoding READ defaultTextEncoding WRITE setDefaultTextEncoding NOTIFY defaultTextEncodingChanged)
+ Q_PROPERTY(bool screenCaptureEnabled READ screenCaptureEnabled WRITE setScreenCaptureEnabled NOTIFY screenCaptureEnabledChanged REVISION 2)
+ Q_PROPERTY(bool webGLEnabled READ webGLEnabled WRITE setWebGLEnabled NOTIFY webGLEnabledChanged REVISION 2)
+ Q_PROPERTY(bool accelerated2dCanvasEnabled READ accelerated2dCanvasEnabled WRITE setAccelerated2dCanvasEnabled NOTIFY accelerated2dCanvasEnabledChanged REVISION 2)
+ Q_PROPERTY(bool autoLoadIconsForPage READ autoLoadIconsForPage WRITE setAutoLoadIconsForPage NOTIFY autoLoadIconsForPageChanged REVISION 2)
+ Q_PROPERTY(bool touchIconsEnabled READ touchIconsEnabled WRITE setTouchIconsEnabled NOTIFY touchIconsEnabledChanged REVISION 2)
public:
~QQuickWebEngineSettings();
@@ -93,6 +100,11 @@ public:
bool pluginsEnabled() const;
bool fullScreenSupportEnabled() const;
QString defaultTextEncoding() const;
+ bool screenCaptureEnabled() const;
+ bool webGLEnabled() const;
+ bool accelerated2dCanvasEnabled() const;
+ bool autoLoadIconsForPage() const;
+ bool touchIconsEnabled() const;
void setAutoLoadImages(bool on);
void setJavascriptEnabled(bool on);
@@ -108,6 +120,11 @@ public:
void setPluginsEnabled(bool on);
void setFullScreenSupportEnabled(bool on);
void setDefaultTextEncoding(QString encoding);
+ void setScreenCaptureEnabled(bool on);
+ void setWebGLEnabled(bool on);
+ void setAccelerated2dCanvasEnabled(bool on);
+ void setAutoLoadIconsForPage(bool on);
+ void setTouchIconsEnabled(bool on);
signals:
void autoLoadImagesChanged();
@@ -122,9 +139,13 @@ signals:
void hyperlinkAuditingEnabledChanged();
void errorPageEnabledChanged();
void pluginsEnabledChanged();
- // FIXME(QTBUG-40043): Mark fullScreenSupportEnabledChanged with Q_REVISION(1)
- void fullScreenSupportEnabledChanged();
+ Q_REVISION(1) void fullScreenSupportEnabledChanged();
void defaultTextEncodingChanged();
+ Q_REVISION(2) void screenCaptureEnabledChanged();
+ Q_REVISION(2) void webGLEnabledChanged();
+ Q_REVISION(2) void accelerated2dCanvasEnabledChanged();
+ Q_REVISION(2) void autoLoadIconsForPageChanged();
+ Q_REVISION(2) void touchIconsEnabledChanged();
private:
explicit QQuickWebEngineSettings(QQuickWebEngineSettings *parentSettings = 0);
diff --git a/src/webengine/api/qquickwebenginesingleton.cpp b/src/webengine/api/qquickwebenginesingleton.cpp
index f0f5969c2..3e84f5cf0 100644
--- a/src/webengine/api/qquickwebenginesingleton.cpp
+++ b/src/webengine/api/qquickwebenginesingleton.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** 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 http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** 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.LGPLv3 included in the
+** 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.html.
+** 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 later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** 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$
**
diff --git a/src/webengine/api/qquickwebenginesingleton_p.h b/src/webengine/api/qquickwebenginesingleton_p.h
index 64668420c..c7d946a37 100644
--- a/src/webengine/api/qquickwebenginesingleton_p.h
+++ b/src/webengine/api/qquickwebenginesingleton_p.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** 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 http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** 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.LGPLv3 included in the
+** 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.html.
+** 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 later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** 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$
**
diff --git a/src/webengine/api/qquickwebenginetestsupport.cpp b/src/webengine/api/qquickwebenginetestsupport.cpp
index 84d7d8c53..46ffb06f4 100644
--- a/src/webengine/api/qquickwebenginetestsupport.cpp
+++ b/src/webengine/api/qquickwebenginetestsupport.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** 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 http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** 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.LGPLv3 included in the
+** 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.html.
+** 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 later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** 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$
**
diff --git a/src/webengine/api/qquickwebenginetestsupport_p.h b/src/webengine/api/qquickwebenginetestsupport_p.h
index 8ea023b63..79d51e7a3 100644
--- a/src/webengine/api/qquickwebenginetestsupport_p.h
+++ b/src/webengine/api/qquickwebenginetestsupport_p.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** 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 http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** 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.LGPLv3 included in the
+** 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.html.
+** 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 later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** 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$
**
diff --git a/src/webengine/api/qquickwebengineview.cpp b/src/webengine/api/qquickwebengineview.cpp
index 4eca71926..31a258b0c 100644
--- a/src/webengine/api/qquickwebengineview.cpp
+++ b/src/webengine/api/qquickwebengineview.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** 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 http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** 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.LGPLv3 included in the
+** 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.html.
+** 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 later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** 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$
**
@@ -44,6 +47,7 @@
#include "javascript_dialog_controller.h"
#include "qquickwebenginehistory_p.h"
#include "qquickwebenginecertificateerror_p.h"
+#include "qquickwebenginefaviconprovider_p_p.h"
#include "qquickwebengineloadrequest_p.h"
#include "qquickwebenginenavigationrequest_p.h"
#include "qquickwebenginenewviewrequest_p.h"
@@ -58,7 +62,7 @@
#include "render_widget_host_view_qt_delegate_quick.h"
#include "render_widget_host_view_qt_delegate_quickwindow.h"
#include "ui_delegates_manager.h"
-#include "user_script_controller_host.h"
+#include "user_resource_controller_host.h"
#include "web_contents_adapter.h"
#include "web_engine_error.h"
#include "web_engine_settings.h"
@@ -67,7 +71,10 @@
#include <QClipboard>
#include <QGuiApplication>
#include <QLoggingCategory>
+#include <QMarginsF>
#include <QMimeData>
+#include <QPageLayout>
+#include <QPageSize>
#include <QQmlComponent>
#include <QQmlContext>
#include <QQmlEngine>
@@ -127,12 +134,14 @@ QQuickWebEngineViewPrivate::QQuickWebEngineViewPrivate()
, m_testSupport(0)
#endif
, contextMenuExtraItems(0)
+ , faviconProvider(0)
, loadProgress(0)
, m_fullscreenMode(false)
, isLoading(false)
, m_activeFocusOnPress(true)
, devicePixelRatio(QGuiApplication::primaryScreen()->devicePixelRatio())
, m_webChannel(0)
+ , m_webChannelWorld(0)
, m_dpiScale(1.0)
, m_backgroundColor(Qt::white)
, m_defaultZoomFactor(1.0)
@@ -219,7 +228,8 @@ bool QQuickWebEngineViewPrivate::contextMenuRequested(const WebEngineContextMenu
if (!menu)
return false;
- contextMenuData = data;
+ contextMenuData.update(data);
+ Q_EMIT q->experimental()->contextMenuDataChanged();
// Populate our menu
MenuItemHandler *item = 0;
@@ -246,9 +256,12 @@ bool QQuickWebEngineViewPrivate::contextMenuRequested(const WebEngineContextMenu
item = new MenuItemHandler(menu);
QObject::connect(item, &MenuItemHandler::triggered, [q] { q->triggerWebAction(QQuickWebEngineView::Copy); });
ui()->addMenuItem(item, QQuickWebEngineView::tr("Copy"));
+ item = new MenuItemHandler(menu);
+ QObject::connect(item, &MenuItemHandler::triggered, [q] { q->triggerWebAction(QQuickWebEngineView::Unselect); });
+ ui()->addMenuItem(item, QQuickWebEngineView::tr("Unselect"));
}
- if (!contextMenuData.linkText.isEmpty() && contextMenuData.linkUrl.isValid()) {
+ if (!contextMenuData.linkText().isEmpty() && contextMenuData.linkUrl().isValid()) {
item = new MenuItemHandler(menu);
QObject::connect(item, &MenuItemHandler::triggered, [q] { q->triggerWebAction(QQuickWebEngineView::CopyLinkToClipboard); });
ui()->addMenuItem(item, QQuickWebEngineView::tr("Copy Link URL"));
@@ -256,9 +269,9 @@ bool QQuickWebEngineViewPrivate::contextMenuRequested(const WebEngineContextMenu
QObject::connect(item, &MenuItemHandler::triggered, [q] { q->triggerWebAction(QQuickWebEngineView::DownloadLinkToDisk); });
ui()->addMenuItem(item, QQuickWebEngineView::tr("Save Link"));
}
- if (contextMenuData.mediaUrl.isValid()) {
- switch (contextMenuData.mediaType) {
- case WebEngineContextMenuData::MediaTypeImage:
+ if (contextMenuData.mediaUrl().isValid()) {
+ switch (contextMenuData.mediaType()) {
+ case QQuickWebEngineContextMenuData::MediaTypeImage:
item = new MenuItemHandler(menu);
QObject::connect(item, &MenuItemHandler::triggered, [q] { q->triggerWebAction(QQuickWebEngineView::CopyImageUrlToClipboard); });
ui()->addMenuItem(item, QQuickWebEngineView::tr("Copy Image URL"));
@@ -269,11 +282,11 @@ bool QQuickWebEngineViewPrivate::contextMenuRequested(const WebEngineContextMenu
QObject::connect(item, &MenuItemHandler::triggered, [q] { q->triggerWebAction(QQuickWebEngineView::DownloadImageToDisk); });
ui()->addMenuItem(item, QQuickWebEngineView::tr("Save Image"));
break;
- case WebEngineContextMenuData::MediaTypeCanvas:
+ case QQuickWebEngineContextMenuData::MediaTypeCanvas:
Q_UNREACHABLE(); // mediaUrl is invalid for canvases
break;
- case WebEngineContextMenuData::MediaTypeAudio:
- case WebEngineContextMenuData::MediaTypeVideo:
+ case QQuickWebEngineContextMenuData::MediaTypeAudio:
+ case QQuickWebEngineContextMenuData::MediaTypeVideo:
item = new MenuItemHandler(menu);
QObject::connect(item, &MenuItemHandler::triggered, [q] { q->triggerWebAction(QQuickWebEngineView::CopyMediaUrlToClipboard); });
ui()->addMenuItem(item, QQuickWebEngineView::tr("Copy Media URL"));
@@ -286,12 +299,12 @@ bool QQuickWebEngineViewPrivate::contextMenuRequested(const WebEngineContextMenu
item = new MenuItemHandler(menu);
QObject::connect(item, &MenuItemHandler::triggered, [q] { q->triggerWebAction(QQuickWebEngineView::ToggleMediaLoop); });
ui()->addMenuItem(item, QQuickWebEngineView::tr("Toggle Looping"));
- if (contextMenuData.mediaFlags & WebEngineContextMenuData::MediaHasAudio) {
+ if (data.mediaFlags & WebEngineContextMenuData::MediaHasAudio) {
item = new MenuItemHandler(menu);
QObject::connect(item, &MenuItemHandler::triggered, [q] { q->triggerWebAction(QQuickWebEngineView::ToggleMediaMute); });
ui()->addMenuItem(item, QQuickWebEngineView::tr("Toggle Mute"));
}
- if (contextMenuData.mediaFlags & WebEngineContextMenuData::MediaCanToggleControls) {
+ if (data.mediaFlags & WebEngineContextMenuData::MediaCanToggleControls) {
item = new MenuItemHandler(menu);
QObject::connect(item, &MenuItemHandler::triggered, [q] { q->triggerWebAction(QQuickWebEngineView::ToggleMediaControls); });
ui()->addMenuItem(item, QQuickWebEngineView::tr("Toggle Media Controls"));
@@ -300,7 +313,7 @@ bool QQuickWebEngineViewPrivate::contextMenuRequested(const WebEngineContextMenu
default:
break;
}
- } else if (contextMenuData.mediaType == WebEngineContextMenuData::MediaTypeCanvas) {
+ } else if (contextMenuData.mediaType() == QQuickWebEngineContextMenuData::MediaTypeCanvas) {
item = new MenuItemHandler(menu);
QObject::connect(item, &MenuItemHandler::triggered, [q] { q->triggerWebAction(QQuickWebEngineView::CopyImageToClipboard); });
ui()->addMenuItem(item, QQuickWebEngineView::tr("Copy Image"));
@@ -366,6 +379,11 @@ void QQuickWebEngineViewPrivate::runGeolocationPermissionRequest(const QUrl &url
Q_EMIT q->featurePermissionRequested(url, QQuickWebEngineView::Geolocation);
}
+void QQuickWebEngineViewPrivate::showColorDialog(QSharedPointer<ColorChooserController> controller)
+{
+ ui()->showColorDialog(controller);
+}
+
void QQuickWebEngineViewPrivate::runFileChooser(FilePickerController* controller)
{
ui()->showFilePicker(controller);
@@ -397,7 +415,20 @@ void QQuickWebEngineViewPrivate::urlChanged(const QUrl &url)
void QQuickWebEngineViewPrivate::iconChanged(const QUrl &url)
{
Q_Q(QQuickWebEngineView);
- icon = url;
+
+ if (iconUrl == QQuickWebEngineFaviconProvider::faviconProviderUrl(url))
+ return;
+
+ if (!faviconProvider) {
+ QQmlEngine *engine = qmlEngine(q);
+ Q_ASSERT(engine);
+ faviconProvider = static_cast<QQuickWebEngineFaviconProvider *>(
+ engine->imageProvider(QQuickWebEngineFaviconProvider::identifier()));
+ Q_ASSERT(faviconProvider);
+ }
+
+ iconUrl = faviconProvider->attach(q, url);
+ m_history->reset();
Q_EMIT q->iconChanged();
}
@@ -414,6 +445,12 @@ void QQuickWebEngineViewPrivate::didUpdateTargetURL(const QUrl &hoveredUrl)
Q_EMIT q->linkHovered(hoveredUrl);
}
+void QQuickWebEngineViewPrivate::recentlyAudibleChanged(bool recentlyAudible)
+{
+ Q_Q(QQuickWebEngineView);
+ Q_EMIT q->recentlyAudibleChanged(recentlyAudible);
+}
+
QRectF QQuickWebEngineViewPrivate::viewportRect() const
{
Q_Q(const QQuickWebEngineView);
@@ -657,6 +694,11 @@ QSharedPointer<BrowserContextAdapter> QQuickWebEngineViewPrivate::browserContext
return m_profile->d_ptr->browserContext();
}
+WebContentsAdapter *QQuickWebEngineViewPrivate::webContentsAdapter()
+{
+ return adapter.data();
+}
+
WebEngineSettings *QQuickWebEngineViewPrivate::webEngineSettings() const
{
return m_settings->d_ptr.data();
@@ -764,7 +806,7 @@ void QQuickWebEngineViewPrivate::adoptWebContents(WebContentsAdapter *webContent
// associate the webChannel with the new adapter
if (m_webChannel)
- adapter->setWebChannel(m_webChannel);
+ adapter->setWebChannel(m_webChannel, m_webChannelWorld);
// set initial background color if non-default
if (m_backgroundColor != Qt::white)
@@ -772,7 +814,7 @@ void QQuickWebEngineViewPrivate::adoptWebContents(WebContentsAdapter *webContent
// re-bind the userscrips to the new adapter
Q_FOREACH (QQuickWebEngineScript *script, m_userScripts)
- script->d_func()->bind(browserContextAdapter()->userScriptController(), adapter.data());
+ script->d_func()->bind(browserContextAdapter()->userResourceController(), adapter.data());
// set the zoomFactor if it had been changed on the old adapter.
if (!qFuzzyCompare(adapter->currentZoomFactor(), m_defaultZoomFactor))
@@ -796,7 +838,8 @@ QQuickWebEngineView::QQuickWebEngineView(QQuickItem *parent)
Q_D(QQuickWebEngineView);
d->e->q_ptr = d->q_ptr = this;
this->setActiveFocusOnTab(true);
- this->setFlags(QQuickItem::ItemIsFocusScope | QQuickItem::ItemAcceptsInputMethod);
+ this->setFlags(QQuickItem::ItemIsFocusScope | QQuickItem::ItemAcceptsInputMethod
+ | QQuickItem::ItemAcceptsDrops);
#ifndef QT_NO_ACCESSIBILITY
QQuickAccessibleAttached *accessible = QQuickAccessibleAttached::qmlAttachedProperties(this);
@@ -806,6 +849,9 @@ QQuickWebEngineView::QQuickWebEngineView(QQuickItem *parent)
QQuickWebEngineView::~QQuickWebEngineView()
{
+ Q_D(QQuickWebEngineView);
+ if (d->faviconProvider)
+ d->faviconProvider->detach(this);
}
void QQuickWebEngineViewPrivate::ensureContentsAdapter()
@@ -817,12 +863,12 @@ void QQuickWebEngineViewPrivate::ensureContentsAdapter()
if (m_backgroundColor != Qt::white)
adapter->backgroundColorChanged();
if (m_webChannel)
- adapter->setWebChannel(m_webChannel);
+ adapter->setWebChannel(m_webChannel, m_webChannelWorld);
if (explicitUrl.isValid())
adapter->load(explicitUrl);
// push down the page's user scripts
Q_FOREACH (QQuickWebEngineScript *script, m_userScripts)
- script->d_func()->bind(browserContextAdapter()->userScriptController(), adapter.data());
+ script->d_func()->bind(browserContextAdapter()->userResourceController(), adapter.data());
// set the zoomFactor if it had been changed on the old adapter.
if (!qFuzzyCompare(adapter->currentZoomFactor(), m_defaultZoomFactor))
q->setZoomFactor(m_defaultZoomFactor);
@@ -862,7 +908,7 @@ void QQuickWebEngineView::setUrl(const QUrl& url)
QUrl QQuickWebEngineView::icon() const
{
Q_D(const QQuickWebEngineView);
- return d->icon;
+ return d->iconUrl;
}
void QQuickWebEngineView::loadHtml(const QString &html, const QUrl &baseUrl)
@@ -1017,6 +1063,15 @@ void QQuickWebEngineViewPrivate::didFindText(quint64 requestId, int matchCount)
args.append(QJSValue(matchCount));
callback.call(args);
}
+
+void QQuickWebEngineViewPrivate::didPrintPage(quint64 requestId, const QByteArray &result)
+{
+ QJSValue callback = m_callbacks.take(requestId);
+ QJSValueList args;
+ args.append(QJSValue(result.data()));
+ callback.call(args);
+}
+
void QQuickWebEngineViewPrivate::showValidationMessage(const QRect &anchor, const QString &mainText, const QString &subText)
{
#ifdef ENABLE_QML_TESTSUPPORT_API
@@ -1037,6 +1092,18 @@ void QQuickWebEngineViewPrivate::moveValidationMessage(const QRect &anchor)
ui()->moveMessageBubble(anchor);
}
+void QQuickWebEngineViewPrivate::updateScrollPosition(const QPointF &position)
+{
+ Q_Q(QQuickWebEngineView);
+ Q_EMIT q->scrollPositionChanged(position);
+}
+
+void QQuickWebEngineViewPrivate::updateContentsSize(const QSizeF &size)
+{
+ Q_Q(QQuickWebEngineView);
+ Q_EMIT q->contentsSizeChanged(size);
+}
+
void QQuickWebEngineViewPrivate::renderProcessTerminated(
RenderProcessTerminationStatus terminationStatus, int exitCode)
{
@@ -1045,6 +1112,13 @@ void QQuickWebEngineViewPrivate::renderProcessTerminated(
renderProcessExitStatus(terminationStatus)), exitCode);
}
+void QQuickWebEngineViewPrivate::startDragging(const content::DropData &dropData,
+ Qt::DropActions allowedActions,
+ const QPixmap &pixmap, const QPoint &offset)
+{
+ adapter->startDragging(q_ptr->window(), dropData, allowedActions, pixmap, offset);
+}
+
bool QQuickWebEngineViewPrivate::isEnabled() const
{
const Q_Q(QQuickWebEngineView);
@@ -1092,10 +1166,22 @@ void QQuickWebEngineView::runJavaScript(const QString &script, const QJSValue &c
Q_D(QQuickWebEngineView);
d->ensureContentsAdapter();
if (!callback.isUndefined()) {
- quint64 requestId = d_ptr->adapter->runJavaScriptCallbackResult(script);
+ quint64 requestId = d_ptr->adapter->runJavaScriptCallbackResult(script, QQuickWebEngineScript::MainWorld);
+ d->m_callbacks.insert(requestId, callback);
+ } else
+ d->adapter->runJavaScript(script, QQuickWebEngineScript::MainWorld);
+}
+
+void QQuickWebEngineView::runJavaScript(const QString &script, quint32 worldId, const QJSValue &callback)
+{
+ Q_D(QQuickWebEngineView);
+ if (!d->adapter)
+ return;
+ if (!callback.isUndefined()) {
+ quint64 requestId = d_ptr->adapter->runJavaScriptCallbackResult(script, worldId);
d->m_callbacks.insert(requestId, callback);
} else
- d->adapter->runJavaScript(script);
+ d->adapter->runJavaScript(script, worldId);
}
QQuickWebEngineViewExperimental *QQuickWebEngineView::experimental() const
@@ -1129,6 +1215,65 @@ void QQuickWebEngineView::setBackgroundColor(const QColor &color)
emit backgroundColorChanged();
}
+/*!
+ \property QQuickWebEngineView::audioMuted
+ \brief the state of whether the current page audio is muted.
+ \since 5.7
+
+ The default value is false.
+*/
+bool QQuickWebEngineView::isAudioMuted() const
+{
+ const Q_D(QQuickWebEngineView);
+ if (d->adapter)
+ return d->adapter->isAudioMuted();
+ return false;
+}
+
+void QQuickWebEngineView::setAudioMuted(bool muted)
+{
+ Q_D(QQuickWebEngineView);
+ bool _isAudioMuted = isAudioMuted();
+ if (d->adapter) {
+ d->adapter->setAudioMuted(muted);
+ if (_isAudioMuted != muted) {
+ Q_EMIT audioMutedChanged(muted);
+ }
+ }
+}
+
+bool QQuickWebEngineView::recentlyAudible() const
+{
+ const Q_D(QQuickWebEngineView);
+ if (d->adapter)
+ return d->adapter->recentlyAudible();
+ return false;
+}
+
+void QQuickWebEngineView::printToPdf(const QString& filePath, PrintedPageSizeId pageSizeId, PrintedPageOrientation orientation)
+{
+ Q_D(const QQuickWebEngineView);
+ QPageSize layoutSize(static_cast<QPageSize::PageSizeId>(pageSizeId));
+ QPageLayout::Orientation layoutOrientation = static_cast<QPageLayout::Orientation>(orientation);
+ QPageLayout pageLayout(layoutSize, layoutOrientation, QMarginsF(0.0, 0.0, 0.0, 0.0));
+
+ d->adapter->printToPDF(pageLayout, filePath);
+}
+
+void QQuickWebEngineView::printToPdf(const QJSValue &callback, PrintedPageSizeId pageSizeId, PrintedPageOrientation orientation)
+{
+ Q_D(QQuickWebEngineView);
+ QPageSize layoutSize(static_cast<QPageSize::PageSizeId>(pageSizeId));
+ QPageLayout::Orientation layoutOrientation = static_cast<QPageLayout::Orientation>(orientation);
+ QPageLayout pageLayout(layoutSize, layoutOrientation, QMarginsF(0.0, 0.0, 0.0, 0.0));
+
+ if (callback.isUndefined())
+ return;
+
+ quint64 requestId = d->adapter->printToPDFCallbackResult(pageLayout);
+ d->m_callbacks.insert(requestId, callback);
+}
+
bool QQuickWebEngineView::isFullScreen() const
{
Q_D(const QQuickWebEngineView);
@@ -1179,7 +1324,7 @@ QQmlWebChannel *QQuickWebEngineView::webChannel()
if (!d->m_webChannel) {
d->m_webChannel = new QQmlWebChannel(this);
if (d->adapter)
- d->adapter->setWebChannel(d->m_webChannel);
+ d->adapter->setWebChannel(d->m_webChannel, d->m_webChannelWorld);
}
return d->m_webChannel;
@@ -1192,10 +1337,27 @@ void QQuickWebEngineView::setWebChannel(QQmlWebChannel *webChannel)
return;
d->m_webChannel = webChannel;
if (d->adapter)
- d->adapter->setWebChannel(webChannel);
+ d->adapter->setWebChannel(webChannel, d->m_webChannelWorld);
Q_EMIT webChannelChanged();
}
+uint QQuickWebEngineView::webChannelWorld() const
+{
+ Q_D(const QQuickWebEngineView);
+ return d->m_webChannelWorld;
+}
+
+void QQuickWebEngineView::setWebChannelWorld(uint webChannelWorld)
+{
+ Q_D(QQuickWebEngineView);
+ if (d->m_webChannelWorld == webChannelWorld)
+ return;
+ d->m_webChannelWorld = webChannelWorld;
+ if (d->adapter)
+ d->adapter->setWebChannel(d->m_webChannel, d->m_webChannelWorld);
+ Q_EMIT webChannelWorldChanged(webChannelWorld);
+}
+
void QQuickWebEngineView::grantFeaturePermission(const QUrl &securityOrigin, QQuickWebEngineView::Feature feature, bool granted)
{
if (!d_ptr->adapter)
@@ -1275,6 +1437,39 @@ void QQuickWebEngineView::itemChange(ItemChange change, const ItemChangeData &va
QQuickItem::itemChange(change, value);
}
+static QPoint mapToScreen(const QQuickItem *item, const QPoint &clientPos)
+{
+ return item->window()->position() + item->mapToScene(clientPos).toPoint();
+}
+
+void QQuickWebEngineView::dragEnterEvent(QDragEnterEvent *e)
+{
+ Q_D(QQuickWebEngineView);
+ e->accept();
+ d->adapter->enterDrag(e, mapToScreen(this, e->pos()));
+}
+
+void QQuickWebEngineView::dragLeaveEvent(QDragLeaveEvent *e)
+{
+ Q_D(QQuickWebEngineView);
+ e->accept();
+ d->adapter->leaveDrag();
+}
+
+void QQuickWebEngineView::dragMoveEvent(QDragMoveEvent *e)
+{
+ Q_D(QQuickWebEngineView);
+ e->accept();
+ d->adapter->updateDragPosition(e, mapToScreen(this, e->pos()));
+}
+
+void QQuickWebEngineView::dropEvent(QDropEvent *e)
+{
+ Q_D(QQuickWebEngineView);
+ e->accept();
+ d->adapter->endDragging(e->pos(), mapToScreen(this, e->pos()));
+}
+
void QQuickWebEngineView::triggerWebAction(WebAction action)
{
Q_D(QQuickWebEngineView);
@@ -1315,119 +1510,122 @@ void QQuickWebEngineView::triggerWebAction(WebAction action)
case PasteAndMatchStyle:
d->adapter->pasteAndMatchStyle();
break;
+ case Unselect:
+ d->adapter->unselect();
+ break;
case OpenLinkInThisWindow:
- if (d->contextMenuData.linkUrl.isValid())
- setUrl(d->contextMenuData.linkUrl);
+ if (d->contextMenuData.linkUrl().isValid())
+ setUrl(d->contextMenuData.linkUrl());
break;
case OpenLinkInNewWindow:
- if (d->contextMenuData.linkUrl.isValid()) {
+ if (d->contextMenuData.linkUrl().isValid()) {
QQuickWebEngineNewViewRequest request;
- request.m_requestedUrl = d->contextMenuData.linkUrl;
+ request.m_requestedUrl = d->contextMenuData.linkUrl();
request.m_isUserInitiated = true;
request.m_destination = NewViewInWindow;
Q_EMIT newViewRequested(&request);
}
break;
case OpenLinkInNewTab:
- if (d->contextMenuData.linkUrl.isValid()) {
+ if (d->contextMenuData.linkUrl().isValid()) {
QQuickWebEngineNewViewRequest request;
- request.m_requestedUrl = d->contextMenuData.linkUrl;
+ request.m_requestedUrl = d->contextMenuData.linkUrl();
request.m_isUserInitiated = true;
request.m_destination = NewViewInBackgroundTab;
Q_EMIT newViewRequested(&request);
}
break;
case CopyLinkToClipboard:
- if (d->contextMenuData.linkUrl.isValid()) {
- QString urlString = d->contextMenuData.linkUrl.toString(QUrl::FullyEncoded);
- QString title = d->contextMenuData.linkText.toHtmlEscaped();
+ if (d->contextMenuData.linkUrl().isValid()) {
+ QString urlString = d->contextMenuData.linkUrl().toString(QUrl::FullyEncoded);
+ QString title = d->contextMenuData.linkText().toHtmlEscaped();
QMimeData *data = new QMimeData();
data->setText(urlString);
QString html = QStringLiteral("<a href=\"") + urlString + QStringLiteral("\">") + title + QStringLiteral("</a>");
data->setHtml(html);
- data->setUrls(QList<QUrl>() << d->contextMenuData.linkUrl);
+ data->setUrls(QList<QUrl>() << d->contextMenuData.linkUrl());
qApp->clipboard()->setMimeData(data);
}
break;
case DownloadLinkToDisk:
- if (d->contextMenuData.linkUrl.isValid())
- d->adapter->download(d->contextMenuData.linkUrl, d->contextMenuData.suggestedFileName);
+ if (d->contextMenuData.linkUrl().isValid())
+ d->adapter->download(d->contextMenuData.linkUrl(), d->contextMenuData.d->suggestedFileName);
break;
case CopyImageToClipboard:
- if (d->contextMenuData.hasImageContent &&
- (d->contextMenuData.mediaType == WebEngineContextMenuData::MediaTypeImage ||
- d->contextMenuData.mediaType == WebEngineContextMenuData::MediaTypeCanvas))
+ if (d->contextMenuData.d->hasImageContent &&
+ (d->contextMenuData.mediaType() == QQuickWebEngineContextMenuData::MediaTypeImage ||
+ d->contextMenuData.mediaType() == QQuickWebEngineContextMenuData::MediaTypeCanvas))
{
- d->adapter->copyImageAt(d->contextMenuData.pos);
+ d->adapter->copyImageAt(d->contextMenuData.position());
}
break;
case CopyImageUrlToClipboard:
- if (d->contextMenuData.mediaUrl.isValid() && d->contextMenuData.mediaType == WebEngineContextMenuData::MediaTypeImage) {
- QString urlString = d->contextMenuData.mediaUrl.toString(QUrl::FullyEncoded);
- QString title = d->contextMenuData.linkText;
+ if (d->contextMenuData.mediaUrl().isValid() && d->contextMenuData.mediaType() == QQuickWebEngineContextMenuData::MediaTypeImage) {
+ QString urlString = d->contextMenuData.mediaUrl().toString(QUrl::FullyEncoded);
+ QString title = d->contextMenuData.linkText();
if (!title.isEmpty())
title = QStringLiteral(" alt=\"%1\"").arg(title.toHtmlEscaped());
QMimeData *data = new QMimeData();
data->setText(urlString);
QString html = QStringLiteral("<img src=\"") + urlString + QStringLiteral("\"") + title + QStringLiteral("></img>");
data->setHtml(html);
- data->setUrls(QList<QUrl>() << d->contextMenuData.mediaUrl);
+ data->setUrls(QList<QUrl>() << d->contextMenuData.mediaUrl());
qApp->clipboard()->setMimeData(data);
}
break;
case DownloadImageToDisk:
case DownloadMediaToDisk:
- if (d->contextMenuData.mediaUrl.isValid())
- d->adapter->download(d->contextMenuData.mediaUrl, d->contextMenuData.suggestedFileName);
+ if (d->contextMenuData.mediaUrl().isValid())
+ d->adapter->download(d->contextMenuData.mediaUrl(), d->contextMenuData.d->suggestedFileName);
break;
case CopyMediaUrlToClipboard:
- if (d->contextMenuData.mediaUrl.isValid() &&
- (d->contextMenuData.mediaType == WebEngineContextMenuData::MediaTypeAudio ||
- d->contextMenuData.mediaType == WebEngineContextMenuData::MediaTypeVideo))
+ if (d->contextMenuData.mediaUrl().isValid() &&
+ (d->contextMenuData.mediaType() == QQuickWebEngineContextMenuData::MediaTypeAudio ||
+ d->contextMenuData.mediaType() == QQuickWebEngineContextMenuData::MediaTypeVideo))
{
- QString urlString = d->contextMenuData.mediaUrl.toString(QUrl::FullyEncoded);
+ QString urlString = d->contextMenuData.mediaUrl().toString(QUrl::FullyEncoded);
QMimeData *data = new QMimeData();
data->setText(urlString);
- if (d->contextMenuData.mediaType == WebEngineContextMenuData::MediaTypeAudio)
+ if (d->contextMenuData.mediaType() == QQuickWebEngineContextMenuData::MediaTypeAudio)
data->setHtml(QStringLiteral("<audio src=\"") + urlString + QStringLiteral("\"></audio>"));
else
data->setHtml(QStringLiteral("<video src=\"") + urlString + QStringLiteral("\"></video>"));
- data->setUrls(QList<QUrl>() << d->contextMenuData.mediaUrl);
+ data->setUrls(QList<QUrl>() << d->contextMenuData.mediaUrl());
qApp->clipboard()->setMimeData(data);
}
break;
case ToggleMediaControls:
- if (d->contextMenuData.mediaUrl.isValid() && d->contextMenuData.mediaFlags & WebEngineContextMenuData::MediaCanToggleControls) {
- bool enable = !(d->contextMenuData.mediaFlags & WebEngineContextMenuData::MediaControls);
- d->adapter->executeMediaPlayerActionAt(d->contextMenuData.pos, WebContentsAdapter::MediaPlayerControls, enable);
+ if (d->contextMenuData.mediaUrl().isValid() && d->contextMenuData.d->mediaFlags & WebEngineContextMenuData::MediaCanToggleControls) {
+ bool enable = !(d->contextMenuData.d->mediaFlags & WebEngineContextMenuData::MediaControls);
+ d->adapter->executeMediaPlayerActionAt(d->contextMenuData.position(), WebContentsAdapter::MediaPlayerControls, enable);
}
break;
case ToggleMediaLoop:
- if (d->contextMenuData.mediaUrl.isValid() &&
- (d->contextMenuData.mediaType == WebEngineContextMenuData::MediaTypeAudio ||
- d->contextMenuData.mediaType == WebEngineContextMenuData::MediaTypeVideo))
+ if (d->contextMenuData.mediaUrl().isValid() &&
+ (d->contextMenuData.mediaType() == QQuickWebEngineContextMenuData::MediaTypeAudio ||
+ d->contextMenuData.mediaType() == QQuickWebEngineContextMenuData::MediaTypeVideo))
{
- bool enable = !(d->contextMenuData.mediaFlags & WebEngineContextMenuData::MediaLoop);
- d->adapter->executeMediaPlayerActionAt(d->contextMenuData.pos, WebContentsAdapter::MediaPlayerLoop, enable);
+ bool enable = !(d->contextMenuData.d->mediaFlags & WebEngineContextMenuData::MediaLoop);
+ d->adapter->executeMediaPlayerActionAt(d->contextMenuData.position(), WebContentsAdapter::MediaPlayerLoop, enable);
}
break;
case ToggleMediaPlayPause:
- if (d->contextMenuData.mediaUrl.isValid() &&
- (d->contextMenuData.mediaType == WebEngineContextMenuData::MediaTypeAudio ||
- d->contextMenuData.mediaType == WebEngineContextMenuData::MediaTypeVideo))
+ if (d->contextMenuData.mediaUrl().isValid() &&
+ (d->contextMenuData.mediaType() == QQuickWebEngineContextMenuData::MediaTypeAudio ||
+ d->contextMenuData.mediaType() == QQuickWebEngineContextMenuData::MediaTypeVideo))
{
- bool enable = (d->contextMenuData.mediaFlags & WebEngineContextMenuData::MediaPaused);
- d->adapter->executeMediaPlayerActionAt(d->contextMenuData.pos, WebContentsAdapter::MediaPlayerPlay, enable);
+ bool enable = (d->contextMenuData.d->mediaFlags & WebEngineContextMenuData::MediaPaused);
+ d->adapter->executeMediaPlayerActionAt(d->contextMenuData.position(), WebContentsAdapter::MediaPlayerPlay, enable);
}
break;
case ToggleMediaMute:
- if (d->contextMenuData.mediaUrl.isValid() && d->contextMenuData.mediaFlags & WebEngineContextMenuData::MediaHasAudio) {
- bool enable = !(d->contextMenuData.mediaFlags & WebEngineContextMenuData::MediaMuted);
- d->adapter->executeMediaPlayerActionAt(d->contextMenuData.pos, WebContentsAdapter::MediaPlayerMute, enable);
+ if (d->contextMenuData.mediaUrl().isValid() && d->contextMenuData.d->mediaFlags & WebEngineContextMenuData::MediaHasAudio) {
+ bool enable = !(d->contextMenuData.d->mediaFlags & WebEngineContextMenuData::MediaMuted);
+ d->adapter->executeMediaPlayerActionAt(d->contextMenuData.position(), WebContentsAdapter::MediaPlayerMute, enable);
}
break;
case InspectElement:
- d->adapter->inspectElementAt(d->contextMenuData.pos);
+ d->adapter->inspectElementAt(d->contextMenuData.position());
break;
case ExitFullScreen:
d->adapter->exitFullScreen();
@@ -1435,21 +1633,42 @@ void QQuickWebEngineView::triggerWebAction(WebAction action)
case RequestClose:
d->adapter->requestClose();
break;
+ case SavePage:
+ d->adapter->save();
+ break;
default:
Q_UNREACHABLE();
}
}
+const QQuickWebEngineContextMenuData *QQuickWebEngineViewExperimental::contextMenuData() const
+{
+ Q_D(const QQuickWebEngineView);
+ return &d->contextMenuData;
+}
+
+QSizeF QQuickWebEngineView::contentsSize() const
+{
+ Q_D(const QQuickWebEngineView);
+ return d->adapter->lastContentsSize();
+}
+
+QPointF QQuickWebEngineView::scrollPosition() const
+{
+ Q_D(const QQuickWebEngineView);
+ return d->adapter->lastScrollOffset();
+}
+
void QQuickWebEngineViewPrivate::userScripts_append(QQmlListProperty<QQuickWebEngineScript> *p, QQuickWebEngineScript *script)
{
Q_ASSERT(p && p->data);
QQuickWebEngineViewPrivate *d = static_cast<QQuickWebEngineViewPrivate*>(p->data);
- UserScriptControllerHost *scriptController = d->browserContextAdapter()->userScriptController();
+ UserResourceControllerHost *resourceController = d->browserContextAdapter()->userResourceController();
d->m_userScripts.append(script);
// If the adapter hasn't been instantiated, we'll bind the scripts in ensureContentsAdapter()
if (!d->adapter)
return;
- script->d_func()->bind(scriptController, d->adapter.data());
+ script->d_func()->bind(resourceController, d->adapter.data());
}
int QQuickWebEngineViewPrivate::userScripts_count(QQmlListProperty<QQuickWebEngineScript> *p)
@@ -1470,8 +1689,8 @@ void QQuickWebEngineViewPrivate::userScripts_clear(QQmlListProperty<QQuickWebEng
{
Q_ASSERT(p && p->data);
QQuickWebEngineViewPrivate *d = static_cast<QQuickWebEngineViewPrivate*>(p->data);
- UserScriptControllerHost *scriptController = d->browserContextAdapter()->userScriptController();
- scriptController->clearAllScripts(d->adapter.data());
+ UserResourceControllerHost *resourceController = d->browserContextAdapter()->userResourceController();
+ resourceController->clearAllScripts(d->adapter.data());
d->m_userScripts.clear();
}
diff --git a/src/webengine/api/qquickwebengineview_p.h b/src/webengine/api/qquickwebengineview_p.h
index 0654471cf..b9555d2d9 100644
--- a/src/webengine/api/qquickwebengineview_p.h
+++ b/src/webengine/api/qquickwebengineview_p.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** 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 http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** 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.LGPLv3 included in the
+** 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.html.
+** 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 later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** 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$
**
@@ -57,6 +60,8 @@ QT_BEGIN_NAMESPACE
class QQmlWebChannel;
class QQuickWebEngineCertificateError;
+class QQuickWebEngineContextMenuData;
+class QQuickWebEngineFaviconProvider;
class QQuickWebEngineHistory;
class QQuickWebEngineLoadRequest;
class QQuickWebEngineNavigationRequest;
@@ -89,7 +94,7 @@ private:
const bool m_toggleOn;
};
-#define LATEST_WEBENGINEVIEW_REVISION 2
+#define LATEST_WEBENGINEVIEW_REVISION 3
class Q_WEBENGINE_PRIVATE_EXPORT QQuickWebEngineView : public QQuickItem {
Q_OBJECT
@@ -109,6 +114,11 @@ class Q_WEBENGINE_PRIVATE_EXPORT QQuickWebEngineView : public QQuickItem {
Q_PROPERTY(QQmlListProperty<QQuickWebEngineScript> userScripts READ userScripts FINAL REVISION 1)
Q_PROPERTY(bool activeFocusOnPress READ activeFocusOnPress WRITE setActiveFocusOnPress NOTIFY activeFocusOnPressChanged REVISION 2)
Q_PROPERTY(QColor backgroundColor READ backgroundColor WRITE setBackgroundColor NOTIFY backgroundColorChanged REVISION 2)
+ Q_PROPERTY(QSizeF contentsSize READ contentsSize NOTIFY contentsSizeChanged FINAL REVISION 3)
+ Q_PROPERTY(QPointF scrollPosition READ scrollPosition NOTIFY scrollPositionChanged FINAL REVISION 3)
+ Q_PROPERTY(bool audioMuted READ isAudioMuted WRITE setAudioMuted NOTIFY audioMutedChanged FINAL REVISION 3)
+ Q_PROPERTY(bool recentlyAudible READ recentlyAudible NOTIFY recentlyAudibleChanged FINAL REVISION 3)
+ Q_PROPERTY(uint webChannelWorld READ webChannelWorld WRITE setWebChannelWorld NOTIFY webChannelWorldChanged REVISION 3)
#ifdef ENABLE_QML_TESTSUPPORT_API
Q_PROPERTY(QQuickWebEngineTestSupport *testSupport READ testSupport WRITE setTestSupport FINAL)
@@ -133,6 +143,8 @@ public:
void setZoomFactor(qreal arg);
QColor backgroundColor() const;
void setBackgroundColor(const QColor &color);
+ QSizeF contentsSize() const;
+ QPointF scrollPosition() const;
QQuickWebEngineViewExperimental *experimental() const;
@@ -229,7 +241,8 @@ public:
InspectElement,
ExitFullScreen,
RequestClose,
-
+ Unselect,
+ SavePage,
WebActionCount
};
Q_ENUM(WebAction)
@@ -257,6 +270,166 @@ public:
};
Q_DECLARE_FLAGS(FindFlags, FindFlag)
+ // must match QPageSize::PageSizeId
+ enum PrintedPageSizeId {
+ // Existing Qt sizes
+ A4,
+ B5,
+ Letter,
+ Legal,
+ Executive,
+ A0,
+ A1,
+ A2,
+ A3,
+ A5,
+ A6,
+ A7,
+ A8,
+ A9,
+ B0,
+ B1,
+ B10,
+ B2,
+ B3,
+ B4,
+ B6,
+ B7,
+ B8,
+ B9,
+ C5E,
+ Comm10E,
+ DLE,
+ Folio,
+ Ledger,
+ Tabloid,
+ Custom,
+
+ // New values derived from PPD standard
+ A10,
+ A3Extra,
+ A4Extra,
+ A4Plus,
+ A4Small,
+ A5Extra,
+ B5Extra,
+
+ JisB0,
+ JisB1,
+ JisB2,
+ JisB3,
+ JisB4,
+ JisB5,
+ JisB6,
+ JisB7,
+ JisB8,
+ JisB9,
+ JisB10,
+
+ // AnsiA = Letter,
+ // AnsiB = Ledger,
+ AnsiC,
+ AnsiD,
+ AnsiE,
+ LegalExtra,
+ LetterExtra,
+ LetterPlus,
+ LetterSmall,
+ TabloidExtra,
+
+ ArchA,
+ ArchB,
+ ArchC,
+ ArchD,
+ ArchE,
+
+ Imperial7x9,
+ Imperial8x10,
+ Imperial9x11,
+ Imperial9x12,
+ Imperial10x11,
+ Imperial10x13,
+ Imperial10x14,
+ Imperial12x11,
+ Imperial15x11,
+
+ ExecutiveStandard,
+ Note,
+ Quarto,
+ Statement,
+ SuperA,
+ SuperB,
+ Postcard,
+ DoublePostcard,
+ Prc16K,
+ Prc32K,
+ Prc32KBig,
+
+ FanFoldUS,
+ FanFoldGerman,
+ FanFoldGermanLegal,
+
+ EnvelopeB4,
+ EnvelopeB5,
+ EnvelopeB6,
+ EnvelopeC0,
+ EnvelopeC1,
+ EnvelopeC2,
+ EnvelopeC3,
+ EnvelopeC4,
+ // EnvelopeC5 = C5E,
+ EnvelopeC6,
+ EnvelopeC65,
+ EnvelopeC7,
+ // EnvelopeDL = DLE,
+
+ Envelope9,
+ // Envelope10 = Comm10E,
+ Envelope11,
+ Envelope12,
+ Envelope14,
+ EnvelopeMonarch,
+ EnvelopePersonal,
+
+ EnvelopeChou3,
+ EnvelopeChou4,
+ EnvelopeInvite,
+ EnvelopeItalian,
+ EnvelopeKaku2,
+ EnvelopeKaku3,
+ EnvelopePrc1,
+ EnvelopePrc2,
+ EnvelopePrc3,
+ EnvelopePrc4,
+ EnvelopePrc5,
+ EnvelopePrc6,
+ EnvelopePrc7,
+ EnvelopePrc8,
+ EnvelopePrc9,
+ EnvelopePrc10,
+ EnvelopeYou4,
+
+ // Last item, with commonly used synynoms from QPagedPrintEngine / QPrinter
+ LastPageSize = EnvelopeYou4,
+ NPageSize = LastPageSize,
+ NPaperSize = LastPageSize,
+
+ // Convenience overloads for naming consistency
+ AnsiA = Letter,
+ AnsiB = Ledger,
+ EnvelopeC5 = C5E,
+ EnvelopeDL = DLE,
+ Envelope10 = Comm10E
+ };
+ Q_ENUM(PrintedPageSizeId)
+
+ // must match QPageLayout::Orientation
+ enum PrintedPageOrientation {
+ Portrait,
+ Landscape
+ };
+ Q_ENUM(PrintedPageOrientation)
+
// QmlParserStatus
virtual void componentComplete() Q_DECL_OVERRIDE;
@@ -268,6 +441,12 @@ public:
QQmlWebChannel *webChannel();
void setWebChannel(QQmlWebChannel *);
QQuickWebEngineHistory *navigationHistory() const;
+ uint webChannelWorld() const;
+ void setWebChannelWorld(uint);
+
+ bool isAudioMuted() const;
+ void setAudioMuted(bool muted);
+ bool recentlyAudible() const;
#ifdef ENABLE_QML_TESTSUPPORT_API
QQuickWebEngineTestSupport *testSupport() const;
@@ -278,6 +457,7 @@ public:
public Q_SLOTS:
void runJavaScript(const QString&, const QJSValue & = QJSValue());
+ Q_REVISION(3) void runJavaScript(const QString&, quint32 worldId, const QJSValue & = QJSValue());
void loadHtml(const QString &html, const QUrl &baseUrl = QUrl());
void goBack();
void goForward();
@@ -290,7 +470,8 @@ public Q_SLOTS:
Q_REVISION(1) void grantFeaturePermission(const QUrl &securityOrigin, Feature, bool granted);
Q_REVISION(2) void setActiveFocusOnPress(bool arg);
Q_REVISION(2) void triggerWebAction(WebAction action);
-
+ Q_REVISION(3) void printToPdf(const QString &filePath, PrintedPageSizeId pageSizeId = PrintedPageSizeId::A4, PrintedPageOrientation orientation = PrintedPageOrientation::Portrait);
+ Q_REVISION(3) void printToPdf(const QJSValue &callback, PrintedPageSizeId pageSizeId = PrintedPageSizeId::A4, PrintedPageOrientation orientation = PrintedPageOrientation::Portrait);
private Q_SLOTS:
void lazyInitialize();
@@ -315,10 +496,19 @@ Q_SIGNALS:
Q_REVISION(2) void backgroundColorChanged();
Q_REVISION(2) void renderProcessTerminated(RenderProcessTerminationStatus terminationStatus, int exitCode);
Q_REVISION(2) void windowCloseRequested();
+ Q_REVISION(3) void contentsSizeChanged(const QSizeF& size);
+ Q_REVISION(3) void scrollPositionChanged(const QPointF& position);
+ Q_REVISION(3) void audioMutedChanged(bool muted);
+ Q_REVISION(3) void recentlyAudibleChanged(bool recentlyAudible);
+ Q_REVISION(3) void webChannelWorldChanged(uint);
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;
private:
Q_DECLARE_PRIVATE(QQuickWebEngineView)
@@ -327,6 +517,7 @@ private:
friend class QQuickWebEngineViewExperimental;
friend class QQuickWebEngineViewExperimentalExtension;
friend class QQuickWebEngineNewViewRequest;
+ friend class QQuickWebEngineFaviconProvider;
#ifndef QT_NO_ACCESSIBILITY
friend class QQuickWebEngineViewAccessible;
#endif // QT_NO_ACCESSIBILITY
diff --git a/src/webengine/api/qquickwebengineview_p_p.h b/src/webengine/api/qquickwebengineview_p_p.h
index 0fd187ab3..769e41a44 100644
--- a/src/webengine/api/qquickwebengineview_p_p.h
+++ b/src/webengine/api/qquickwebengineview_p_p.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** 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 http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** 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.LGPLv3 included in the
+** 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.html.
+** 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 later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** 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$
**
@@ -49,6 +52,7 @@
//
#include "qquickwebengineview_p.h"
+#include "qquickwebenginecontextmenudata_p.h"
#include "web_contents_adapter_client.h"
#include <QScopedPointer>
@@ -67,6 +71,7 @@ class QQuickWebEngineView;
class QQmlComponent;
class QQmlContext;
class QQuickWebEngineSettings;
+class QQuickWebEngineFaviconProvider;
QQuickWebEngineView::WebAction editorActionForKeyEvent(QKeyEvent* event);
@@ -96,13 +101,17 @@ class Q_WEBENGINE_PRIVATE_EXPORT QQuickWebEngineViewExperimental : public QObjec
Q_OBJECT
Q_PROPERTY(QQuickWebEngineViewport *viewport READ viewport)
Q_PROPERTY(QQmlComponent *extraContextMenuEntriesComponent READ extraContextMenuEntriesComponent WRITE setExtraContextMenuEntriesComponent NOTIFY extraContextMenuEntriesComponentChanged)
+ Q_PROPERTY(const QQuickWebEngineContextMenuData *contextMenuData READ contextMenuData NOTIFY contextMenuDataChanged)
QQuickWebEngineViewport *viewport() const;
void setExtraContextMenuEntriesComponent(QQmlComponent *);
QQmlComponent *extraContextMenuEntriesComponent() const;
+ const QQuickWebEngineContextMenuData *contextMenuData() const;
+
Q_SIGNALS:
void extraContextMenuEntriesComponentChanged();
+ void contextMenuDataChanged();
private:
QQuickWebEngineViewExperimental(QQuickWebEngineViewPrivate* viewPrivate);
@@ -133,6 +142,7 @@ public:
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;
@@ -152,10 +162,12 @@ public:
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(QtWebEngineCore::FilePickerController *controller) 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 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;
@@ -173,10 +185,15 @@ public:
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;
+ 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;
const QObject *holdingQObject() const Q_DECL_OVERRIDE;
virtual QSharedPointer<QtWebEngineCore::BrowserContextAdapter> browserContextAdapter() Q_DECL_OVERRIDE;
+ QtWebEngineCore::WebContentsAdapter *webContentsAdapter() Q_DECL_OVERRIDE;
void setDevicePixelRatio(qreal);
void adoptWebContents(QtWebEngineCore::WebContentsAdapter *webContents);
@@ -200,9 +217,10 @@ public:
QQuickWebEngineTestSupport *m_testSupport;
#endif
QQmlComponent *contextMenuExtraItems;
- QtWebEngineCore::WebEngineContextMenuData contextMenuData;
+ QQuickWebEngineContextMenuData contextMenuData;
QUrl explicitUrl;
- QUrl icon;
+ QUrl iconUrl;
+ QQuickWebEngineFaviconProvider *faviconProvider;
int loadProgress;
bool m_fullscreenMode;
bool isLoading;
@@ -211,6 +229,7 @@ public:
QMap<quint64, QJSValue> m_callbacks;
QList<QSharedPointer<CertificateErrorController> > m_certificateErrorControllers;
QQmlWebChannel *m_webChannel;
+ uint m_webChannelWorld;
private:
QScopedPointer<QtWebEngineCore::UIDelegatesManager> m_uIDelegatesManager;
diff --git a/src/webengine/api/qtwebengineglobal.cpp b/src/webengine/api/qtwebengineglobal.cpp
index 21c0dc2a7..a242fc6aa 100644
--- a/src/webengine/api/qtwebengineglobal.cpp
+++ b/src/webengine/api/qtwebengineglobal.cpp
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** 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 http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** 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.LGPLv3 included in the
+** 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.html.
+** 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 later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** 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$
**
diff --git a/src/webengine/api/qtwebengineglobal.h b/src/webengine/api/qtwebengineglobal.h
index ad549fae1..2d83be674 100644
--- a/src/webengine/api/qtwebengineglobal.h
+++ b/src/webengine/api/qtwebengineglobal.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** 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 http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** 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.LGPLv3 included in the
+** 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.html.
+** 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 later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** 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$
**
diff --git a/src/webengine/api/qtwebengineglobal_p.h b/src/webengine/api/qtwebengineglobal_p.h
index e929c93ce..7058bef09 100644
--- a/src/webengine/api/qtwebengineglobal_p.h
+++ b/src/webengine/api/qtwebengineglobal_p.h
@@ -1,7 +1,7 @@
/****************************************************************************
**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Contact: http://www.qt.io/licensing/
+** Copyright (C) 2016 The Qt Company Ltd.
+** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtWebEngine module of the Qt Toolkit.
**
@@ -11,24 +11,27 @@
** 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 http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
+** 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.LGPLv3 included in the
+** 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.html.
+** 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 later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
+** 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$
**