diff options
author | Liang Qi <liang.qi@theqtcompany.com> | 2015-04-08 21:25:16 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@theqtcompany.com> | 2015-04-08 21:25:16 +0200 |
commit | c0bed8e4144232c59107970184be58a2435c7bdc (patch) | |
tree | a603b608206a563fe74673f84fede43e6b837174 /src | |
parent | 19dfb1a5c1878f996a8427addb61af39673c0f8b (diff) | |
parent | 12ac4dd0d8d7e5fa33043d86e2effa77183f3122 (diff) |
Merge remote-tracking branch 'origin/5.5' into dev
Change-Id: I7b0dae978357c6f48826ad8e09a8cb8477d1901d
Diffstat (limited to 'src')
m--------- | src/3rdparty | 0 | ||||
-rw-r--r-- | src/core/content_main_delegate_qt.cpp | 6 | ||||
-rw-r--r-- | src/core/web_contents_adapter.cpp | 7 | ||||
-rw-r--r-- | src/core/web_contents_adapter.h | 1 | ||||
-rw-r--r-- | src/webengine/api/qquickwebenginecertificateerror.cpp | 31 | ||||
-rw-r--r-- | src/webengine/api/qquickwebenginescript.cpp | 21 | ||||
-rw-r--r-- | src/webengine/api/qquickwebengineview.cpp | 9 | ||||
-rw-r--r-- | src/webengine/api/qquickwebengineview_p.h | 1 | ||||
-rw-r--r-- | src/webengine/doc/src/qquickwebengineview_lgpl.qdoc | 32 | ||||
-rw-r--r-- | src/webenginewidgets/api/qwebenginepage.cpp | 3 | ||||
-rw-r--r-- | src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc | 11 |
11 files changed, 111 insertions, 11 deletions
diff --git a/src/3rdparty b/src/3rdparty -Subproject c148371e72d900b48cc4790b9e78c6dc1703051 +Subproject 6b1784803e5333987c5e86087ec782a3eaacfa7 diff --git a/src/core/content_main_delegate_qt.cpp b/src/core/content_main_delegate_qt.cpp index 7c2dde8c4..b8e40a448 100644 --- a/src/core/content_main_delegate_qt.cpp +++ b/src/core/content_main_delegate_qt.cpp @@ -40,8 +40,6 @@ #include "base/logging.h" #include "base/path_service.h" #include "base/strings/string_number_conversions.h" -#include "content/public/browser/browser_ipc_logging.h" -#include "content/public/browser/browser_thread.h" #include "content/public/common/content_paths.h" #include "content/public/common/content_switches.h" #include "ui/base/l10n/l10n_util.h" @@ -83,10 +81,6 @@ void ContentMainDelegateQt::PreSandboxStartup() } logging::SetMinLogLevel(logLevel); - -#if defined(IPC_MESSAGE_LOG_ENABLED) - content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE, base::Bind(&content::EnableIPCLogging, true)); -#endif } content::ContentBrowserClient *ContentMainDelegateQt::CreateContentBrowserClient() diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp index 9f1000910..718003c45 100644 --- a/src/core/web_contents_adapter.cpp +++ b/src/core/web_contents_adapter.cpp @@ -440,6 +440,13 @@ void WebContentsAdapter::reload() d->webContents->Focus(); } +void WebContentsAdapter::reloadAndBypassCache() +{ + Q_D(WebContentsAdapter); + d->webContents->GetController().ReloadIgnoringCache(/*checkRepost = */false); + d->webContents->Focus(); +} + void WebContentsAdapter::load(const QUrl &url) { // The situation can occur when relying on the editingFinished signal in QML to set the url diff --git a/src/core/web_contents_adapter.h b/src/core/web_contents_adapter.h index 2973f9948..7f644cdd2 100644 --- a/src/core/web_contents_adapter.h +++ b/src/core/web_contents_adapter.h @@ -74,6 +74,7 @@ public: bool canGoForward() const; void stop(); void reload(); + void reloadAndBypassCache(); void load(const QUrl&); void setContent(const QByteArray &data, const QString &mimeType, const QUrl &baseUrl); QUrl activeUrl() const; diff --git a/src/webengine/api/qquickwebenginecertificateerror.cpp b/src/webengine/api/qquickwebenginecertificateerror.cpp index a39bbfb84..010c66be5 100644 --- a/src/webengine/api/qquickwebenginecertificateerror.cpp +++ b/src/webengine/api/qquickwebenginecertificateerror.cpp @@ -58,8 +58,6 @@ public: bool answered; }; - - /*! \qmltype WebEngineCertificateError \instantiates QQuickWebEngineCertificateError @@ -71,7 +69,7 @@ public: This class contains information about a certificate error that happened and provides a way to accept or deny a certificate exception. - \sa WebEngineView::certificateError + \sa WebEngineCertificateError::certificateError */ QQuickWebEngineCertificateError::QQuickWebEngineCertificateError(const QSharedPointer<CertificateErrorController> &controller, QObject *parent) : QObject(parent) @@ -131,7 +129,9 @@ void QQuickWebEngineCertificateError::rejectCertificate() /*! \qmlproperty url WebEngineCertificateError::url - \brief The URL of the certificate error. + \readonly + + The URL that triggered the error. */ QUrl QQuickWebEngineCertificateError::url() const { @@ -144,6 +144,23 @@ QUrl QQuickWebEngineCertificateError::url() const /*! \qmlproperty enumeration WebEngineCertificateError::error + \readonly + + The type of the error. + + \value SslPinnedKeyNotInCertificateChain The certificate did not match the built-in public key pins for the host name. + \value CertificateCommonNameInvalid The certificate's common name did not match the host name. + \value CertificateDateInvalid The certificate is not valid at the current date and time. + \value CertificateAuthorityInvalid The certificate is not signed by a trusted authority. + \value CertificateContainsErrors The certificate contains errors. + \value CertificateNoRevocationMechanism The certificate has no mechanism for determining if it has been revoked. + \value CertificateUnableToCheckRevocation Revocation information for the certificate is not available. + \value CertificateRevoked The certificate has been revoked. + \value CertificateInvalid The certificate is invalid. + \value CertificateWeakSignatureAlgorithm The certificate is signed using a weak signature algorithm. + \value CertificateNonUniqueName The host name specified in the certificate is not unique. + \value CertificateWeakKey The certificate contains a weak key. + \value CertificateNameConstraintViolation The certificate claimed DNS names that are in violation of name constraints. */ QQuickWebEngineCertificateError::Error QQuickWebEngineCertificateError::error() const { @@ -153,6 +170,9 @@ QQuickWebEngineCertificateError::Error QQuickWebEngineCertificateError::error() /*! \qmlproperty string WebEngineCertificateError::description + \readonly + + A short localized human-readable description of the error. */ QString QQuickWebEngineCertificateError::description() const { @@ -162,6 +182,9 @@ QString QQuickWebEngineCertificateError::description() const /*! \qmlproperty bool WebEngineCertificateError::overridable + \readonly + + A boolean that indicates if the certificate error can be overridden and accepted. */ bool QQuickWebEngineCertificateError::overridable() const { diff --git a/src/webengine/api/qquickwebenginescript.cpp b/src/webengine/api/qquickwebenginescript.cpp index eb3a41dd5..affffbf46 100644 --- a/src/webengine/api/qquickwebenginescript.cpp +++ b/src/webengine/api/qquickwebenginescript.cpp @@ -84,12 +84,33 @@ QString QQuickWebEngineScript::name() const return d->coreScript.name(); } +/*! + \qmlproperty url WebEngineScript::sourceUrl + + This property holds the remote source location of the user script (if any). + + Unlike \l sourceCode, this property allows referring to user scripts that + are not already loaded in memory, for instance, when stored on disk. + + Setting this property will change the \l sourceCode of the script. + + \note At present, only file-based sources are supported. + + \sa sourceCode +*/ QUrl QQuickWebEngineScript::sourceUrl() const { Q_D(const QQuickWebEngineScript); return d->m_sourceUrl; } +/*! + \qmlproperty string WebEngineScript::sourceCode + + This property holds the JavaScript source code of the user script. + + \sa sourceUrl +*/ QString QQuickWebEngineScript::sourceCode() const { Q_D(const QQuickWebEngineScript); diff --git a/src/webengine/api/qquickwebengineview.cpp b/src/webengine/api/qquickwebengineview.cpp index 5c3ca2634..7bca4e3cd 100644 --- a/src/webengine/api/qquickwebengineview.cpp +++ b/src/webengine/api/qquickwebengineview.cpp @@ -442,7 +442,6 @@ bool QQuickWebEngineViewPrivate::isFullScreen() const void QQuickWebEngineViewPrivate::javaScriptConsoleMessage(JavaScriptConsoleMessageLevel level, const QString& message, int lineNumber, const QString& sourceID) { Q_Q(QQuickWebEngineView); - Q_UNUSED(level); Q_EMIT q->javaScriptConsoleMessage(static_cast<QQuickWebEngineView::JavaScriptConsoleMessageLevel>(level), message, lineNumber, sourceID); } @@ -667,6 +666,14 @@ void QQuickWebEngineView::reload() d->adapter->reload(); } +void QQuickWebEngineView::reloadAndBypassCache() +{ + Q_D(QQuickWebEngineView); + if (!d->adapter) + return; + d->adapter->reloadAndBypassCache(); +} + void QQuickWebEngineView::stop() { Q_D(QQuickWebEngineView); diff --git a/src/webengine/api/qquickwebengineview_p.h b/src/webengine/api/qquickwebengineview_p.h index c84a65805..4539ad34b 100644 --- a/src/webengine/api/qquickwebengineview_p.h +++ b/src/webengine/api/qquickwebengineview_p.h @@ -207,6 +207,7 @@ public Q_SLOTS: void goForward(); void goBackOrForward(int index); void reload(); + void reloadAndBypassCache(); void stop(); Q_REVISION(1) void findText(const QString &subString, FindFlags options = 0, const QJSValue &callback = QJSValue()); Q_REVISION(1) void fullScreenCancelled(); diff --git a/src/webengine/doc/src/qquickwebengineview_lgpl.qdoc b/src/webengine/doc/src/qquickwebengineview_lgpl.qdoc index 035d4a382..6d04473d3 100644 --- a/src/webengine/doc/src/qquickwebengineview_lgpl.qdoc +++ b/src/webengine/doc/src/qquickwebengineview_lgpl.qdoc @@ -301,6 +301,26 @@ */ /*! + \qmlsignal WebEngineView::certificateError(error) + + This signal is emitted when an invalid certificate error is raised while loading a given request. + + The certificate error can be rejected by calling WebEngineCertificateError::rejectCertificate, + which will stop loading the request. + + The certificate error can be ignored by calling WebEngineCertificateError::ignoreCertificateError + which will resume loading the request. + + It is possible to defer the decision of rejecting the given certificate by calling + WebEngineCertificateError::defer, which is useful when waiting for user input. + By default the invalid certificate will be automatically rejected. + + The corresponding handler is onCertificateError. + + \sa WebEngineCertificateError +*/ + +/*! \qmlsignal WebEngineView::linkHovered(hoveredUrl) Within a mouse-driven interface, this signal is emitted when a mouse @@ -313,6 +333,18 @@ */ /*! + \qmlsignal WebEngineView::javaScriptConsoleMessage(JavaScriptConsoleMessageLevel level, message, lineNumber, sourceID) + This signal is emitted when a JavaScript program tries to print a \a message to the web browser's console. + + For example in case of evaluation errors the source URL may be provided in \a sourceID as well as the \a lineNumber. + + \a level indicates the severity of the event that triggered the message, i.e. if it + was triggered by an error or a less severe event. + + The corresponding handler is onJavaScriptConsoleMessage. +*/ + +/*! \qmlsignal WebEngineView::newViewRequested(request) This signal is emitted when a page load is requested to happen in a separate diff --git a/src/webenginewidgets/api/qwebenginepage.cpp b/src/webenginewidgets/api/qwebenginepage.cpp index 0f79bbf47..7eb29a185 100644 --- a/src/webenginewidgets/api/qwebenginepage.cpp +++ b/src/webenginewidgets/api/qwebenginepage.cpp @@ -647,6 +647,9 @@ void QWebEnginePage::triggerAction(WebAction action, bool) case Reload: d->adapter->reload(); break; + case ReloadAndBypassCache: + d->adapter->reloadAndBypassCache(); + break; case Cut: d->adapter->cut(); break; diff --git a/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc b/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc index f5aa64eed..3088a66b6 100644 --- a/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc +++ b/src/webenginewidgets/doc/src/qwebenginepage_lgpl.qdoc @@ -346,6 +346,17 @@ */ /*! + \fn bool QWebEnginePage::certificateError(const QWebEngineCertificateError & certificateError) + This function is called when an invalid certificate error is raised while loading a given request. + + The \a certificateError parameter contains information about the certificate and details of the error. + + Return true to ignore the error and complete the request, otherwise return false to stop loading the request. + + \sa QWebEngineCertificateError +*/ + +/*! \fn QString QWebEnginePage::chooseFiles(FileSelectionMode mode, const QStringList& oldFiles, const QStringList& acceptedMimeTypes) This function is called when the web content requests a file name, for example as a result of the user clicking on a "file upload" button in a HTML form. |