diff options
author | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2016-04-11 10:01:36 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2016-04-11 10:53:06 +0200 |
commit | 7978feadee937299798372bced1680f52b4b1842 (patch) | |
tree | bb844daade8c195c0a963f4663c2a0f880bd840a /src/core/web_contents_delegate_qt.cpp | |
parent | 56ceccc4d4ff395983c4a2fbbe12fe8cb591cfb5 (diff) | |
parent | 56955e73d4be21bc3f086d1c805352a96944a25c (diff) |
Merge branch '5.6' into 5.7
Change-Id: I53645ee5405b1c43807123fd3c196e314cfd1ce9
Diffstat (limited to 'src/core/web_contents_delegate_qt.cpp')
-rw-r--r-- | src/core/web_contents_delegate_qt.cpp | 28 |
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 e7d94d338..2dd75df83 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(); |