From fe8ae4b78065916e1882aaedc5994d66a8456df4 Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Thu, 6 Oct 2016 11:14:05 +0200 Subject: Doc: Set the correct indexTitle for C++ Classes page ... and mention namespaces in the title, listing the namespaces with a group selector. Change-Id: I06056beba464a441ab56cb0acbfb0440c0878f0d Task-number: QTBUG-56298 Reviewed-by: Leena Miettinen --- src/webengine/doc/qtwebengine.qdocconf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/webengine/doc/qtwebengine.qdocconf b/src/webengine/doc/qtwebengine.qdocconf index 009902080..6fd93dc20 100644 --- a/src/webengine/doc/qtwebengine.qdocconf +++ b/src/webengine/doc/qtwebengine.qdocconf @@ -18,9 +18,9 @@ qhp.QtWebEngine.customFilters.Qt.filterAttributes = qtwebengine $QT_VERSION qhp.QtWebEngine.subprojects = classes qmltypes examples -qhp.QtWebEngine.subprojects.classes.title = C++ Classes -qhp.QtWebEngine.subprojects.classes.indexTitle = Qt WebEngine C++ Classes -qhp.QtWebEngine.subprojects.classes.selectors = class doc:headerfile +qhp.QtWebEngine.subprojects.classes.title = C++ Classes and Namespaces +qhp.QtWebEngine.subprojects.classes.indexTitle = Qt WebEngine C++ Classes and Namespaces +qhp.QtWebEngine.subprojects.classes.selectors = class group:qtwebengine-namespaces doc:headerfile qhp.QtWebEngine.subprojects.classes.sortPages = true qhp.QtWebEngine.subprojects.qmltypes.title = QML Types -- cgit v1.2.3 From cdfa03ad7472eb374b2434926d058cf570bc4e37 Mon Sep 17 00:00:00 2001 From: Viktor Engelmann Date: Fri, 7 Oct 2016 13:39:47 +0200 Subject: Consider multiple contents in mimeDataFromDropData conversion content::DropData can have multiple contents (e.g. an tag has itself as .html property, but also the src="..." attribute as .url property. Therefore, we should always consider all 3 cases and not return immediately when we have found the first content. Task-number: QTBUG-55858 Change-Id: Ie13851e8edb9ada45184a19b6ccfe38839bb9923 Reviewed-by: Allan Sandfeld Jensen --- src/core/web_contents_adapter.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp index bfac6a5b2..7285648fd 100644 --- a/src/core/web_contents_adapter.cpp +++ b/src/core/web_contents_adapter.cpp @@ -1059,18 +1059,12 @@ void WebContentsAdapter::setWebChannel(QWebChannel *channel, uint worldId) static QMimeData *mimeDataFromDropData(const content::DropData &dropData) { QMimeData *mimeData = new QMimeData(); - if (!dropData.text.is_null()) { + if (!dropData.text.is_null()) mimeData->setText(toQt(dropData.text.string())); - return mimeData; - } - if (!dropData.html.is_null()) { + if (!dropData.html.is_null()) mimeData->setHtml(toQt(dropData.html.string())); - return mimeData; - } - if (dropData.url.is_valid()) { + if (dropData.url.is_valid()) mimeData->setUrls(QList() << toQt(dropData.url)); - return mimeData; - } return mimeData; } -- cgit v1.2.3 From a9567edd777a2406b941ab29345e424fee462530 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Mon, 10 Oct 2016 14:10:32 +0200 Subject: Respect command-line flags overriding our embedded defaults Check if the opposite flag has been given by the user before adding our own defaults. Task-number: QTBUG-56432 Change-Id: I7d6b8fed2c3e20405e3986f9afeb2193751a93f3 Reviewed-by: Michal Klocek --- src/core/web_engine_context.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp index 7d1e5d609..bf6a6a172 100644 --- a/src/core/web_engine_context.cpp +++ b/src/core/web_engine_context.cpp @@ -296,8 +296,10 @@ WebEngineContext::WebEngineContext() if (useEmbeddedSwitches) { // Inspired by the Android port's default switches - parsedCommandLine->AppendSwitch(switches::kEnableOverlayScrollbar); - parsedCommandLine->AppendSwitch(switches::kEnablePinch); + if (!parsedCommandLine->HasSwitch(switches::kDisableOverlayScrollbar)) + parsedCommandLine->AppendSwitch(switches::kEnableOverlayScrollbar); + if (!parsedCommandLine->HasSwitch(switches::kDisablePinch)) + parsedCommandLine->AppendSwitch(switches::kEnablePinch); parsedCommandLine->AppendSwitch(switches::kEnableViewport); parsedCommandLine->AppendSwitch(switches::kMainFrameResizesAreOrientationChanges); parsedCommandLine->AppendSwitch(switches::kDisableAcceleratedVideoDecode); -- cgit v1.2.3 From 6a7c0d101bfaef9b35881d2e6aa2cc979a6f21c8 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Tue, 11 Oct 2016 16:16:25 +0200 Subject: Give better error on unsupported platforms Add check for our supported and semi-supported platforms. Task-number: QTBUG-56465 Change-Id: Ic2f934ceac1b21ab5c688fa67e1c1a74ddf4a43b Reviewed-by: Leena Miettinen Reviewed-by: Kai Koehne --- tools/qmake/mkspecs/features/functions.prf | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tools/qmake/mkspecs/features/functions.prf b/tools/qmake/mkspecs/features/functions.prf index cd4f4a007..23be1d2fa 100644 --- a/tools/qmake/mkspecs/features/functions.prf +++ b/tools/qmake/mkspecs/features/functions.prf @@ -55,9 +55,19 @@ defineTest(isPlatformSupported) { return(false) } !isPythonVersionSupported(): return(false) + !isArchSupported(): return(false) return(true) } +defineTest(isArchSupported) { + contains(QT_ARCH, "i386")|contains(QT_ARCH, "x86_64"): return(true) + contains(QT_ARCH, "arm")|contains(QT_ARCH, "arm64"): return(true) + contains(QT_ARCH, "mips")|contains(QT_ARCH, "mips64"): return(true) + + skipBuild("QtWebEngine can only be built for x86, x86-64, ARM, Aarch64, MIPSel, and MIPS64 architectures.") + return(false) +} + defineTest(isPythonVersionSupported) { python_error_msg = "Python version 2 (2.7.5 or later) is required to build Qt WebEngine." python_version = $$system('python -c "import sys; print(sys.version_info[0:3])"') -- cgit v1.2.3 From ee6f018a67b6443100a1454c9ab9a7a897289535 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Wed, 7 Sep 2016 13:26:53 +0200 Subject: Fix IME window placement relative to QWebEngineView The position of the IME window is computed using the widget input item transform. When a regular QWidget gets a focusIn event, the input item transform is recomputed inside the QWidgetPrivate::updateWidgetTransform method. This did not happen for the QWebEngineView, because the focus event is handled internally and not passed down to QWidget::event. Fix consists in calling updateWidgetTransform manually whenever the view receives focus. The other cases when updateWidgetTransform should be called (namely resize and move events) are handled properly by delegating to QWidget::event. Task-number: QTBUG-55634 Change-Id: Ic93662929e169d860f8ca567f1955da4dc45f9fe Reviewed-by: Allan Sandfeld Jensen --- .../render_widget_host_view_qt_delegate_widget.cpp | 7 +++++++ src/webenginewidgets/webenginewidgets.pro | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp b/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp index a8300aa05..5bc1671df 100644 --- a/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp +++ b/src/webenginewidgets/render_widget_host_view_qt_delegate_widget.cpp @@ -48,6 +48,7 @@ #include #include #include +#include namespace QtWebEngineCore { @@ -337,6 +338,12 @@ bool RenderWidgetHostViewQtDelegateWidget::event(QEvent *event) } } + QEvent::Type type = event->type(); + if (type == QEvent::FocusIn) { + QWidgetPrivate *d = QWidgetPrivate::get(this); + d->updateWidgetTransform(event); + } + if (event->type() == QEvent::MouseButtonDblClick) { // QWidget keeps the Qt4 behavior where the DblClick event would replace the Press event. // QtQuick is different by sending both the Press and DblClick events for the second press diff --git a/src/webenginewidgets/webenginewidgets.pro b/src/webenginewidgets/webenginewidgets.pro index 5687bffaf..cc48f1198 100644 --- a/src/webenginewidgets/webenginewidgets.pro +++ b/src/webenginewidgets/webenginewidgets.pro @@ -4,7 +4,7 @@ TARGET = QtWebEngineWidgets DEFINES += QT_BUILD_WEBENGINEWIDGETS_LIB QT += webenginecore widgets network quick -QT_PRIVATE += quick-private gui-private core-private +QT_PRIVATE += quick-private gui-private core-private widgets-private INCLUDEPATH += $$PWD api ../core ../core/api ../webengine/api -- cgit v1.2.3 From 37c8b107743465053182d4e0169f42bbd804dafe Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Wed, 31 Aug 2016 15:48:04 +0200 Subject: Forward more load parameters in OpenURL Adds a number of missing load url parameters following the example of the shell and android webviews in Chromium. Change-Id: Ice27ab3efc550b8b7cfa6a5386aaf09574428a56 Reviewed-by: Peter Varga --- src/core/web_contents_delegate_qt.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/core/web_contents_delegate_qt.cpp b/src/core/web_contents_delegate_qt.cpp index 3ade0d0f6..06ae9c6da 100644 --- a/src/core/web_contents_delegate_qt.cpp +++ b/src/core/web_contents_delegate_qt.cpp @@ -107,13 +107,19 @@ content::WebContents *WebContentsDelegateQt::OpenURLFromTab(content::WebContents Q_ASSERT(target); content::NavigationController::LoadURLParams load_url_params(params.url); + load_url_params.source_site_instance = params.source_site_instance; load_url_params.referrer = params.referrer; load_url_params.frame_tree_node_id = params.frame_tree_node_id; + load_url_params.redirect_chain = params.redirect_chain; load_url_params.transition_type = params.transition; load_url_params.extra_headers = params.extra_headers; load_url_params.should_replace_current_entry = params.should_replace_current_entry; load_url_params.is_renderer_initiated = params.is_renderer_initiated; load_url_params.override_user_agent = content::NavigationController::UA_OVERRIDE_TRUE; + if (params.uses_post) { + load_url_params.load_type = content::NavigationController::LOAD_TYPE_BROWSER_INITIATED_HTTP_POST; + load_url_params.browser_initiated_post_data = params.browser_initiated_post_data; + } target->GetController().LoadURLWithParams(load_url_params); return target; -- cgit v1.2.3 From ebcc8f62c78516aae738571501c145c4f351a137 Mon Sep 17 00:00:00 2001 From: Kai Koehne Date: Thu, 20 Oct 2016 16:44:20 +0200 Subject: Doc: Clarify that font size is in pixels Task-number: QTBUG-56645 Change-Id: I16ca76d3a26d0142846b068cc1ba52bee71cf106 Reviewed-by: Leena Miettinen --- src/webenginewidgets/doc/src/qwebenginesettings_lgpl.qdoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/webenginewidgets/doc/src/qwebenginesettings_lgpl.qdoc b/src/webenginewidgets/doc/src/qwebenginesettings_lgpl.qdoc index 0193f41c9..c19e3491e 100644 --- a/src/webenginewidgets/doc/src/qwebenginesettings_lgpl.qdoc +++ b/src/webenginewidgets/doc/src/qwebenginesettings_lgpl.qdoc @@ -137,12 +137,12 @@ /*! \fn void QWebEngineSettings::setFontSize(FontSize type, int size) - Sets the font size for \a type to \a size. + Sets the font size for \a type to \a size in pixels. */ /*! \fn int QWebEngineSettings::fontSize(FontSize type) const - Returns the default font size for \a type. + Returns the default font size for \a type in pixels. */ /*! -- cgit v1.2.3 From 8caf750d57e9ebf7507f61951c45d3f31b5f5139 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Wed, 26 Oct 2016 11:18:36 +0200 Subject: Fix hang when dragging files from file picker onto QWebEngineView MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The method WebContentsAdapter::updateDragPosition actively waits for the UpdateDragCursor message, sent by the renderer. This active wait does not work whenever we're currently in a base::MessageLoop::RunTask call, because of its internal recursion guard nestable_tasks_allowed. Add a check for nestable_tasks_allowed and bail out if we know that the active wait will fail. This fixes the hang. Ensure that the modal file picker dialog is shown outside of base::MessageLoop::RunTask. This enables drag 'n drop updates from the file picker to QWebEngineView. Task-number: QTBUG-56488 Change-Id: Ia13ada9c19e7780e12ca633ab1caeac352aca2a9 Reviewed-by: Viktor Engelmann Reviewed-by: Michael Brüning --- src/core/web_contents_adapter.cpp | 10 ++++++++++ src/core/web_contents_delegate_qt.cpp | 7 ++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp index 7285648fd..fc54c98ed 100644 --- a/src/core/web_contents_adapter.cpp +++ b/src/core/web_contents_adapter.cpp @@ -1159,6 +1159,16 @@ Qt::DropAction WebContentsAdapter::updateDragPosition(QDragMoveEvent *e, const Q rvh->DragTargetDragOver(toGfx(e->pos()), toGfx(screenPos), toWeb(e->possibleActions()), blink::WebInputEvent::LeftButtonDown); + base::MessageLoop *currentMessageLoop = base::MessageLoop::current(); + DCHECK(currentMessageLoop); + if (!currentMessageLoop->NestableTasksAllowed()) { + // We're already inside a MessageLoop::RunTask call, and scheduled tasks will not be + // executed. That means, updateDragAction will never be called, and the RunLoop below will + // remain blocked forever. + qWarning("WebContentsAdapter::updateDragPosition called from MessageLoop::RunTask."); + return Qt::IgnoreAction; + } + // Wait until we get notified via RenderViewHostDelegateView::UpdateDragCursor. This calls // WebContentsAdapter::updateDragAction that will eventually quit the nested loop. base::RunLoop loop; diff --git a/src/core/web_contents_delegate_qt.cpp b/src/core/web_contents_delegate_qt.cpp index 06ae9c6da..757ae853c 100644 --- a/src/core/web_contents_delegate_qt.cpp +++ b/src/core/web_contents_delegate_qt.cpp @@ -74,6 +74,7 @@ #include "ui/events/latency_info.h" #include +#include namespace QtWebEngineCore { @@ -325,7 +326,11 @@ void WebContentsDelegateQt::RunFileChooser(content::WebContents *web_contents, c acceptedMimeTypes.append(toQt(*it)); FilePickerController *controller = new FilePickerController(static_cast(params.mode), web_contents, toQt(params.default_file_name.value()), acceptedMimeTypes); - m_viewClient->runFileChooser(controller); + + // Defer the call to not block base::MessageLoop::RunTask with modal dialogs. + QTimer::singleShot(0, [this, controller] () { + m_viewClient->runFileChooser(controller); + }); } bool WebContentsDelegateQt::AddMessageToConsole(content::WebContents *source, int32_t level, const base::string16 &message, int32_t line_no, const base::string16 &source_id) -- cgit v1.2.3 From 785ff563a73ecc67fdd83ec1e015bbb22570cabb Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Wed, 26 Oct 2016 13:01:25 +0200 Subject: Fix leakage of FilePickerControl objects in QWebEnginePage Delete the FilePickerControl object after we're done with it, analog to what the QtQuick UIDelegatesManager does. Change-Id: Id5ef6666c8536b9e5c6877cd522b4c20adae37e5 Reviewed-by: Michal Klocek --- src/webenginewidgets/api/qwebenginepage.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/webenginewidgets/api/qwebenginepage.cpp b/src/webenginewidgets/api/qwebenginepage.cpp index f10833b9b..3642a9bf5 100644 --- a/src/webenginewidgets/api/qwebenginepage.cpp +++ b/src/webenginewidgets/api/qwebenginepage.cpp @@ -1263,6 +1263,8 @@ void QWebEnginePagePrivate::runFileChooser(FilePickerController *controller) controller->accepted(selectedFileNames); else controller->rejected(); + + delete controller; } WebEngineSettings *QWebEnginePagePrivate::webEngineSettings() const -- cgit v1.2.3 From ee0a912ab4699f3e24563a856177d9b090a022fd Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Wed, 26 Oct 2016 14:43:54 +0200 Subject: Prevent crash with overridden drag 'n drop event handlers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Suppose the user overrides QWebEngineView::dragEnterEvent without calling the base implementation and without overriding dragLeaveEvent. Then our implementation will notify chromium about the drag leave without having ever seen a drag entering and crash. Only notify chromium about leave/drop/move events if we've notified it about the drag enter before. Also, catch the case where the user overrides dragLeaveEvent without calling the base implementation. Task-number: QTBUG-54896 Change-Id: Ib958040e5fa7ecab86bac9b724d478c81a521fcc Reviewed-by: Michael Brüning --- src/webenginewidgets/api/qwebengineview.cpp | 12 ++++++++++++ src/webenginewidgets/api/qwebengineview_p.h | 1 + 2 files changed, 13 insertions(+) diff --git a/src/webenginewidgets/api/qwebengineview.cpp b/src/webenginewidgets/api/qwebengineview.cpp index 6171391e3..8b4053e73 100644 --- a/src/webenginewidgets/api/qwebengineview.cpp +++ b/src/webenginewidgets/api/qwebengineview.cpp @@ -107,6 +107,7 @@ static QAccessibleInterface *webAccessibleFactory(const QString &, QObject *obje QWebEngineViewPrivate::QWebEngineViewPrivate() : page(0) , m_pendingContextMenuEvent(false) + , m_dragEntered(false) { #ifndef QT_NO_ACCESSIBILITY QAccessible::installFactory(&webAccessibleFactory); @@ -350,7 +351,10 @@ void QWebEngineView::dragEnterEvent(QDragEnterEvent *e) { Q_D(QWebEngineView); e->accept(); + if (d->m_dragEntered) + d->page->d_ptr->adapter->leaveDrag(); d->page->d_ptr->adapter->enterDrag(e, mapToGlobal(e->pos())); + d->m_dragEntered = true; } /*! @@ -359,8 +363,11 @@ void QWebEngineView::dragEnterEvent(QDragEnterEvent *e) void QWebEngineView::dragLeaveEvent(QDragLeaveEvent *e) { Q_D(QWebEngineView); + if (!d->m_dragEntered) + return; e->accept(); d->page->d_ptr->adapter->leaveDrag(); + d->m_dragEntered = false; } /*! @@ -369,6 +376,8 @@ void QWebEngineView::dragLeaveEvent(QDragLeaveEvent *e) void QWebEngineView::dragMoveEvent(QDragMoveEvent *e) { Q_D(QWebEngineView); + if (!d->m_dragEntered) + return; QtWebEngineCore::WebContentsAdapter *adapter = d->page->d_ptr->adapter.data(); Qt::DropAction dropAction = adapter->updateDragPosition(e, mapToGlobal(e->pos())); if (Qt::IgnoreAction == dropAction) { @@ -385,8 +394,11 @@ void QWebEngineView::dragMoveEvent(QDragMoveEvent *e) void QWebEngineView::dropEvent(QDropEvent *e) { Q_D(QWebEngineView); + if (!d->m_dragEntered) + return; e->accept(); d->page->d_ptr->adapter->endDragging(e->pos(), mapToGlobal(e->pos())); + d->m_dragEntered = false; } #ifndef QT_NO_ACCESSIBILITY diff --git a/src/webenginewidgets/api/qwebengineview_p.h b/src/webenginewidgets/api/qwebengineview_p.h index b98c553f4..45b3e266e 100644 --- a/src/webenginewidgets/api/qwebengineview_p.h +++ b/src/webenginewidgets/api/qwebengineview_p.h @@ -71,6 +71,7 @@ public: QWebEnginePage *page; bool m_pendingContextMenuEvent; + bool m_dragEntered; }; #ifndef QT_NO_ACCESSIBILITY -- cgit v1.2.3 From c4de6dafb00fdaf278d33798d709beb9fa7cfd78 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Thu, 14 Jul 2016 11:04:36 +0200 Subject: Disable GPU when no shared OpenGL context is available MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit In case an OpenGL context can not be created we can try running in software compositing mode. This should have a much better chance of working as a fallback. Change-Id: Icaab24dde8f4b6c8ea4023cf36b0bb679143166f Reviewed-by: Michael Brüning --- src/core/web_engine_context.cpp | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) diff --git a/src/core/web_engine_context.cpp b/src/core/web_engine_context.cpp index 3289a3c23..629490440 100644 --- a/src/core/web_engine_context.cpp +++ b/src/core/web_engine_context.cpp @@ -265,7 +265,7 @@ WebEngineContext::WebEngineContext() const char *glType = 0; if (!usingANGLE() && !usingSoftwareDynamicGL() && !usingQtQuick2DRenderer()) { - if (qt_gl_global_share_context()) { + if (qt_gl_global_share_context() && qt_gl_global_share_context()->isValid()) { if (!strcmp(qt_gl_global_share_context()->nativeHandle().typeName(), "QEGLNativeContext")) { if (qt_gl_global_share_context()->isOpenGLES()) { glType = gfx::kGLImplementationEGLName; @@ -299,16 +299,7 @@ WebEngineContext::WebEngineContext() glType = gfx::kGLImplementationDesktopName; } } else { - qWarning("WebEngineContext used before QtWebEngine::initialize()"); - // We have to assume the default OpenGL module type will be used. - switch (QOpenGLContext::openGLModuleType()) { - case QOpenGLContext::LibGL: - glType = gfx::kGLImplementationDesktopName; - break; - case QOpenGLContext::LibGLES: - glType = gfx::kGLImplementationEGLName; - break; - } + qWarning("WebEngineContext used before QtWebEngine::initialize() or OpenGL context creation failed."); } } -- cgit v1.2.3 From ba6acb2bc25add0f8b4490d8760b7ad1c1f27629 Mon Sep 17 00:00:00 2001 From: Viktor Engelmann Date: Fri, 21 Oct 2016 14:24:02 +0200 Subject: Allow Pepper Flash to access Media Devices MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Q_UNREACHABLE caused WebEngine to block Pepper Flash from accessing Media Devices such as the WebCam (this rendered http://testwebcam.com unusable for example) Task-number: QTBUG-55017 Change-Id: I7979c9a5690173e86310f7448c78949371fbc909 Reviewed-by: Michael Brüning --- src/core/media_capture_devices_dispatcher.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/core/media_capture_devices_dispatcher.cpp b/src/core/media_capture_devices_dispatcher.cpp index dcccd72fb..dd9a24757 100644 --- a/src/core/media_capture_devices_dispatcher.cpp +++ b/src/core/media_capture_devices_dispatcher.cpp @@ -159,7 +159,6 @@ void MediaCaptureDevicesDispatcher::handleMediaAccessPermissionResponse(content: if (securityOriginsMatch && (microphoneRequested || webcamRequested)) { switch (request.request_type) { case content::MEDIA_OPEN_DEVICE: - Q_UNREACHABLE(); // only speculative as this is for Pepper getDefaultDevices("", "", microphoneRequested, webcamRequested, &devices); break; case content::MEDIA_DEVICE_ACCESS: -- cgit v1.2.3 From 96fd274767ff42b00f9201cb742c8ec5d389861e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Br=C3=BCning?= Date: Mon, 24 Oct 2016 18:28:32 +0200 Subject: Apply page margins also for PDF printing (backport from 5.8) This was left out by oversight. Task-number: QTBUG-56710 Change-Id: Ie23229396eb94b949212324fb50022763935d524 Reviewed-by: Joerg Bornemann --- src/core/print_view_manager_qt.cpp | 76 ++++++++++++++++++++++++-------------- 1 file changed, 48 insertions(+), 28 deletions(-) diff --git a/src/core/print_view_manager_qt.cpp b/src/core/print_view_manager_qt.cpp index 4cb0e06eb..f657b8289 100644 --- a/src/core/print_view_manager_qt.cpp +++ b/src/core/print_view_manager_qt.cpp @@ -101,43 +101,62 @@ static void SavePdfFile(scoped_refptr data, metafile.SaveTo(&file); } -static void applyQPageLayoutSettingsToDictionary(const QPageLayout& pageLayout, base::DictionaryValue& print_settings) +static base::DictionaryValue *createPrintSettings() { + base::DictionaryValue *printSettings = new base::DictionaryValue(); // TO DO: Check if we can use the request ID from Qt here somehow. static int internalRequestId = 0; - print_settings.SetBoolean(printing::kIsFirstRequest, internalRequestId++ == 0); - print_settings.SetInteger(printing::kPreviewRequestID, internalRequestId); + printSettings->SetBoolean(printing::kIsFirstRequest, internalRequestId++ == 0); + printSettings->SetInteger(printing::kPreviewRequestID, internalRequestId); + + // The following are standard settings that Chromium expects to be set. + printSettings->SetBoolean(printing::kSettingPrintToPDF, true); + printSettings->SetBoolean(printing::kSettingCloudPrintDialog, false); + printSettings->SetBoolean(printing::kSettingPrintWithPrivet, false); + printSettings->SetBoolean(printing::kSettingPrintWithExtension, false); + + printSettings->SetBoolean(printing::kSettingGenerateDraftData, false); + printSettings->SetBoolean(printing::kSettingPreviewModifiable, false); + printSettings->SetInteger(printing::kSettingDuplexMode, printing::SIMPLEX); + printSettings->SetInteger(printing::kSettingCopies, 1); + printSettings->SetBoolean(printing::kSettingCollate, false); + printSettings->SetBoolean(printing::kSettingGenerateDraftData, false); + printSettings->SetBoolean(printing::kSettingPreviewModifiable, false); + + printSettings->SetBoolean(printing::kSettingShouldPrintSelectionOnly, false); + printSettings->SetBoolean(printing::kSettingShouldPrintBackgrounds, true); + printSettings->SetBoolean(printing::kSettingHeaderFooterEnabled, false); + printSettings->SetString(printing::kSettingDeviceName, ""); + printSettings->SetInteger(printing::kPreviewUIID, 12345678); + + return printSettings; +} + +static base::DictionaryValue *createPrintSettingsFromQPageLayout(const QPageLayout &pageLayout) +{ + base::DictionaryValue *printSettings = createPrintSettings(); + //Set page size attributes, chromium expects these in micrometers QSizeF pageSizeInMilimeter = pageLayout.pageSize().size(QPageSize::Millimeter); scoped_ptr sizeDict(new base::DictionaryValue); sizeDict->SetInteger(printing::kSettingMediaSizeWidthMicrons, pageSizeInMilimeter.width() * kMicronsToMillimeter); sizeDict->SetInteger(printing::kSettingMediaSizeHeightMicrons, pageSizeInMilimeter.height() * kMicronsToMillimeter); - print_settings.Set(printing::kSettingMediaSize, std::move(sizeDict)); + printSettings->Set(printing::kSettingMediaSize, std::move(sizeDict)); - print_settings.SetBoolean(printing::kSettingLandscape, pageLayout.orientation() == QPageLayout::Landscape); + // Apply page margins + QMargins pageMarginsInPoints = pageLayout.marginsPoints(); + scoped_ptr marginsDict(new base::DictionaryValue); + marginsDict->SetInteger(printing::kSettingMarginTop, pageMarginsInPoints.top()); + marginsDict->SetInteger(printing::kSettingMarginBottom, pageMarginsInPoints.bottom()); + marginsDict->SetInteger(printing::kSettingMarginLeft, pageMarginsInPoints.left()); + marginsDict->SetInteger(printing::kSettingMarginRight, pageMarginsInPoints.right()); + printSettings->Set(printing::kSettingMarginsCustom, std::move(marginsDict)); + printSettings->SetInteger(printing::kSettingMarginsType, printing::CUSTOM_MARGINS); - // The following are standard settings that Chromium expects to be set. - print_settings.SetBoolean(printing::kSettingPrintToPDF, true); - print_settings.SetBoolean(printing::kSettingCloudPrintDialog, false); - print_settings.SetBoolean(printing::kSettingPrintWithPrivet, false); - print_settings.SetBoolean(printing::kSettingPrintWithExtension, false); - - print_settings.SetBoolean(printing::kSettingGenerateDraftData, false); - print_settings.SetBoolean(printing::kSettingPreviewModifiable, false); - print_settings.SetInteger(printing::kSettingColor, printing::COLOR); - print_settings.SetInteger(printing::kSettingDuplexMode, printing::SIMPLEX); - print_settings.SetInteger(printing::kSettingDuplexMode, printing::UNKNOWN_DUPLEX_MODE); - print_settings.SetInteger(printing::kSettingCopies, 1); - print_settings.SetBoolean(printing::kSettingCollate, false); - print_settings.SetBoolean(printing::kSettingGenerateDraftData, false); - print_settings.SetBoolean(printing::kSettingPreviewModifiable, false); - - print_settings.SetBoolean(printing::kSettingShouldPrintSelectionOnly, false); - print_settings.SetBoolean(printing::kSettingShouldPrintBackgrounds, false); - print_settings.SetBoolean(printing::kSettingHeaderFooterEnabled, false); - print_settings.SetString(printing::kSettingDeviceName, ""); - print_settings.SetInteger(printing::kPreviewUIID, 12345678); + printSettings->SetBoolean(printing::kSettingLandscape, pageLayout.orientation() == QPageLayout::Landscape); + + return printSettings; } } // namespace @@ -191,8 +210,9 @@ bool PrintViewManagerQt::PrintToPDFInternal(const QPageLayout &pageLayout) { if (!pageLayout.isValid()) return false; - m_printSettings.reset(new base::DictionaryValue()); - applyQPageLayoutSettingsToDictionary(pageLayout, *m_printSettings); + m_printSettings.reset(createPrintSettingsFromQPageLayout(pageLayout)); + + m_printSettings->SetInteger(printing::kSettingColor, printing::COLOR); return Send(new PrintMsg_InitiatePrintPreview(routing_id(), false)); } -- cgit v1.2.3 From a4b04e4c2613cb600680eea5697b2775a765147b Mon Sep 17 00:00:00 2001 From: Topi Reinio Date: Thu, 11 Aug 2016 15:59:50 +0200 Subject: Doc: Change instances of 'OS X' to 'macOS' As of version 10.12 (Sierra), the name of Apple's desktop operating system will be macOS. Change all occurrences where the Mac platform is discussed to use the macro \macos (defined in the documentation configuration in qtbase), except in link targets where QDoc does not expand macros. Change-Id: Icad4e7817d93b9e7b0e1a9a13a8618b3341ab2ba Reviewed-by: Leena Miettinen --- src/webengine/doc/src/qtwebengine-overview.qdoc | 4 ++-- src/webengine/doc/src/qtwebengine-platform-notes.qdoc | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/webengine/doc/src/qtwebengine-overview.qdoc b/src/webengine/doc/src/qtwebengine-overview.qdoc index ca9573709..f29410e6d 100644 --- a/src/webengine/doc/src/qtwebengine-overview.qdoc +++ b/src/webengine/doc/src/qtwebengine-overview.qdoc @@ -197,7 +197,7 @@ \section1 Proxy Support If QNetworkProxy::applicationProxy is set, it will also be used for Qt WebEngine. Otherwise, - Qt WebEngine automatically picks up the proxy configuration from OS X and Windows. On Linux, + Qt WebEngine automatically picks up the proxy configuration from \macos and Windows. On Linux, it acknowledges settings from KDE and Gnome. If a proxy requires authentication, QWebEnginePage::proxyAuthenticationRequired is emitted. @@ -247,7 +247,7 @@ \section1 Platform Notes - Qt WebEngine currently supports only Windows, Linux, and OS X. Due to Chromium build + Qt WebEngine currently supports only Windows, Linux, and \macos. Due to Chromium build requirements it also often requires a newer compiler than the rest of Qt. See \l{Qt WebEngine Platform Notes} for further details. diff --git a/src/webengine/doc/src/qtwebengine-platform-notes.qdoc b/src/webengine/doc/src/qtwebengine-platform-notes.qdoc index 4aa0ac9ec..c70cb5775 100644 --- a/src/webengine/doc/src/qtwebengine-platform-notes.qdoc +++ b/src/webengine/doc/src/qtwebengine-platform-notes.qdoc @@ -37,7 +37,7 @@ different requirements of Chromium this is not always possible. Known limitations are: \list - \li Qt WebEngine currently supports only Windows, Linux, and OS X. + \li Qt WebEngine currently supports only Windows, Linux, and \macos. \li On Windows, Qt WebEngine only supports Windows Vista or newer as target platform. Due to use of newer API in Chromium, Windows XP is not supported. WinRT is @@ -54,7 +54,7 @@ \list \li \l{Qt for Windows - Requirements} \li \l{Qt for X11 Requirements} - \li \l{Qt for OS X - Requirements} + \li \l{Qt for macOS - Requirements} \endlist In addition, the following tools are required for building the \l {Qt WebEngine} module: @@ -63,7 +63,7 @@ \li \l {All Platforms} \li \l {Windows} \li \l {Linux} - \li \l {OS X} + \li \l {macOS} \endlist The tests for skipping the Qt WebEngine build are located in the @@ -112,11 +112,11 @@ Further, development packages for \c khr and \c libcap need to be installed. - \section2 OS X + \section2 \macos - On OS X, Xcode version 5.1 or later on OS X 10.9 or later is required. + On \macos, Xcode version 5.1 or later on \macos 10.9 or later is required. - \note Qt WebEngine cannot be built for the 32-bit mode of OS X (using the + \note Qt WebEngine cannot be built for the 32-bit mode of \macos (using the \c macx-clang-32 \c mkspec). \section1 Default QSurfaceFormat OpenGL Profile Support @@ -125,7 +125,7 @@ before the application instance is declared, to make sure that all created OpenGL contexts use the same OpenGL profile. - On OS X, if the default QSurfaceFormat is set after the application instance, the application + On \macos, if the default QSurfaceFormat is set after the application instance, the application will exit with qFatal(), and print a message that the default QSurfaceFormat should be set before the application instance. */ -- cgit v1.2.3 From ea2dafb7d07500e83b59fd708a9634a5e1135425 Mon Sep 17 00:00:00 2001 From: Michal Klocek Date: Wed, 2 Nov 2016 15:22:03 +0100 Subject: Add missing override to initializeEngine in plugin Task-number: QTBUG-56870 Change-Id: I36338a1a29bc4e82f5c84cfa1ea641b8df3b5f4f Reviewed-by: Alexandru Croitor --- src/webengine/plugin/plugin.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/webengine/plugin/plugin.cpp b/src/webengine/plugin/plugin.cpp index b71689a34..4809c0708 100644 --- a/src/webengine/plugin/plugin.cpp +++ b/src/webengine/plugin/plugin.cpp @@ -64,7 +64,7 @@ class QtWebEnginePlugin : public QQmlExtensionPlugin Q_OBJECT Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface/1.0") public: - virtual void initializeEngine(QQmlEngine *engine, const char *uri) + virtual void initializeEngine(QQmlEngine *engine, const char *uri) Q_DECL_OVERRIDE { Q_UNUSED(uri); engine->addImageProvider(QQuickWebEngineFaviconProvider::identifier(), new QQuickWebEngineFaviconProvider); -- cgit v1.2.3 From 6bb3d98e47d89790049edca796843345b8fd3c8b Mon Sep 17 00:00:00 2001 From: Viktor Engelmann Date: Wed, 26 Oct 2016 13:49:06 +0200 Subject: Pepper flash search-path for package adobe-flashplugin Since version 54, the chromium distribution package does not contain the pepper flash plugin anymore. Because of this, the plugin cannot be installed using the Ubuntu package "pepperflashplugin-nonfree" anymore (because the package pulled the plugin from the chromium distribution). The plugin is also contained in the package adobe-flashplugin, which installs the file to /usr/lib/adobe-flashplugin/libpepflashplayer.so. [ChangeLog] Pepper flash is now also searched in /usr/lib/adobe-flashplugin/ Change-Id: I7c135a2eac1628b0d338bbfed07695c9578458e6 Reviewed-by: Allan Sandfeld Jensen --- src/core/content_client_qt.cpp | 3 ++- src/webengine/doc/src/qtwebengine-features.qdoc | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core/content_client_qt.cpp b/src/core/content_client_qt.cpp index c10911b0b..c12abefc5 100644 --- a/src/core/content_client_qt.cpp +++ b/src/core/content_client_qt.cpp @@ -119,7 +119,8 @@ void AddPepperFlashFromSystem(std::vector* plugins) #endif #if defined(Q_OS_LINUX) pluginPaths << "/opt/google/chrome/PepperFlash/libpepflashplayer.so" // Google Chrome - << "/usr/lib/pepperflashplugin-nonfree/libpepflashplayer.so" // Ubuntu + << "/usr/lib/pepperflashplugin-nonfree/libpepflashplayer.so" // Ubuntu, package pepperflashplugin-nonfree + << "/usr/lib/adobe-flashplugin/libpepflashplayer.so" // Ubuntu, package adobe-flashplugin << "/usr/lib/PepperFlash/libpepflashplayer.so" // Arch << "/usr/lib64/chromium/PepperFlash/libpepflashplayer.so"; // OpenSuSE #endif diff --git a/src/webengine/doc/src/qtwebengine-features.qdoc b/src/webengine/doc/src/qtwebengine-features.qdoc index 912e83b59..815ffd097 100644 --- a/src/webengine/doc/src/qtwebengine-features.qdoc +++ b/src/webengine/doc/src/qtwebengine-features.qdoc @@ -151,6 +151,7 @@ \li Linux \code /usr/lib/pepperflashplugin-nonfree/libpepflashplayer.so + /usr/lib/adobe-flashplugin/libpepflashplayer.so /usr/lib/PepperFlash/libpepflashplayer.so /usr/lib64/chromium/PepperFlash/libpepflashplayer.so \endcode -- cgit v1.2.3 From eab2f568d80b870db07ad8e0cec352fa655a6eb8 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Thu, 3 Nov 2016 18:25:19 +0100 Subject: remove dependencies from sync.profile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit the CI obtains them from the qt5 super repo nowadays. Change-Id: If41f7c5306ca739fd3800cec3f680fa72df2a871 Reviewed-by: Jędrzej Nowacki --- sync.profile | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/sync.profile b/sync.profile index e4a88e0c2..4cc549106 100644 --- a/sync.profile +++ b/sync.profile @@ -10,19 +10,3 @@ ); %classnames = ( ); - -# Module dependencies. -# Every module that is required to build this module should have one entry. -# Each of the module version specifiers can take one of the following values: -# - A specific Git revision. -# - any git symbolic ref resolvable from the module's repository (e.g. "refs/heads/master" to track master branch) -# -%dependencies = ( - "qtbase" => "", - "qtdeclarative" => "", - "qtlocation" => "", - "qttools" => "", -# FIXME: take examples out into their own module to avoid a potential circular dependency later ? - "qtquickcontrols" => "", - "qtwebchannel" => "", -); -- cgit v1.2.3 From 1666e7bbdc6f9bdcaeb257d4d46e29a3e326a9e0 Mon Sep 17 00:00:00 2001 From: Michal Klocek Date: Mon, 7 Nov 2016 17:25:13 +0100 Subject: Do not fail for wayland-egl Client-side buffer integration can be set manually, therefore beside accepting generic wayland plugin accept also wayland-egl. Change-Id: I8269f117f81cf8bb9462bea525cb253727910bc6 Reviewed-by: Allan Sandfeld Jensen --- src/core/content_browser_client_qt.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/content_browser_client_qt.cpp b/src/core/content_browser_client_qt.cpp index f5f490ccf..bff0557a8 100644 --- a/src/core/content_browser_client_qt.cpp +++ b/src/core/content_browser_client_qt.cpp @@ -270,7 +270,8 @@ public: m_handle = pni->nativeResourceForContext(QByteArrayLiteral("cglcontextobj"), qtContext); else if (platform == QLatin1String("qnx")) m_handle = pni->nativeResourceForContext(QByteArrayLiteral("eglcontext"), qtContext); - else if (platform == QLatin1String("eglfs") || platform == QLatin1String("wayland")) + else if (platform == QLatin1String("eglfs") || platform == QLatin1String("wayland") + || platform == QLatin1String("wayland-egl")) m_handle = pni->nativeResourceForContext(QByteArrayLiteral("eglcontext"), qtContext); else if (platform == QLatin1String("windows")) { if (gfx::GetGLImplementation() == gfx::kGLImplementationEGLGLES2) -- cgit v1.2.3 From ff26fa899f095eff9b3265b462e97c7e48ab06f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Br=C3=BCning?= Date: Wed, 26 Oct 2016 14:56:56 +0200 Subject: Copy web channel from QWebEnginePage when adopting WebContentsAdapter It used to be just ignored. Task-number: QTBUG-56643 Change-Id: Ife7ac05fce7e93a6eba1ac6e6db1095574c83e42 Reviewed-by: Viktor Engelmann Reviewed-by: Joerg Bornemann --- src/webenginewidgets/api/qwebenginepage.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/webenginewidgets/api/qwebenginepage.cpp b/src/webenginewidgets/api/qwebenginepage.cpp index 3642a9bf5..df96f4c17 100644 --- a/src/webenginewidgets/api/qwebenginepage.cpp +++ b/src/webenginewidgets/api/qwebenginepage.cpp @@ -313,6 +313,10 @@ void QWebEnginePagePrivate::adoptNewWindowImpl(QWebEnginePage *newPage, if (!initialGeometry.isEmpty()) emit newPage->geometryChangeRequested(initialGeometry); + // If the constructor of the QWebEnginePage descendant set a web channel, + // set it on the new adapter. + newWebContents->setWebChannel(newPage->d_func()->webChannel); + // Page has finished the adoption process. newPage->d_func()->m_isBeingAdopted = false; } -- cgit v1.2.3 From c1799923be3fb6d68391d5d4729c2d542424a734 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Tue, 11 Oct 2016 12:36:38 +0200 Subject: Make Linux QPA combinations more robust MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use resourceForIntegration to get egldisplay since not all QPA return a egldisplay for context (in particular xcb_egl). Implement EGL fallback for linux desktop builds, to make Wayland work without an X11 server present. Change-Id: Idcead42250fa00a36e50c082711f5618fd213556 Reviewed-by: Michael Brüning --- src/core/gl_context_qt.cpp | 2 +- src/core/gl_surface_qt.cpp | 55 +++++++++++++++++++++++++++------------------- 2 files changed, 33 insertions(+), 24 deletions(-) diff --git a/src/core/gl_context_qt.cpp b/src/core/gl_context_qt.cpp index 0cf873631..b7d82e77a 100644 --- a/src/core/gl_context_qt.cpp +++ b/src/core/gl_context_qt.cpp @@ -118,7 +118,7 @@ void* GLContextHelper::getXConfig() void* GLContextHelper::getEGLDisplay() { - return resourceForContext(QByteArrayLiteral("egldisplay")); + return resourceForIntegration(QByteArrayLiteral("egldisplay")); } void* GLContextHelper::getXDisplay() diff --git a/src/core/gl_surface_qt.cpp b/src/core/gl_surface_qt.cpp index f499d853e..a82143525 100644 --- a/src/core/gl_surface_qt.cpp +++ b/src/core/gl_surface_qt.cpp @@ -88,6 +88,9 @@ void* g_display; const char* g_extensions = NULL; bool g_egl_surfaceless_context_supported = false; + +bool g_initializedEGL = false; + } // namespace @@ -393,11 +396,17 @@ bool GLSurface::InitializeOneOffInternal() return GLSurfaceQtEGL::InitializeOneOff(); if (GetGLImplementation() == kGLImplementationDesktopGL) { -#if defined(USE_X11) - return GLSurfaceQtGLX::InitializeOneOff(); -#elif defined(OS_WIN) +#if defined(OS_WIN) return GLSurfaceQtWGL::InitializeOneOff(); +#elif defined(USE_X11) + if (GLSurfaceQtGLX::InitializeOneOff()) + return true; #endif + // Fallback to trying EGL with desktop GL. + if (GLSurfaceQtEGL::InitializeOneOff()) { + g_initializedEGL = true; + return true; + } } return false; @@ -579,39 +588,39 @@ void* GLSurfacelessQtEGL::GetShareHandle() scoped_refptr GLSurface::CreateOffscreenGLSurface(const gfx::Size& size) { + scoped_refptr surface; switch (GetGLImplementation()) { case kGLImplementationDesktopGL: { -#if defined(USE_X11) - scoped_refptr surface = new GLSurfaceQtGLX(size); - if (!surface->Initialize()) - return NULL; - return surface; -#elif defined(OS_WIN) - scoped_refptr surface = new GLSurfaceQtWGL(size); - if (!surface->Initialize()) - return NULL; - return surface; -#else - LOG(ERROR) << "Desktop GL is not supported on this platform."; - Q_UNREACHABLE(); - return NULL; +#if defined(OS_WIN) + surface = new GLSurfaceQtWGL(size); + if (surface->Initialize()) + return surface; + break; +#elif defined(USE_X11) + if (!g_initializedEGL) { + surface = new GLSurfaceQtGLX(size); + if (surface->Initialize()) + return surface; + } + // no break #endif } case kGLImplementationEGLGLES2: { - scoped_refptr surface; if (g_egl_surfaceless_context_supported) surface = new GLSurfacelessQtEGL(size); else surface = new GLSurfaceQtEGL(size); - if (!surface->Initialize()) - return NULL; - return surface; + if (surface->Initialize()) + return surface; + break; } default: - Q_UNREACHABLE(); - return NULL; + break; } + LOG(ERROR) << "Requested OpenGL platform is not supported."; + Q_UNREACHABLE(); + return NULL; } // static -- cgit v1.2.3 From 2d49b1b20f3275316310df599f1363ac86b8f078 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Mon, 7 Nov 2016 16:38:05 +0100 Subject: Fix sites with optional client certificate support MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We fail to load pages that supports client certificates because we didn't implement the client certificate selection. This patch makes a small implementation that selects no certificate whenever a client certificate is requested. Task-number: QTBUG-56206 Change-Id: I95394d9664c7e8e4d03d9e63e5043da81e2672a4 Reviewed-by: Michael Brüning --- src/core/content_browser_client_qt.cpp | 8 ++++++++ src/core/content_browser_client_qt.h | 3 +++ 2 files changed, 11 insertions(+) diff --git a/src/core/content_browser_client_qt.cpp b/src/core/content_browser_client_qt.cpp index bff0557a8..fd6bd1f86 100644 --- a/src/core/content_browser_client_qt.cpp +++ b/src/core/content_browser_client_qt.cpp @@ -47,6 +47,7 @@ #include "content/browser/renderer_host/render_view_host_delegate.h" #include "content/public/browser/browser_main_parts.h" #include "content/public/browser/child_process_security_policy.h" +#include "content/public/browser/client_certificate_delegate.h" #include "content/public/browser/media_observer.h" #include "content/public/browser/quota_permission_context.h" #include "content/public/browser/render_frame_host.h" @@ -434,6 +435,13 @@ void ContentBrowserClientQt::AllowCertificateError(content::WebContents *webCont *result = content::CERTIFICATE_REQUEST_RESULT_TYPE_DENY; } +void ContentBrowserClientQt::SelectClientCertificate(content::WebContents * /*webContents*/, + net::SSLCertRequestInfo * /*certRequestInfo*/, + scoped_ptr delegate) +{ + delegate->ContinueWithCertificate(nullptr); +} + content::LocationProvider *ContentBrowserClientQt::OverrideSystemLocationProvider() { #ifdef QT_USE_POSITIONING diff --git a/src/core/content_browser_client_qt.h b/src/core/content_browser_client_qt.h index 1878e3d27..2b023db5f 100644 --- a/src/core/content_browser_client_qt.h +++ b/src/core/content_browser_client_qt.h @@ -102,6 +102,9 @@ public: bool expired_previous_decision, const base::Callback& callback, content::CertificateRequestResultType* result) Q_DECL_OVERRIDE; + virtual void SelectClientCertificate(content::WebContents* web_contents, + net::SSLCertRequestInfo* cert_request_info, + scoped_ptr delegate) Q_DECL_OVERRIDE; content::LocationProvider* OverrideSystemLocationProvider() Q_DECL_OVERRIDE; content::DevToolsManagerDelegate *GetDevToolsManagerDelegate() Q_DECL_OVERRIDE; virtual net::URLRequestContextGetter *CreateRequestContext(content::BrowserContext *browser_context, content::ProtocolHandlerMap *protocol_handlers, content::URLRequestInterceptorScopedVector request_interceptorss) Q_DECL_OVERRIDE; -- cgit v1.2.3