From e0bd650cb7f8c8fd3014541b4c49104906e0e139 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Mon, 20 Jun 2016 17:14:35 +0200 Subject: Override short-cuts to common editor commands To ensure Chromium is given a chance to handle editor commands, we must override these short-cuts. On OS X we must also perform the action afterwards as these are not handled internally by the Blink Editor. The patch solves copy/paste in flash plugins and copy/paste on OS X when no application short-cuts have been defined. The handling of short-cut override events is based on how it was handled in Qt WebKit Task-number: QTBUG-54221 Change-Id: I748671c7bfa5662aae16c6a4b9bbe5e2bce1b907 Reviewed-by: Alexandru Croitor --- src/webenginewidgets/api/qwebenginepage_p.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/webenginewidgets/api/qwebenginepage_p.h') diff --git a/src/webenginewidgets/api/qwebenginepage_p.h b/src/webenginewidgets/api/qwebenginepage_p.h index 7b16ed667..d0023d7bb 100644 --- a/src/webenginewidgets/api/qwebenginepage_p.h +++ b/src/webenginewidgets/api/qwebenginepage_p.h @@ -67,6 +67,8 @@ class QWebEngineProfile; class QWebEngineSettings; class QWebEngineView; +QWebEnginePage::WebAction editorActionForKeyEvent(QKeyEvent* event); + class QWebEnginePagePrivate : public QtWebEngineCore::WebContentsAdapterClient { public: -- cgit v1.2.3 From 06864c75f4d009bf8fd4e9f88215bb88341ed873 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Thu, 30 Jun 2016 17:41:31 +0200 Subject: Switch WebContentsAdapter to using shared pointers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit QExplicitSharedDataPointer is meant for value objects, not for shared objects. Instead switch to using QSharedPointer. Change-Id: Ib3791bbcfde627a67508f2819e141d8c538a4a50 Reviewed-by: Michael BrĂ¼ning Reviewed-by: Michal Klocek --- src/webenginewidgets/api/qwebenginepage_p.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/webenginewidgets/api/qwebenginepage_p.h') diff --git a/src/webenginewidgets/api/qwebenginepage_p.h b/src/webenginewidgets/api/qwebenginepage_p.h index d0023d7bb..41ba84dd0 100644 --- a/src/webenginewidgets/api/qwebenginepage_p.h +++ b/src/webenginewidgets/api/qwebenginepage_p.h @@ -95,7 +95,7 @@ public: virtual void loadFinished(bool success, const QUrl &url, bool isErrorPage = false, int errorCode = 0, const QString &errorDescription = QString()) Q_DECL_OVERRIDE; virtual void focusContainer() Q_DECL_OVERRIDE; virtual void unhandledKeyEvent(QKeyEvent *event) Q_DECL_OVERRIDE; - virtual void adoptNewWindow(QtWebEngineCore::WebContentsAdapter *newWebContents, WindowOpenDisposition disposition, bool userGesture, const QRect &initialGeometry) Q_DECL_OVERRIDE; + virtual void adoptNewWindow(QSharedPointer newWebContents, WindowOpenDisposition disposition, bool userGesture, const QRect &initialGeometry) Q_DECL_OVERRIDE; virtual bool isBeingAdopted() Q_DECL_OVERRIDE; virtual void close() Q_DECL_OVERRIDE; virtual void windowCloseRejected() Q_DECL_OVERRIDE; @@ -143,7 +143,7 @@ public: void setFullScreenMode(bool); - QExplicitlySharedDataPointer adapter; + QSharedPointer adapter; QWebEngineHistory *history; QWebEngineProfile *profile; QWebEngineSettings *settings; -- cgit v1.2.3 From 3855015600418107485b31b0ec2bfa5b987787e7 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Fri, 8 Jul 2016 14:24:42 +0200 Subject: Allow QWebEnginePage::createWindow to return this Consider a QWebEnginePage subclass that does "return this;" in createWindow. Commit 1f07d2929a made this a no-op to prevent QtWebEngine from crashing. The reason for the crash was access to deleted memory after destroying the current adapter in adoptNewWindow. Defer the adoption in this case to whenever we hit the event loop again. Change-Id: I9674d80ef8b2f301c1446ff505b2486649451ba6 Task-number: QTBUG-42216 Reviewed-by: Michal Klocek --- src/webenginewidgets/api/qwebenginepage_p.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/webenginewidgets/api/qwebenginepage_p.h') diff --git a/src/webenginewidgets/api/qwebenginepage_p.h b/src/webenginewidgets/api/qwebenginepage_p.h index 41ba84dd0..27f582c30 100644 --- a/src/webenginewidgets/api/qwebenginepage_p.h +++ b/src/webenginewidgets/api/qwebenginepage_p.h @@ -96,6 +96,9 @@ public: virtual void focusContainer() Q_DECL_OVERRIDE; virtual void unhandledKeyEvent(QKeyEvent *event) Q_DECL_OVERRIDE; virtual void adoptNewWindow(QSharedPointer newWebContents, WindowOpenDisposition disposition, bool userGesture, const QRect &initialGeometry) Q_DECL_OVERRIDE; + void adoptNewWindowImpl(QWebEnginePage *newPage, + const QSharedPointer &newWebContents, + const QRect &initialGeometry); virtual bool isBeingAdopted() Q_DECL_OVERRIDE; virtual void close() Q_DECL_OVERRIDE; virtual void windowCloseRejected() Q_DECL_OVERRIDE; -- cgit v1.2.3 From f5ce990665a446fb131cc17c83eaac71eaae0070 Mon Sep 17 00:00:00 2001 From: Adam Kallai Date: Wed, 13 Jul 2016 14:17:04 +0200 Subject: Add missing Q_DECL_OVERRIDE macro This macro is missing from the end of the showColorDialog function in qwebenginepage_p.h. Change-Id: Iec1998244f0b40767c37b89ef65a1b0d7451d3fe Reviewed-by: Allan Sandfeld Jensen --- src/webenginewidgets/api/qwebenginepage_p.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/webenginewidgets/api/qwebenginepage_p.h') diff --git a/src/webenginewidgets/api/qwebenginepage_p.h b/src/webenginewidgets/api/qwebenginepage_p.h index fb0b85268..089dc1cc6 100644 --- a/src/webenginewidgets/api/qwebenginepage_p.h +++ b/src/webenginewidgets/api/qwebenginepage_p.h @@ -110,7 +110,7 @@ public: virtual bool isFullScreenMode() const Q_DECL_OVERRIDE; virtual void javascriptDialog(QSharedPointer) Q_DECL_OVERRIDE; virtual void runFileChooser(QtWebEngineCore::FilePickerController *controller) Q_DECL_OVERRIDE; - virtual void showColorDialog(QSharedPointer); + virtual void showColorDialog(QSharedPointer) Q_DECL_OVERRIDE; virtual void didRunJavaScript(quint64 requestId, const QVariant& result) Q_DECL_OVERRIDE; virtual void didFetchDocumentMarkup(quint64 requestId, const QString& result) Q_DECL_OVERRIDE; virtual void didFetchDocumentInnerText(quint64 requestId, const QString& result) Q_DECL_OVERRIDE; -- cgit v1.2.3