void AWebPage::enableNotifications(bool val) { if (val) setFeaturePermission(currentFrame(), QWebPage::Notifications, QWebPage::PermissionGrantedByUser); else setFeaturePermission(currentFrame(), QWebPage::Notifications, QWebPage::PermissionDeniedByUser); }
void WebPage::permissionSet(QWebPage::Feature feature) { switch (feature) { case Geolocation: { Q_ASSERT(m_drt->layoutTestController()->isGeolocationPermissionSet()); foreach (QWebFrame* frame, m_pendingGeolocationRequests) if (m_drt->layoutTestController()->geolocationPermission()) setFeaturePermission(frame, feature, PermissionGrantedByUser); else setFeaturePermission(frame, feature, PermissionDeniedByUser); m_pendingGeolocationRequests.clear(); break; } default: break; } }
void WebPage::requestPermission(QWebFrame* frame, QWebPage::Feature feature) { switch (feature) { case Notifications: if (!m_drt->layoutTestController()->ignoreReqestForPermission()) setFeaturePermission(frame, feature, PermissionGrantedByUser); break; case Geolocation: if (m_drt->layoutTestController()->isGeolocationPermissionSet()) if (m_drt->layoutTestController()->geolocationPermission()) setFeaturePermission(frame, feature, PermissionGrantedByUser); else setFeaturePermission(frame, feature, PermissionDeniedByUser); else m_pendingGeolocationRequests.append(frame); break; default: break; } }
void WebPage::requestPermission(QWebFrame* frame, QWebPage::Feature feature) { setFeaturePermission(frame, feature, PermissionGrantedByUser); }