本文整理汇总了C++中Geolocation::setIsAllowed方法的典型用法代码示例。如果您正苦于以下问题:C++ Geolocation::setIsAllowed方法的具体用法?C++ Geolocation::setIsAllowed怎么用?C++ Geolocation::setIsAllowed使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Geolocation
的用法示例。
在下文中一共展示了Geolocation::setIsAllowed方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setPermission
void GeolocationPermissionClientQt::setPermission(QWebFrame* webFrame, QWebPage::PermissionPolicy permission)
{
if (!m_pendingPermissionRequests.contains(webFrame))
return;
Geolocation* listener = m_pendingPermissionRequests.value(webFrame);
if (permission == QWebPage::PermissionGrantedByUser)
listener->setIsAllowed(true);
else if (permission == QWebPage::PermissionDeniedByUser)
listener->setIsAllowed(false);
else
return;
m_pendingPermissionRequests.remove(webFrame);
}
示例2: didReceiveGeolocationPermissionDecision
void GeolocationPermissionRequestManager::didReceiveGeolocationPermissionDecision(uint64_t geolocationID, bool allowed)
{
IDToGeolocationMap::iterator it = m_idToGeolocationMap.find(geolocationID);
if (it == m_idToGeolocationMap.end())
return;
Geolocation* geolocation = it->value;
geolocation->setIsAllowed(allowed);
m_idToGeolocationMap.remove(it);
m_geolocationToIDMap.remove(geolocation);
}
示例3: maybeCallbackFrames
void GeolocationPermissions::maybeCallbackFrames(String origin, bool allow)
{
// We can't track which frame issued the request, as frames can be deleted
// or have their contents replaced. Even uniqueChildName is not unique when
// frames are dynamically deleted and created. Instead, we simply call back
// to the Geolocation object in all frames from the correct origin.
for (Frame* frame = m_mainFrame; frame; frame = frame->tree()->traverseNext()) {
if (origin == frame->document()->securityOrigin()->toString()) {
// If the page has changed, it may no longer have a Geolocation
// object.
Geolocation* geolocation = frame->domWindow()->navigator()->optionalGeolocation();
if (geolocation)
geolocation->setIsAllowed(allow);
}
}
}
示例4: onPermission
void GeolocationControllerClientBlackBerry::onPermission(void* context, bool isAllowed)
{
Geolocation* position = static_cast<Geolocation*>(context);
position->setIsAllowed(isAllowed);
}