summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSzabolcs David <davidsz@inf.u-szeged.hu>2014-04-10 05:01:51 -0700
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-05-05 12:50:48 +0200
commitf135b53640f6e74686d3fc8bc6ce8ffc427c36c1 (patch)
tree88bae161f32942406506dbb9307131308c6cdd21 /src
parente41b5bf1ef861a69c2825150215d7f5e0c96a847 (diff)
Add linkHovered signal to the QQuickWebEngineView
I dropped hovered title support from the QtWebKit API, it seems we don't need that logic. Change-Id: I5617c295344512a35aa526a6f1307f0b21f866d6 Reviewed-by: Andras Becsi <andras.becsi@digia.com>
Diffstat (limited to 'src')
-rw-r--r--src/core/web_contents_adapter_client.h1
-rw-r--r--src/core/web_contents_delegate_qt.cpp7
-rw-r--r--src/core/web_contents_delegate_qt.h1
-rw-r--r--src/webengine/api/qquickwebengineview.cpp6
-rw-r--r--src/webengine/api/qquickwebengineview_p.h1
-rw-r--r--src/webengine/api/qquickwebengineview_p_p.h1
-rw-r--r--src/webenginewidgets/api/qwebenginepage_p.h1
7 files changed, 18 insertions, 0 deletions
diff --git a/src/core/web_contents_adapter_client.h b/src/core/web_contents_adapter_client.h
index 44668b53..686b8237 100644
--- a/src/core/web_contents_adapter_client.h
+++ b/src/core/web_contents_adapter_client.h
@@ -131,6 +131,7 @@ public:
virtual void urlChanged(const QUrl&) = 0;
virtual void iconChanged(const QUrl&) = 0;
virtual void loadProgressChanged(int progress) = 0;
+ virtual void didUpdateTargetURL(const QUrl&) = 0;
virtual void selectionChanged() = 0;
virtual QRectF viewportRect() const = 0;
virtual QPoint mapToGlobal(const QPoint &posInView) const = 0;
diff --git a/src/core/web_contents_delegate_qt.cpp b/src/core/web_contents_delegate_qt.cpp
index 756646be..606d62d9 100644
--- a/src/core/web_contents_delegate_qt.cpp
+++ b/src/core/web_contents_delegate_qt.cpp
@@ -241,3 +241,10 @@ void WebContentsDelegateQt::RequestMediaAccessPermission(content::WebContents *w
{
MediaCaptureDevicesDispatcher::GetInstance()->processMediaAccessRequest(m_viewClient, web_contents, request, callback);
}
+
+void WebContentsDelegateQt::UpdateTargetURL(content::WebContents *source, int32 page_id, const GURL &url)
+{
+ Q_UNUSED(source)
+ Q_UNUSED(page_id)
+ m_viewClient->didUpdateTargetURL(toQt(url));
+}
diff --git a/src/core/web_contents_delegate_qt.h b/src/core/web_contents_delegate_qt.h
index 25542877..4b33fb99 100644
--- a/src/core/web_contents_delegate_qt.h
+++ b/src/core/web_contents_delegate_qt.h
@@ -81,6 +81,7 @@ public:
virtual bool AddMessageToConsole(content::WebContents* source, int32 level, const base::string16& message, int32 line_no, const base::string16& source_id) Q_DECL_OVERRIDE;
virtual void FindReply(content::WebContents *source, int request_id, int number_of_matches, const gfx::Rect& selection_rect, int active_match_ordinal, bool final_update) Q_DECL_OVERRIDE;
virtual void RequestMediaAccessPermission(content::WebContents* web_contents, const content::MediaStreamRequest& request, const content::MediaResponseCallback& callback) Q_DECL_OVERRIDE;
+ virtual void UpdateTargetURL(content::WebContents *source, int32 page_id, const GURL &url) Q_DECL_OVERRIDE;
private:
WebContentsAdapterClient *m_viewClient;
diff --git a/src/webengine/api/qquickwebengineview.cpp b/src/webengine/api/qquickwebengineview.cpp
index 772befe1..e124f900 100644
--- a/src/webengine/api/qquickwebengineview.cpp
+++ b/src/webengine/api/qquickwebengineview.cpp
@@ -233,6 +233,12 @@ void QQuickWebEngineViewPrivate::loadProgressChanged(int progress)
Q_EMIT q->loadProgressChanged();
}
+void QQuickWebEngineViewPrivate::didUpdateTargetURL(const QUrl &hoveredUrl)
+{
+ Q_Q(QQuickWebEngineView);
+ Q_EMIT q->linkHovered(hoveredUrl);
+}
+
QRectF QQuickWebEngineViewPrivate::viewportRect() const
{
Q_Q(const QQuickWebEngineView);
diff --git a/src/webengine/api/qquickwebengineview_p.h b/src/webengine/api/qquickwebengineview_p.h
index d9284e73..5c239784 100644
--- a/src/webengine/api/qquickwebengineview_p.h
+++ b/src/webengine/api/qquickwebengineview_p.h
@@ -124,6 +124,7 @@ Q_SIGNALS:
void iconChanged();
void loadingChanged(QQuickWebEngineLoadRequest *loadRequest);
void loadProgressChanged();
+ void linkHovered(const QUrl &hoveredUrl);
void javaScriptConsoleMessage(JavaScriptConsoleMessageLevel level, const QString &message, int lineNumber, const QString &sourceID);
protected:
diff --git a/src/webengine/api/qquickwebengineview_p_p.h b/src/webengine/api/qquickwebengineview_p_p.h
index ec03bada..c5d32b55 100644
--- a/src/webengine/api/qquickwebengineview_p_p.h
+++ b/src/webengine/api/qquickwebengineview_p_p.h
@@ -140,6 +140,7 @@ public:
virtual void urlChanged(const QUrl&) Q_DECL_OVERRIDE;
virtual void iconChanged(const QUrl&) Q_DECL_OVERRIDE;
virtual void loadProgressChanged(int progress) Q_DECL_OVERRIDE;
+ virtual void didUpdateTargetURL(const QUrl&) Q_DECL_OVERRIDE;
virtual void selectionChanged() Q_DECL_OVERRIDE { }
virtual QRectF viewportRect() const Q_DECL_OVERRIDE;
virtual QPoint mapToGlobal(const QPoint &posInView) const Q_DECL_OVERRIDE;
diff --git a/src/webenginewidgets/api/qwebenginepage_p.h b/src/webenginewidgets/api/qwebenginepage_p.h
index 827840c7..d94b47fd 100644
--- a/src/webenginewidgets/api/qwebenginepage_p.h
+++ b/src/webenginewidgets/api/qwebenginepage_p.h
@@ -114,6 +114,7 @@ public:
virtual void urlChanged(const QUrl&) Q_DECL_OVERRIDE;
virtual void iconChanged(const QUrl&) Q_DECL_OVERRIDE;
virtual void loadProgressChanged(int progress) Q_DECL_OVERRIDE;
+ virtual void didUpdateTargetURL(const QUrl&) Q_DECL_OVERRIDE { };
virtual void selectionChanged() Q_DECL_OVERRIDE;
virtual QRectF viewportRect() const Q_DECL_OVERRIDE;
virtual QPoint mapToGlobal(const QPoint &posInView) const Q_DECL_OVERRIDE;