summaryrefslogtreecommitdiffstats
path: root/src/webengine
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@theqtcompany.com>2015-12-03 19:36:29 +0100
committerLiang Qi <liang.qi@theqtcompany.com>2015-12-03 19:36:29 +0100
commit90d3044e3a6ad58819be6787b5edcbc9daa948dc (patch)
tree27d54322988fe60a420bbb058608b9b9d637329b /src/webengine
parent03301c0fbdf034fb987e1c1ed1bec7c206dcd27e (diff)
parentd0ae9b50cc01e4c0f65f17467276d4af40284ae1 (diff)
Merge remote-tracking branch 'origin/5.6' into dev
Diffstat (limited to 'src/webengine')
-rw-r--r--src/webengine/api/qquickwebengineprofile.cpp8
-rw-r--r--src/webengine/api/qquickwebengineprofile_p.h4
-rw-r--r--src/webengine/api/qquickwebenginescript.cpp3
-rw-r--r--src/webengine/api/qquickwebengineview.cpp18
-rw-r--r--src/webengine/doc/src/qtwebengine-index.qdoc23
-rw-r--r--src/webengine/doc/src/qtwebengine-overview.qdoc2
-rw-r--r--src/webengine/doc/src/qtwebengine-platform-notes.qdoc30
-rw-r--r--src/webengine/doc/src/qtwebengine-qmlmodule.qdoc10
-rw-r--r--src/webengine/plugin/plugins.qmltypes2
9 files changed, 67 insertions, 33 deletions
diff --git a/src/webengine/api/qquickwebengineprofile.cpp b/src/webengine/api/qquickwebengineprofile.cpp
index a678fe5fa..303f038a8 100644
--- a/src/webengine/api/qquickwebengineprofile.cpp
+++ b/src/webengine/api/qquickwebengineprofile.cpp
@@ -40,7 +40,7 @@
#include "qquickwebenginedownloaditem_p_p.h"
#include "qquickwebengineprofile_p_p.h"
#include "qquickwebenginesettings_p.h"
-#include "qwebenginecookiestoreclient.h"
+#include "qwebenginecookiestore.h"
#include <QQmlEngine>
@@ -165,6 +165,8 @@ void QQuickWebEngineProfilePrivate::downloadUpdated(const DownloadItemInfo &info
QQuickWebEngineProfile::QQuickWebEngineProfile()
: d_ptr(new QQuickWebEngineProfilePrivate(new BrowserContextAdapter(false)))
{
+ // Sets up the global WebEngineContext
+ QQuickWebEngineProfile::defaultProfile();
d_ptr->q_ptr = this;
}
@@ -419,10 +421,10 @@ QQuickWebEngineProfile *QQuickWebEngineProfile::defaultProfile()
return profile;
}
-QWebEngineCookieStoreClient *QQuickWebEngineProfile::cookieStoreClient() const
+QWebEngineCookieStore *QQuickWebEngineProfile::cookieStore() const
{
const Q_D(QQuickWebEngineProfile);
- return d->browserContext()->cookieStoreClient();
+ return d->browserContext()->cookieStore();
}
QQuickWebEngineSettings *QQuickWebEngineProfile::settings() const
diff --git a/src/webengine/api/qquickwebengineprofile_p.h b/src/webengine/api/qquickwebengineprofile_p.h
index 1ed15aec2..5839d51a5 100644
--- a/src/webengine/api/qquickwebengineprofile_p.h
+++ b/src/webengine/api/qquickwebengineprofile_p.h
@@ -63,7 +63,7 @@ QT_BEGIN_NAMESPACE
class QQuickWebEngineDownloadItem;
class QQuickWebEngineProfilePrivate;
class QQuickWebEngineSettings;
-class QWebEngineCookieStoreClient;
+class QWebEngineCookieStore;
class Q_WEBENGINE_PRIVATE_EXPORT QQuickWebEngineProfile : public QObject {
Q_OBJECT
@@ -122,7 +122,7 @@ public:
static QQuickWebEngineProfile *defaultProfile();
- Q_REVISION(1) Q_INVOKABLE QWebEngineCookieStoreClient *cookieStoreClient() const;
+ Q_REVISION(1) Q_INVOKABLE QWebEngineCookieStore *cookieStore() const;
signals:
void storageNameChanged();
diff --git a/src/webengine/api/qquickwebenginescript.cpp b/src/webengine/api/qquickwebenginescript.cpp
index affffbf46..71dad701f 100644
--- a/src/webengine/api/qquickwebenginescript.cpp
+++ b/src/webengine/api/qquickwebenginescript.cpp
@@ -37,6 +37,7 @@
#include "qquickwebenginescript_p.h"
#include "qquickwebenginescript_p_p.h"
+#include <QQmlFile>
#include <QtCore/QDebug>
#include <QtCore/QFile>
#include <QtCore/QStringBuilder>
@@ -178,7 +179,7 @@ void QQuickWebEngineScript::setSourceUrl(QUrl arg)
d->m_sourceUrl = arg;
Q_EMIT sourceUrlChanged(d->m_sourceUrl);
- QFile f(arg.toLocalFile());
+ QFile f(QQmlFile::urlToLocalFileOrQrc(arg));
if (!f.open(QIODevice::ReadOnly)) {
qWarning() << "Can't open user script " << arg;
return;
diff --git a/src/webengine/api/qquickwebengineview.cpp b/src/webengine/api/qquickwebengineview.cpp
index 19ef590b8..9e0da060e 100644
--- a/src/webengine/api/qquickwebengineview.cpp
+++ b/src/webengine/api/qquickwebengineview.cpp
@@ -669,6 +669,18 @@ QAccessible::State QQuickWebEngineViewAccessible::state() const
}
#endif // QT_NO_ACCESSIBILITY
+class WebContentsAdapterOwner : public QObject
+{
+public:
+ typedef QExplicitlySharedDataPointer<QtWebEngineCore::WebContentsAdapter> AdapterPtr;
+ WebContentsAdapterOwner(const AdapterPtr &ptr)
+ : adapter(ptr)
+ {}
+
+private:
+ AdapterPtr adapter;
+};
+
void QQuickWebEngineViewPrivate::adoptWebContents(WebContentsAdapter *webContents)
{
if (!webContents) {
@@ -692,6 +704,8 @@ void QQuickWebEngineViewPrivate::adoptWebContents(WebContentsAdapter *webContent
// This throws away the WebContentsAdapter that has been used until now.
// All its states, particularly the loading URL, are replaced by the adopted WebContentsAdapter.
+ WebContentsAdapterOwner *adapterOwner = new WebContentsAdapterOwner(adapter);
+ adapterOwner->deleteLater();
adapter = webContents;
adapter->initialize(this);
@@ -875,8 +889,12 @@ void QQuickWebEngineViewPrivate::setProfile(QQuickWebEngineProfile *profile)
if (adapter && adapter->browserContext() != browserContextAdapter()->browserContext()) {
// When the profile changes we need to create a new WebContentAdapter and reload the active URL.
QUrl activeUrl = adapter->activeUrl();
+ QQmlWebChannel *qmlWebChannel = qobject_cast<QQmlWebChannel *>(adapter->webChannel());
adapter = 0;
ensureContentsAdapter();
+ if (qmlWebChannel)
+ adapter->setWebChannel(qmlWebChannel);
+
if (!explicitUrl.isValid() && activeUrl.isValid())
adapter->load(activeUrl);
}
diff --git a/src/webengine/doc/src/qtwebengine-index.qdoc b/src/webengine/doc/src/qtwebengine-index.qdoc
index 671425e75..e30976ef3 100644
--- a/src/webengine/doc/src/qtwebengine-index.qdoc
+++ b/src/webengine/doc/src/qtwebengine-index.qdoc
@@ -42,29 +42,6 @@
\annotatedlist qtwebengine-qmlmodules
- \section1 Getting Started
-
- To include the definitions of the Qt WebEngineCore and Qt WebEngineWidgets modules' classes, use
- the following directives:
-
- \badcode
- #include <QtWebEngineCore>
- #include <QtWebEngineWidgets>
- \endcode
-
- To import the Qt WebEngine module's QML types, add the following import statement to your .qml
- file:
-
- \badcode
- import QtWebEngine 1.2
- \endcode
-
- To link against the modules, add QT variables to your qmake .pro file:
-
- \badcode
- QT += webengine webenginecore webenginewidgets
- \endcode
-
\section1 Articles and Guides
\list
diff --git a/src/webengine/doc/src/qtwebengine-overview.qdoc b/src/webengine/doc/src/qtwebengine-overview.qdoc
index cfe731c01..8be4adda0 100644
--- a/src/webengine/doc/src/qtwebengine-overview.qdoc
+++ b/src/webengine/doc/src/qtwebengine-overview.qdoc
@@ -140,7 +140,7 @@
schemes. Requests for the scheme are then issued to QWebEngineUrlSchemeHandler::requestStarted()
as QWebEngineUrlRequestJob objects.
- The QWebEngineCookieStoreClient class provides functions for accessing HTTP cookies of Chromium.
+ The QWebEngineCookieStore class provides functions for accessing HTTP cookies of Chromium.
The functions can be used to synchronize cookies with QNetworkAccessManager, as well as to set,
delete, and intercept cookies during navigation.
diff --git a/src/webengine/doc/src/qtwebengine-platform-notes.qdoc b/src/webengine/doc/src/qtwebengine-platform-notes.qdoc
index fdaa4f861..0898a72fc 100644
--- a/src/webengine/doc/src/qtwebengine-platform-notes.qdoc
+++ b/src/webengine/doc/src/qtwebengine-platform-notes.qdoc
@@ -49,4 +49,34 @@
\li Linux: Clang or GCC version 4.7 or later
\li OS X: Xcode version 5.1 or later
\endlist
+
+ \section1 Adobe Flash Player Plugin Support
+
+ Qt WebEngine supports the Adobe Flash player plugin that is a Pepper Plugin API (PPAPI)
+ plugin. The plugin must be installed in one of the following locations, depending on the
+ platform:
+
+ \list
+ \li Windows
+ \code
+ C:\Windows\SysWOW64\Macromed\Flash\pepflashplayer*.dll
+ C:\Windows\System32\Macromed\Flash\pepflashplayer*.dll
+ \endcode
+ \li OS X
+ \code
+ /Library/Internet Plug-Ins/PepperFlashPlayer/PepperFlashPlayer.plugin
+ \endcode
+ \li Linux
+ \code
+ /usr/lib/pepperflashplugin-nonfree/libpepflashplayer.so
+ /usr/lib/PepperFlash/libpepflashplayer.so
+ /usr/lib64/chromium/PepperFlash/libpepflashplayer.so
+ \endcode
+ \endlist
+
+ You can also load the Flash player from a specific location by using command line arguments:
+
+ \code
+ --ppapi-flash-path=./libpepflashplayer.so
+ \endcode
*/
diff --git a/src/webengine/doc/src/qtwebengine-qmlmodule.qdoc b/src/webengine/doc/src/qtwebengine-qmlmodule.qdoc
index e098071b3..89ff6f0b3 100644
--- a/src/webengine/doc/src/qtwebengine-qmlmodule.qdoc
+++ b/src/webengine/doc/src/qtwebengine-qmlmodule.qdoc
@@ -33,7 +33,13 @@
your .qml file:
\badcode
- import QtQuick 2.0
- import QtWebEngine 1.1
+ import QtWebEngine 1.2
+ \endcode
+
+ To link against the module, add the following QT variable to your qmake .pro
+ file:
+
+ \badcode
+ QT += webengine
\endcode
*/
diff --git a/src/webengine/plugin/plugins.qmltypes b/src/webengine/plugin/plugins.qmltypes
index 7a310d268..4fce34a21 100644
--- a/src/webengine/plugin/plugins.qmltypes
+++ b/src/webengine/plugin/plugins.qmltypes
@@ -611,7 +611,7 @@ Module {
name: "downloadFinished"
Parameter { name: "download"; type: "QQuickWebEngineDownloadItem"; isPointer: true }
}
- Method { name: "cookieStoreClient"; revision: 1; type: "QWebEngineCookieStoreClient*" }
+ Method { name: "cookieStore"; revision: 1; type: "QWebEngineCookieStore*" }
}
Component {
name: "QQuickWebEngineScript"