summaryrefslogtreecommitdiffstats
path: root/src/core/web_contents_adapter.cpp
diff options
context:
space:
mode:
authorPeter Varga <pvarga@inf.u-szeged.hu>2016-07-13 17:28:15 +0200
committerPeter Varga <pvarga@inf.u-szeged.hu>2016-08-02 14:08:32 +0000
commit9b8c1020f2752ab5095086577ab98fa80926c43d (patch)
treea0780e2dd66d2dd3eeff727cf81d97c0632aa36a /src/core/web_contents_adapter.cpp
parentea616d1047325fed629eb3bfef85550daff56ff7 (diff)
Add View Source API and make the feature available from context menu
[ChangeLog][QtWebEngineQML][QQuickWebEngineView] View Source feature is now supported [ChangeLog][QtWebEngineWidgets][QWebEnginePage] View Source feature is now supported Change-Id: Icc16da71fc6ec95880897fc9744dd8be8c004e00 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/core/web_contents_adapter.cpp')
-rw-r--r--src/core/web_contents_adapter.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp
index 364d4d5b2..c3789318a 100644
--- a/src/core/web_contents_adapter.cpp
+++ b/src/core/web_contents_adapter.cpp
@@ -1281,4 +1281,16 @@ FaviconManager *WebContentsAdapter::faviconManager()
return d->webContentsDelegate->faviconManager();
}
+void WebContentsAdapter::viewSource()
+{
+ Q_D(WebContentsAdapter);
+ d->webContents->ViewSource();
+}
+
+bool WebContentsAdapter::canViewSource()
+{
+ Q_D(WebContentsAdapter);
+ return d->webContents->GetController().CanViewSource();
+}
+
} // namespace QtWebEngineCore