summaryrefslogtreecommitdiffstats
path: root/src/core/web_contents_delegate_qt.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/web_contents_delegate_qt.cpp')
-rw-r--r--src/core/web_contents_delegate_qt.cpp28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/core/web_contents_delegate_qt.cpp b/src/core/web_contents_delegate_qt.cpp
index e7d94d33..2dd75df8 100644
--- a/src/core/web_contents_delegate_qt.cpp
+++ b/src/core/web_contents_delegate_qt.cpp
@@ -135,6 +135,20 @@ void WebContentsDelegateQt::NavigationStateChanged(content::WebContents* source,
}
}
+bool WebContentsDelegateQt::ShouldPreserveAbortedURLs(content::WebContents *source)
+{
+ Q_UNUSED(source)
+
+ // Allow failed URLs to stick around in the URL bar, but only when the error-page is enabled.
+ WebEngineSettings *settings = m_viewClient->webEngineSettings();
+ bool isErrorPageEnabled = settings->testAttribute(settings->Attribute::ErrorPageEnabled);
+
+ if (isErrorPageEnabled)
+ return true;
+
+ return false;
+}
+
void WebContentsDelegateQt::AddNewContents(content::WebContents* source, content::WebContents* new_contents, WindowOpenDisposition disposition, const gfx::Rect& initial_pos, bool user_gesture, bool* was_blocked)
{
Q_UNUSED(source)
@@ -441,6 +455,20 @@ void WebContentsDelegateQt::BeforeUnloadFired(content::WebContents *tab, bool pr
m_viewClient->windowCloseRejected();
}
+bool WebContentsDelegateQt::CheckMediaAccessPermission(content::WebContents *web_contents, const GURL& security_origin, content::MediaStreamType type)
+{
+ switch (type) {
+ case content::MEDIA_DEVICE_AUDIO_CAPTURE:
+ return m_viewClient->browserContextAdapter()->checkPermission(toQt(security_origin), BrowserContextAdapter::AudioCapturePermission);
+ case content::MEDIA_DEVICE_VIDEO_CAPTURE:
+ return m_viewClient->browserContextAdapter()->checkPermission(toQt(security_origin), BrowserContextAdapter::VideoCapturePermission);
+ default:
+ LOG(INFO) << "WebContentsDelegateQt::CheckMediaAccessPermission: "
+ << "Unsupported media stream type checked" << type;
+ return false;
+ }
+}
+
FaviconManager *WebContentsDelegateQt::faviconManager()
{
return m_faviconManager.data();