summaryrefslogtreecommitdiffstats
path: root/src/core/web_contents_adapter.cpp
diff options
context:
space:
mode:
authorSzabolcs David <davidsz@inf.u-szeged.hu>2014-11-20 05:31:14 -0800
committerSzabolcs David <davidsz@inf.u-szeged.hu>2015-01-16 11:28:44 +0100
commitdb2f69bb58ab369e44ea8bb30dcdbe90660578a2 (patch)
treedd25a6b7561fedb8e7abc5cd61f19d74360ffaae /src/core/web_contents_adapter.cpp
parente57b02dc9fe39a4ac8cc56f5d09eab4452a90210 (diff)
Widgets: Implement mouse lock permission API
If the user grants the permission with mouse click on the feature permission bar, the RenderWidgetHostView loses the focus but the focus is necessary for the pointer lock. Change-Id: Ifafd86b472e400c5690194dce2ea8a829a51c313 Reviewed-by: Andras Becsi <andras.becsi@theqtcompany.com>
Diffstat (limited to 'src/core/web_contents_adapter.cpp')
-rw-r--r--src/core/web_contents_adapter.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp
index dc20ea180..9398046d0 100644
--- a/src/core/web_contents_adapter.cpp
+++ b/src/core/web_contents_adapter.cpp
@@ -776,6 +776,20 @@ void WebContentsAdapter::runGeolocationRequestCallback(const QUrl &securityOrigi
d->webContentsDelegate->m_lastGeolocationRequestCallbacks.first.Run(allowed);
}
+void WebContentsAdapter::grantMouseLockPermission(bool granted)
+{
+ Q_D(WebContentsAdapter);
+
+ if (granted) {
+ if (RenderWidgetHostViewQt *rwhv = static_cast<RenderWidgetHostViewQt *>(d->webContents->GetRenderWidgetHostView()))
+ rwhv->Focus();
+ else
+ granted = false;
+ }
+
+ d->webContents->GotResponseToLockMouseRequest(granted);
+}
+
void WebContentsAdapter::dpiScaleChanged()
{
Q_D(WebContentsAdapter);