From 53ae66357e6e3ae0e6247cbe193cb32abbca9ae1 Mon Sep 17 00:00:00 2001
From: Christophe Chapuis <chris.chapuis@gmail.com>
Date: Sat, 22 Jul 2017 09:41:45 +0000
Subject: [PATCH 15/18] WebEngineView: add extraContextMenuEntriesComponent
 property

Signed-off-by: Christophe Chapuis <chris.chapuis@gmail.com>
---
 src/webengine/api/qquickwebengineview.cpp | 16 ++++++++++++++++
 src/webengine/api/qquickwebengineview_p.h |  5 +++++
 2 files changed, 21 insertions(+)

diff --git a/src/webengine/api/qquickwebengineview.cpp b/src/webengine/api/qquickwebengineview.cpp
index f1e1b6e..8fdf30a 100644
--- a/src/webengine/api/qquickwebengineview.cpp
+++ b/src/webengine/api/qquickwebengineview.cpp
@@ -1079,6 +1079,22 @@ void QQuickWebEngineView::setDevicePixelRatio(qreal devicePixelRatio)
     Q_EMIT devicePixelRatioChanged();
 }
 
+void QQuickWebEngineView::setExtraContextMenuEntriesComponent(QQmlComponent *contextMenuExtras)
+{
+    Q_D(QQuickWebEngineView);
+    if (d->contextMenuExtraItems == contextMenuExtras)
+        return;
+    d->contextMenuExtraItems = contextMenuExtras;
+    Q_EMIT extraContextMenuEntriesComponentChanged();
+}
+
+QQmlComponent *QQuickWebEngineView::extraContextMenuEntriesComponent() const
+{
+    Q_D(const QQuickWebEngineView);
+    return d->contextMenuExtraItems;
+}
+
+
 #ifdef ENABLE_QML_TESTSUPPORT_API
 QQuickWebEngineTestSupport *QQuickWebEngineView::testSupport() const
 {
diff --git a/src/webengine/api/qquickwebengineview_p.h b/src/webengine/api/qquickwebengineview_p.h
index 2d6f101..d068eb9 100644
--- a/src/webengine/api/qquickwebengineview_p.h
+++ b/src/webengine/api/qquickwebengineview_p.h
@@ -122,6 +122,7 @@ class Q_WEBENGINE_PRIVATE_EXPORT QQuickWebEngineView : public QQuickItem {
     Q_PROPERTY(bool recentlyAudible READ recentlyAudible NOTIFY recentlyAudibleChanged FINAL REVISION 3)
     Q_PROPERTY(uint webChannelWorld READ webChannelWorld WRITE setWebChannelWorld NOTIFY webChannelWorldChanged REVISION 3 FINAL)
     Q_PROPERTY(qreal devicePixelRatio READ devicePixelRatio WRITE setDevicePixelRatio NOTIFY devicePixelRatioChanged REVISION 4)
+    Q_PROPERTY(QQmlComponent *extraContextMenuEntriesComponent READ extraContextMenuEntriesComponent WRITE setExtraContextMenuEntriesComponent NOTIFY extraContextMenuEntriesComponentChanged REVISION 4)
 
 #ifdef ENABLE_QML_TESTSUPPORT_API
     Q_PROPERTY(QQuickWebEngineTestSupport *testSupport READ testSupport WRITE setTestSupport NOTIFY testSupportChanged FINAL)
@@ -452,6 +453,9 @@ public:
     qreal devicePixelRatio() const;
     void setDevicePixelRatio(qreal);
 
+    QQmlComponent *extraContextMenuEntriesComponent() const;
+    void setExtraContextMenuEntriesComponent(QQmlComponent *);
+
 #ifdef ENABLE_QML_TESTSUPPORT_API
     QQuickWebEngineTestSupport *testSupport() const;
     void setTestSupport(QQuickWebEngineTestSupport *testSupport);
@@ -514,6 +518,7 @@ Q_SIGNALS:
     Q_REVISION(4) void fileDialogRequested(QQuickWebEngineFileDialogRequest *request);
     Q_REVISION(4) void formValidationMessageRequested(QQuickWebEngineFormValidationMessageRequest *request);
     Q_REVISION(4) void devicePixelRatioChanged();
+    Q_REVISION(4) void extraContextMenuEntriesComponentChanged();
     Q_REVISION(5) void pdfPrintingFinished(const QString &filePath, bool success);
 
 #ifdef ENABLE_QML_TESTSUPPORT_API
-- 
2.7.4

