示例#1
0
static void webkitGeolocationPermissionRequestAllow(WebKitPermissionRequest* request)
{
    ASSERT(WEBKIT_IS_GEOLOCATION_PERMISSION_REQUEST(request));

    WebKitGeolocationPermissionRequestPrivate* priv = WEBKIT_GEOLOCATION_PERMISSION_REQUEST(request)->priv;

    // Only one decision at a time.
    if (priv->madeDecision)
        return;

    WKGeolocationPermissionRequestAllow(priv->wkRequest.get());
    priv->madeDecision = true;
}
示例#2
0
void TestController::decidePolicyForGeolocationPermissionRequestIfPossible()
{
    if (!m_isGeolocationPermissionSet)
        return;

    for (size_t i = 0; i < m_geolocationPermissionRequests.size(); ++i) {
        WKGeolocationPermissionRequestRef permissionRequest = m_geolocationPermissionRequests[i].get();
        if (m_isGeolocationPermissionAllowed)
            WKGeolocationPermissionRequestAllow(permissionRequest);
        else
            WKGeolocationPermissionRequestDeny(permissionRequest);
    }
    m_geolocationPermissionRequests.clear();
}
void QWebPermissionRequest::setAllow(bool accepted)
{
    d->allow = accepted;
    switch (type()) {
    case Geolocation: {
        if (accepted)
            WKGeolocationPermissionRequestAllow(d->geolocationRequest.get());
        else
            WKGeolocationPermissionRequestDeny(d->geolocationRequest.get());
        break;
    }
    case Notification: {
        if (accepted)
            WKNotificationPermissionRequestAllow(d->notificationRequest.get());
        else
            WKNotificationPermissionRequestDeny(d->notificationRequest.get());
        break;
    }
    default:
        ASSERT_NOT_REACHED();
    }

    deleteLater();
}
示例#4
0
void decidePolicyForGeolocationPermissionRequestCallBack(WKPageRef page, WKFrameRef frame, WKSecurityOriginRef origin, WKGeolocationPermissionRequestRef permissionRequest, const void* clientInfo)
{
    WKGeolocationPermissionRequestAllow(permissionRequest);
}