Changeset 72601 in webkit
- Timestamp:
- Nov 23, 2010 6:23:24 AM (13 years ago)
- Location:
- trunk
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebKit/qt/Api/qwebpage.cpp
r72600 r72601 2112 2112 } 2113 2113 2114 void QWebPage::setUserPermission(QWebFrame* frame, PermissionDomain domain, PermissionPolicy policy)2115 { 2116 switch ( domain) {2117 case Notifications PermissionDomain:2114 void QWebPage::setUserPermission(QWebFrame* frame, Feature feature, PermissionPolicy policy) 2115 { 2116 switch (feature) { 2117 case Notifications: 2118 2118 #if ENABLE(NOTIFICATIONS) 2119 2119 if (policy == PermissionGrantedByUser) … … 2121 2121 #endif 2122 2122 break; 2123 case Geolocation PermissionDomain:2123 case Geolocation: 2124 2124 #if ENABLE(GEOLOCATION) 2125 2125 GeolocationPermissionClientQt::geolocationPermissionClient()->setPermission(frame, policy); -
trunk/WebKit/qt/Api/qwebpage.h
r72600 r72601 204 204 }; 205 205 206 enum PermissionDomain{207 Notifications PermissionDomain,208 Geolocation PermissionDomain206 enum Feature { 207 Notifications, 208 Geolocation 209 209 }; 210 210 … … 309 309 QMenu *createStandardContextMenu(); 310 310 311 void setUserPermission(QWebFrame* frame, PermissionDomain domain, PermissionPolicy policy);311 void setUserPermission(QWebFrame* frame, Feature feature, PermissionPolicy policy); 312 312 313 313 QStringList supportedContentTypes() const; … … 394 394 void viewportChangeRequested(); 395 395 396 void requestPermissionFromUser(QWebFrame* frame, QWebPage:: PermissionDomain domain);397 void cancelRequestsForPermission(QWebFrame* frame, QWebPage:: PermissionDomain domain);396 void requestPermissionFromUser(QWebFrame* frame, QWebPage::Feature feature); 397 void cancelRequestsForPermission(QWebFrame* frame, QWebPage::Feature feature); 398 398 399 399 protected: -
trunk/WebKit/qt/ChangeLog
r72600 r72601 1 2010-11-23 Simon Hausmann <simon.hausmann@nokia.com> 2 3 Reviewed by Tor Arne Vestbø. 4 5 [Qt] Review the setUserPermission & friends API 6 https://bugs.webkit.org/show_bug.cgi?id=46810 7 8 Rename PermissionDomain to Feature, NotificationsPermissionDomain to Notifications 9 and GeolocationPermissionDomain to Geolocation. 10 11 * Api/qwebpage.cpp: 12 (QWebPage::setUserPermission): 13 * Api/qwebpage.h: 14 * WebCoreSupport/GeolocationPermissionClientQt.cpp: 15 (WebCore::GeolocationPermissionClientQt::requestGeolocationPermissionForFrame): 16 (WebCore::GeolocationPermissionClientQt::cancelGeolocationPermissionRequestForFrame): 17 * WebCoreSupport/NotificationPresenterClientQt.cpp: 18 (WebCore::NotificationPresenterClientQt::requestPermission): 19 (WebCore::NotificationPresenterClientQt::cancelRequestsForPermission): 20 * tests/qwebpage/tst_qwebpage.cpp: 21 (JSTestPage::requestPermission): 22 (tst_QWebPage::geolocationRequestJS): 23 1 24 2010-11-23 Simon Hausmann <simon.hausmann@nokia.com> 2 25 -
trunk/WebKit/qt/WebCoreSupport/GeolocationPermissionClientQt.cpp
r72600 r72601 66 66 67 67 QWebPage* page = webFrame->page(); 68 emit page->requestPermissionFromUser(webFrame, QWebPage::Geolocation PermissionDomain);68 emit page->requestPermissionFromUser(webFrame, QWebPage::Geolocation); 69 69 } 70 70 … … 75 75 76 76 QWebPage* page = webFrame->page(); 77 emit page->cancelRequestsForPermission(webFrame, QWebPage::Geolocation PermissionDomain);77 emit page->cancelRequestsForPermission(webFrame, QWebPage::Geolocation); 78 78 } 79 79 -
trunk/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.cpp
r72101 r72601 329 329 if (toPage(context) && toFrame(context)) { 330 330 m_pendingPermissionRequests.insert(context, info); 331 emit toPage(context)->requestPermissionFromUser(toFrame(context), QWebPage::Notifications PermissionDomain);331 emit toPage(context)->requestPermissionFromUser(toFrame(context), QWebPage::Notifications); 332 332 } 333 333 } … … 359 359 printf("DESKTOP NOTIFICATION PERMISSION REQUEST CANCELLED: %s\n", QString(context->securityOrigin()->toString()).toUtf8().constData()); 360 360 361 emit page->cancelRequestsForPermission(frame, QWebPage::Notifications PermissionDomain);361 emit page->cancelRequestsForPermission(frame, QWebPage::Notifications); 362 362 } 363 363 -
trunk/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
r72600 r72601 221 221 return true; 222 222 } 223 void requestPermission(QWebFrame* frame, QWebPage:: PermissionDomain domain)223 void requestPermission(QWebFrame* frame, QWebPage::Feature feature) 224 224 { 225 225 if (m_allowGeolocation) 226 setUserPermission(frame, domain, PermissionGrantedByUser);226 setUserPermission(frame, feature, PermissionGrantedByUser); 227 227 else 228 setUserPermission(frame, domain, PermissionDeniedByUser);228 setUserPermission(frame, feature, PermissionDeniedByUser); 229 229 } 230 230 … … 257 257 258 258 JSTestPage* newPage = new JSTestPage(m_view); 259 connect(newPage, SIGNAL(requestPermissionFromUser(QWebFrame*, QWebPage:: PermissionDomain)),260 newPage, SLOT(requestPermission(QWebFrame*, QWebPage:: PermissionDomain)));259 connect(newPage, SIGNAL(requestPermissionFromUser(QWebFrame*, QWebPage::Feature)), 260 newPage, SLOT(requestPermission(QWebFrame*, QWebPage::Feature))); 261 261 262 262 newPage->setGeolocationPermission(false); -
trunk/WebKitTools/ChangeLog
r72600 r72601 1 2010-11-23 Simon Hausmann <simon.hausmann@nokia.com> 2 3 Reviewed by Tor Arne Vestbø. 4 5 [Qt] Review the setUserPermission & friends API 6 https://bugs.webkit.org/show_bug.cgi?id=46810 7 8 Rename PermissionDomain to Feature, NotificationsPermissionDomain to Notifications 9 and GeolocationPermissionDomain to Geolocation. 10 11 * DumpRenderTree/qt/DumpRenderTreeQt.cpp: 12 (WebCore::WebPage::WebPage): 13 (WebCore::WebPage::requestPermission): 14 (WebCore::WebPage::cancelPermission): 15 (WebCore::WebPage::permissionSet): 16 (WebCore::DumpRenderTree::geolocationPermissionSet): 17 * DumpRenderTree/qt/DumpRenderTreeQt.h: 18 * DumpRenderTree/qt/LayoutTestControllerQt.cpp: 19 (LayoutTestController::grantDesktopNotificationPermission): 20 * QtTestBrowser/webpage.cpp: 21 (WebPage::WebPage): 22 (WebPage::requestPermission): 23 (WebPage::cancelRequestsForPermission): 24 * QtTestBrowser/webpage.h: 25 1 26 2010-11-23 Simon Hausmann <simon.hausmann@nokia.com> 2 27 -
trunk/WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.cpp
r72600 r72601 159 159 setPluginFactory(new TestPlugin(this)); 160 160 161 connect(this, SIGNAL(requestPermissionFromUser(QWebFrame*, QWebPage:: PermissionDomain)), this, SLOT(requestPermission(QWebFrame*, QWebPage::PermissionDomain)));162 connect(this, SIGNAL(cancelRequestsForPermission(QWebFrame*, QWebPage:: PermissionDomain)), this, SLOT(cancelPermission(QWebFrame*, QWebPage::PermissionDomain)));161 connect(this, SIGNAL(requestPermissionFromUser(QWebFrame*, QWebPage::Feature)), this, SLOT(requestPermission(QWebFrame*, QWebPage::Feature))); 162 connect(this, SIGNAL(cancelRequestsForPermission(QWebFrame*, QWebPage::Feature)), this, SLOT(cancelPermission(QWebFrame*, QWebPage::Feature))); 163 163 } 164 164 … … 220 220 } 221 221 222 void WebPage::requestPermission(QWebFrame* frame, QWebPage:: PermissionDomain domain)223 { 224 switch ( domain) {225 case Notifications PermissionDomain:222 void WebPage::requestPermission(QWebFrame* frame, QWebPage::Feature feature) 223 { 224 switch (feature) { 225 case Notifications: 226 226 if (!m_drt->layoutTestController()->ignoreReqestForPermission()) 227 setUserPermission(frame, domain, PermissionGrantedByUser);227 setUserPermission(frame, feature, PermissionGrantedByUser); 228 228 break; 229 case Geolocation PermissionDomain:229 case Geolocation: 230 230 if (m_drt->layoutTestController()->isGeolocationPermissionSet()) 231 231 if (m_drt->layoutTestController()->geolocationPermission()) 232 setUserPermission(frame, domain, PermissionGrantedByUser);232 setUserPermission(frame, feature, PermissionGrantedByUser); 233 233 else 234 setUserPermission(frame, domain, PermissionDeniedByUser);234 setUserPermission(frame, feature, PermissionDeniedByUser); 235 235 else 236 236 m_pendingGeolocationRequests.append(frame); … … 241 241 } 242 242 243 void WebPage::cancelPermission(QWebFrame* frame, QWebPage:: PermissionDomain domain)244 { 245 switch ( domain) {246 case Geolocation PermissionDomain:243 void WebPage::cancelPermission(QWebFrame* frame, QWebPage::Feature feature) 244 { 245 switch (feature) { 246 case Geolocation: 247 247 m_pendingGeolocationRequests.removeOne(frame); 248 248 break; … … 252 252 } 253 253 254 void WebPage::permissionSet(QWebPage:: PermissionDomain domain)255 { 256 switch ( domain) {257 case Geolocation PermissionDomain:254 void WebPage::permissionSet(QWebPage::Feature feature) 255 { 256 switch (feature) { 257 case Geolocation: 258 258 { 259 259 Q_ASSERT(m_drt->layoutTestController()->isGeolocationPermissionSet()); 260 260 foreach (QWebFrame* frame, m_pendingGeolocationRequests) 261 261 if (m_drt->layoutTestController()->geolocationPermission()) 262 setUserPermission(frame, domain, PermissionGrantedByUser);262 setUserPermission(frame, feature, PermissionGrantedByUser); 263 263 else 264 setUserPermission(frame, domain, PermissionDeniedByUser);264 setUserPermission(frame, feature, PermissionDeniedByUser); 265 265 266 266 m_pendingGeolocationRequests.clear(); … … 1078 1078 void DumpRenderTree::geolocationPermissionSet() 1079 1079 { 1080 m_page->permissionSet(QWebPage::Geolocation PermissionDomain);1080 m_page->permissionSet(QWebPage::Geolocation); 1081 1081 } 1082 1082 -
trunk/WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.h
r72101 r72601 195 195 QObject* createPlugin(const QString&, const QUrl&, const QStringList&, const QStringList&); 196 196 197 void permissionSet(QWebPage:: PermissionDomain domain);197 void permissionSet(QWebPage::Feature feature); 198 198 199 199 public slots: 200 200 bool shouldInterruptJavaScript() { return false; } 201 void requestPermission(QWebFrame* frame, QWebPage:: PermissionDomain domain);202 void cancelPermission(QWebFrame* frame, QWebPage:: PermissionDomain domain);201 void requestPermission(QWebFrame* frame, QWebPage::Feature feature); 202 void cancelPermission(QWebFrame* frame, QWebPage::Feature feature); 203 203 204 204 protected: -
trunk/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp
r72600 r72601 199 199 { 200 200 QWebFrame* frame = m_drt->webPage()->mainFrame(); 201 m_drt->webPage()->setUserPermission(frame, QWebPage::Notifications PermissionDomain, QWebPage::PermissionGrantedByUser);201 m_drt->webPage()->setUserPermission(frame, QWebPage::Notifications, QWebPage::PermissionGrantedByUser); 202 202 m_desktopNotificationAllowedOrigins.append(origin); 203 203 } -
trunk/WebKitTools/QtTestBrowser/webpage.cpp
r72600 r72601 51 51 connect(networkAccessManager(), SIGNAL(authenticationRequired(QNetworkReply*, QAuthenticator*)), 52 52 this, SLOT(authenticationRequired(QNetworkReply*, QAuthenticator*))); 53 connect(this, SIGNAL(requestPermissionFromUser(QWebFrame*, QWebPage:: PermissionDomain)), this, SLOT(requestPermission(QWebFrame*, QWebPage::PermissionDomain)));54 connect(this, SIGNAL(cancelRequestsForPermission(QWebFrame*, QWebPage:: PermissionDomain)), this, SLOT(cancelRequestsForPermission(QWebFrame*, QWebPage::PermissionDomain)));53 connect(this, SIGNAL(requestPermissionFromUser(QWebFrame*, QWebPage::Feature)), this, SLOT(requestPermission(QWebFrame*, QWebPage::Feature))); 54 connect(this, SIGNAL(cancelRequestsForPermission(QWebFrame*, QWebPage::Feature)), this, SLOT(cancelRequestsForPermission(QWebFrame*, QWebPage::Feature))); 55 55 } 56 56 … … 168 168 } 169 169 170 void WebPage::requestPermission(QWebFrame* frame, QWebPage:: PermissionDomain domain)171 { 172 setUserPermission(frame, domain, PermissionGrantedByUser);173 } 174 175 void WebPage::cancelRequestsForPermission(QWebFrame*, QWebPage:: PermissionDomain)170 void WebPage::requestPermission(QWebFrame* frame, QWebPage::Feature feature) 171 { 172 setUserPermission(frame, feature, PermissionGrantedByUser); 173 } 174 175 void WebPage::cancelRequestsForPermission(QWebFrame*, QWebPage::Feature) 176 176 { 177 177 } -
trunk/WebKitTools/QtTestBrowser/webpage.h
r72101 r72601 58 58 bool shouldInterruptJavaScript(); 59 59 void authenticationRequired(QNetworkReply*, QAuthenticator*); 60 void requestPermission(QWebFrame* frame, QWebPage:: PermissionDomain domain);61 void cancelRequestsForPermission(QWebFrame* frame, QWebPage:: PermissionDomain domain);60 void requestPermission(QWebFrame* frame, QWebPage::Feature feature); 61 void cancelRequestsForPermission(QWebFrame* frame, QWebPage::Feature feature); 62 62 63 63 private:
Note: See TracChangeset
for help on using the changeset viewer.