From f3eee55890c8a639c38244391936c8cb2a4a0479 Mon Sep 17 00:00:00 2001
From: Christophe Chapuis <chris.chapuis@gmail.com>
Date: Mon, 28 Sep 2015 20:19:49 +0200
Subject: [PATCH 03/18] WebEngineNewViewRequest: provide the requested URL as a
 property

Signed-off-by: Christophe Chapuis <chris.chapuis@gmail.com>
---
 src/webengine/api/qquickwebenginenewviewrequest.cpp | 8 ++++++++
 src/webengine/api/qquickwebenginenewviewrequest_p.h | 2 ++
 2 files changed, 10 insertions(+)

diff --git a/src/webengine/api/qquickwebenginenewviewrequest.cpp b/src/webengine/api/qquickwebenginenewviewrequest.cpp
index 99e3794..a369889 100644
--- a/src/webengine/api/qquickwebenginenewviewrequest.cpp
+++ b/src/webengine/api/qquickwebenginenewviewrequest.cpp
@@ -97,6 +97,14 @@ const QStringList &QQuickWebEngineNewViewRequest::additionalFeatures() const
     return m_additionalFeatures;
 }
 
+QUrl QQuickWebEngineNewViewRequest::url() const
+{
+    if (!m_adapter) {
+        return m_adapter->activeUrl();
+    }
+    return QUrl();
+}
+
 /*!
     \qmlmethod WebEngineNewViewRequest::openIn(WebEngineView view)
 
diff --git a/src/webengine/api/qquickwebenginenewviewrequest_p.h b/src/webengine/api/qquickwebenginenewviewrequest_p.h
index 304c6c0..591e983 100644
--- a/src/webengine/api/qquickwebenginenewviewrequest_p.h
+++ b/src/webengine/api/qquickwebenginenewviewrequest_p.h
@@ -68,6 +68,7 @@ class Q_WEBENGINE_PRIVATE_EXPORT QQuickWebEngineNewViewRequest : public QObject
     Q_PROPERTY(QUrl requestedUrl READ requestedUrl CONSTANT REVISION 1 FINAL)
     Q_PROPERTY(bool userInitiated READ isUserInitiated CONSTANT FINAL)
     Q_PROPERTY(QStringList additionalFeatures READ additionalFeatures CONSTANT FINAL)
+    Q_PROPERTY(QUrl url READ url)
 public:
     ~QQuickWebEngineNewViewRequest();
 
@@ -76,6 +77,7 @@ public:
     bool isUserInitiated() const;
     const QStringList &additionalFeatures() const;
     Q_INVOKABLE void openIn(QQuickWebEngineView *view);
+    QUrl url() const;
 
 private:
     QQuickWebEngineNewViewRequest();
-- 
2.7.4

