diff options
author | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2016-04-11 09:05:49 +0000 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2016-04-11 15:33:49 +0000 |
commit | 22a550303618202135e58f5673e7b8935d578687 (patch) | |
tree | 560918164edd7b76a2a8b6246f6dbca0ee69cf9a /src/core/web_contents_delegate_qt.cpp | |
parent | f8ed4ca51333157170f0fc94e2deff0d91cf4833 (diff) | |
parent | 7978feadee937299798372bced1680f52b4b1842 (diff) |
Merge "Merge branch '5.6' into 5.7" into refs/staging/5.7v5.7.0-beta1
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(); |