[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
hausmann at webkit.org
hausmann at webkit.org
Wed Dec 22 16:25:27 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 650e31e318913003b5e9e092ed0fbba4e48a8a40
Author: hausmann at webkit.org <hausmann at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Nov 23 14:23:24 2010 +0000
[Qt] Review the setUserPermission & friends API
https://bugs.webkit.org/show_bug.cgi?id=46810
Reviewed by Tor Arne Vestbø.
Rename PermissionDomain to Feature, NotificationsPermissionDomain to Notifications
and GeolocationPermissionDomain to Geolocation.
WebKit/qt:
* Api/qwebpage.cpp:
(QWebPage::setUserPermission):
* Api/qwebpage.h:
* WebCoreSupport/GeolocationPermissionClientQt.cpp:
(WebCore::GeolocationPermissionClientQt::requestGeolocationPermissionForFrame):
(WebCore::GeolocationPermissionClientQt::cancelGeolocationPermissionRequestForFrame):
* WebCoreSupport/NotificationPresenterClientQt.cpp:
(WebCore::NotificationPresenterClientQt::requestPermission):
(WebCore::NotificationPresenterClientQt::cancelRequestsForPermission):
* tests/qwebpage/tst_qwebpage.cpp:
(JSTestPage::requestPermission):
(tst_QWebPage::geolocationRequestJS):
WebKitTools:
* DumpRenderTree/qt/DumpRenderTreeQt.cpp:
(WebCore::WebPage::WebPage):
(WebCore::WebPage::requestPermission):
(WebCore::WebPage::cancelPermission):
(WebCore::WebPage::permissionSet):
(WebCore::DumpRenderTree::geolocationPermissionSet):
* DumpRenderTree/qt/DumpRenderTreeQt.h:
* DumpRenderTree/qt/LayoutTestControllerQt.cpp:
(LayoutTestController::grantDesktopNotificationPermission):
* QtTestBrowser/webpage.cpp:
(WebPage::WebPage):
(WebPage::requestPermission):
(WebPage::cancelRequestsForPermission):
* QtTestBrowser/webpage.h:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@72601 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit/qt/Api/qwebpage.cpp b/WebKit/qt/Api/qwebpage.cpp
index 14090a3..d9288f2 100644
--- a/WebKit/qt/Api/qwebpage.cpp
+++ b/WebKit/qt/Api/qwebpage.cpp
@@ -2111,16 +2111,16 @@ bool QWebPage::shouldInterruptJavaScript()
#endif
}
-void QWebPage::setUserPermission(QWebFrame* frame, PermissionDomain domain, PermissionPolicy policy)
+void QWebPage::setUserPermission(QWebFrame* frame, Feature feature, PermissionPolicy policy)
{
- switch (domain) {
- case NotificationsPermissionDomain:
+ switch (feature) {
+ case Notifications:
#if ENABLE(NOTIFICATIONS)
if (policy == PermissionGrantedByUser)
NotificationPresenterClientQt::notificationPresenter()->allowNotificationForFrame(frame->d->frame);
#endif
break;
- case GeolocationPermissionDomain:
+ case Geolocation:
#if ENABLE(GEOLOCATION)
GeolocationPermissionClientQt::geolocationPermissionClient()->setPermission(frame, policy);
#endif
diff --git a/WebKit/qt/Api/qwebpage.h b/WebKit/qt/Api/qwebpage.h
index d440558..e4c1da2 100644
--- a/WebKit/qt/Api/qwebpage.h
+++ b/WebKit/qt/Api/qwebpage.h
@@ -203,9 +203,9 @@ public:
PermissionDeniedByUser
};
- enum PermissionDomain {
- NotificationsPermissionDomain,
- GeolocationPermissionDomain
+ enum Feature {
+ Notifications,
+ Geolocation
};
class QWEBKIT_EXPORT ViewportAttributes {
@@ -308,7 +308,7 @@ public:
QMenu *createStandardContextMenu();
- void setUserPermission(QWebFrame* frame, PermissionDomain domain, PermissionPolicy policy);
+ void setUserPermission(QWebFrame* frame, Feature feature, PermissionPolicy policy);
QStringList supportedContentTypes() const;
bool supportsContentType(const QString& mimeType) const;
@@ -393,8 +393,8 @@ Q_SIGNALS:
void viewportChangeRequested();
- void requestPermissionFromUser(QWebFrame* frame, QWebPage::PermissionDomain domain);
- void cancelRequestsForPermission(QWebFrame* frame, QWebPage::PermissionDomain domain);
+ void requestPermissionFromUser(QWebFrame* frame, QWebPage::Feature feature);
+ void cancelRequestsForPermission(QWebFrame* frame, QWebPage::Feature feature);
protected:
virtual QWebPage *createWindow(WebWindowType type);
diff --git a/WebKit/qt/ChangeLog b/WebKit/qt/ChangeLog
index 0ab75eb..9f3560f 100644
--- a/WebKit/qt/ChangeLog
+++ b/WebKit/qt/ChangeLog
@@ -5,6 +5,29 @@
[Qt] Review the setUserPermission & friends API
https://bugs.webkit.org/show_bug.cgi?id=46810
+ Rename PermissionDomain to Feature, NotificationsPermissionDomain to Notifications
+ and GeolocationPermissionDomain to Geolocation.
+
+ * Api/qwebpage.cpp:
+ (QWebPage::setUserPermission):
+ * Api/qwebpage.h:
+ * WebCoreSupport/GeolocationPermissionClientQt.cpp:
+ (WebCore::GeolocationPermissionClientQt::requestGeolocationPermissionForFrame):
+ (WebCore::GeolocationPermissionClientQt::cancelGeolocationPermissionRequestForFrame):
+ * WebCoreSupport/NotificationPresenterClientQt.cpp:
+ (WebCore::NotificationPresenterClientQt::requestPermission):
+ (WebCore::NotificationPresenterClientQt::cancelRequestsForPermission):
+ * tests/qwebpage/tst_qwebpage.cpp:
+ (JSTestPage::requestPermission):
+ (tst_QWebPage::geolocationRequestJS):
+
+2010-11-23 Simon Hausmann <simon.hausmann at nokia.com>
+
+ Reviewed by Tor Arne Vestbø.
+
+ [Qt] Review the setUserPermission & friends API
+ https://bugs.webkit.org/show_bug.cgi?id=46810
+
Add a ByUser suffix to PermissionGranted/Denied. In the future
we can add PermissionGrantedByDefault.
diff --git a/WebKit/qt/WebCoreSupport/GeolocationPermissionClientQt.cpp b/WebKit/qt/WebCoreSupport/GeolocationPermissionClientQt.cpp
index d7619d0..2e54935 100644
--- a/WebKit/qt/WebCoreSupport/GeolocationPermissionClientQt.cpp
+++ b/WebKit/qt/WebCoreSupport/GeolocationPermissionClientQt.cpp
@@ -65,7 +65,7 @@ void GeolocationPermissionClientQt::requestGeolocationPermissionForFrame(QWebFra
m_pendingPermissionRequests.insert(webFrame, listener);
QWebPage* page = webFrame->page();
- emit page->requestPermissionFromUser(webFrame, QWebPage::GeolocationPermissionDomain);
+ emit page->requestPermissionFromUser(webFrame, QWebPage::Geolocation);
}
@@ -74,7 +74,7 @@ void GeolocationPermissionClientQt::cancelGeolocationPermissionRequestForFrame(Q
m_pendingPermissionRequests.remove(webFrame);
QWebPage* page = webFrame->page();
- emit page->cancelRequestsForPermission(webFrame, QWebPage::GeolocationPermissionDomain);
+ emit page->cancelRequestsForPermission(webFrame, QWebPage::Geolocation);
}
void GeolocationPermissionClientQt::setPermission(QWebFrame* webFrame, QWebPage::PermissionPolicy permission)
diff --git a/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.cpp b/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.cpp
index e58829b..d5caf36 100644
--- a/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.cpp
+++ b/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.cpp
@@ -328,7 +328,7 @@ void NotificationPresenterClientQt::requestPermission(ScriptExecutionContext* co
if (toPage(context) && toFrame(context)) {
m_pendingPermissionRequests.insert(context, info);
- emit toPage(context)->requestPermissionFromUser(toFrame(context), QWebPage::NotificationsPermissionDomain);
+ emit toPage(context)->requestPermissionFromUser(toFrame(context), QWebPage::Notifications);
}
}
}
@@ -358,7 +358,7 @@ void NotificationPresenterClientQt::cancelRequestsForPermission(ScriptExecutionC
if (dumpNotification)
printf("DESKTOP NOTIFICATION PERMISSION REQUEST CANCELLED: %s\n", QString(context->securityOrigin()->toString()).toUtf8().constData());
- emit page->cancelRequestsForPermission(frame, QWebPage::NotificationsPermissionDomain);
+ emit page->cancelRequestsForPermission(frame, QWebPage::Notifications);
}
void NotificationPresenterClientQt::allowNotificationForFrame(Frame* frame)
diff --git a/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp b/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
index 44dac3a..c78587d 100644
--- a/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
+++ b/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp
@@ -220,12 +220,12 @@ public slots:
bool shouldInterruptJavaScript() {
return true;
}
- void requestPermission(QWebFrame* frame, QWebPage::PermissionDomain domain)
+ void requestPermission(QWebFrame* frame, QWebPage::Feature feature)
{
if (m_allowGeolocation)
- setUserPermission(frame, domain, PermissionGrantedByUser);
+ setUserPermission(frame, feature, PermissionGrantedByUser);
else
- setUserPermission(frame, domain, PermissionDeniedByUser);
+ setUserPermission(frame, feature, PermissionDeniedByUser);
}
public:
@@ -256,8 +256,8 @@ void tst_QWebPage::geolocationRequestJS()
QSKIP("Test disabled as long as geolocation is disabled from the build.", SkipSingle);
JSTestPage* newPage = new JSTestPage(m_view);
- connect(newPage, SIGNAL(requestPermissionFromUser(QWebFrame*, QWebPage::PermissionDomain)),
- newPage, SLOT(requestPermission(QWebFrame*, QWebPage::PermissionDomain)));
+ connect(newPage, SIGNAL(requestPermissionFromUser(QWebFrame*, QWebPage::Feature)),
+ newPage, SLOT(requestPermission(QWebFrame*, QWebPage::Feature)));
newPage->setGeolocationPermission(false);
m_view->setPage(newPage);
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 2fe53f9..80d3457 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -5,6 +5,31 @@
[Qt] Review the setUserPermission & friends API
https://bugs.webkit.org/show_bug.cgi?id=46810
+ Rename PermissionDomain to Feature, NotificationsPermissionDomain to Notifications
+ and GeolocationPermissionDomain to Geolocation.
+
+ * DumpRenderTree/qt/DumpRenderTreeQt.cpp:
+ (WebCore::WebPage::WebPage):
+ (WebCore::WebPage::requestPermission):
+ (WebCore::WebPage::cancelPermission):
+ (WebCore::WebPage::permissionSet):
+ (WebCore::DumpRenderTree::geolocationPermissionSet):
+ * DumpRenderTree/qt/DumpRenderTreeQt.h:
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::grantDesktopNotificationPermission):
+ * QtTestBrowser/webpage.cpp:
+ (WebPage::WebPage):
+ (WebPage::requestPermission):
+ (WebPage::cancelRequestsForPermission):
+ * QtTestBrowser/webpage.h:
+
+2010-11-23 Simon Hausmann <simon.hausmann at nokia.com>
+
+ Reviewed by Tor Arne Vestbø.
+
+ [Qt] Review the setUserPermission & friends API
+ https://bugs.webkit.org/show_bug.cgi?id=46810
+
Add a ByUser suffix to PermissionGranted/Denied. In the future
we can add PermissionGrantedByDefault.
diff --git a/WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.cpp b/WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.cpp
index 8c9be18..f82626e 100644
--- a/WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.cpp
+++ b/WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.cpp
@@ -158,8 +158,8 @@ WebPage::WebPage(QObject* parent, DumpRenderTree* drt)
setNetworkAccessManager(m_drt->networkAccessManager());
setPluginFactory(new TestPlugin(this));
- connect(this, SIGNAL(requestPermissionFromUser(QWebFrame*, QWebPage::PermissionDomain)), this, SLOT(requestPermission(QWebFrame*, QWebPage::PermissionDomain)));
- connect(this, SIGNAL(cancelRequestsForPermission(QWebFrame*, QWebPage::PermissionDomain)), this, SLOT(cancelPermission(QWebFrame*, QWebPage::PermissionDomain)));
+ connect(this, SIGNAL(requestPermissionFromUser(QWebFrame*, QWebPage::Feature)), this, SLOT(requestPermission(QWebFrame*, QWebPage::Feature)));
+ connect(this, SIGNAL(cancelRequestsForPermission(QWebFrame*, QWebPage::Feature)), this, SLOT(cancelPermission(QWebFrame*, QWebPage::Feature)));
}
WebPage::~WebPage()
@@ -219,19 +219,19 @@ void WebPage::javaScriptAlert(QWebFrame*, const QString& message)
fprintf(stdout, "ALERT: %s\n", message.toUtf8().constData());
}
-void WebPage::requestPermission(QWebFrame* frame, QWebPage::PermissionDomain domain)
+void WebPage::requestPermission(QWebFrame* frame, QWebPage::Feature feature)
{
- switch (domain) {
- case NotificationsPermissionDomain:
+ switch (feature) {
+ case Notifications:
if (!m_drt->layoutTestController()->ignoreReqestForPermission())
- setUserPermission(frame, domain, PermissionGrantedByUser);
+ setUserPermission(frame, feature, PermissionGrantedByUser);
break;
- case GeolocationPermissionDomain:
+ case Geolocation:
if (m_drt->layoutTestController()->isGeolocationPermissionSet())
if (m_drt->layoutTestController()->geolocationPermission())
- setUserPermission(frame, domain, PermissionGrantedByUser);
+ setUserPermission(frame, feature, PermissionGrantedByUser);
else
- setUserPermission(frame, domain, PermissionDeniedByUser);
+ setUserPermission(frame, feature, PermissionDeniedByUser);
else
m_pendingGeolocationRequests.append(frame);
break;
@@ -240,10 +240,10 @@ void WebPage::requestPermission(QWebFrame* frame, QWebPage::PermissionDomain dom
}
}
-void WebPage::cancelPermission(QWebFrame* frame, QWebPage::PermissionDomain domain)
+void WebPage::cancelPermission(QWebFrame* frame, QWebPage::Feature feature)
{
- switch (domain) {
- case GeolocationPermissionDomain:
+ switch (feature) {
+ case Geolocation:
m_pendingGeolocationRequests.removeOne(frame);
break;
default:
@@ -251,17 +251,17 @@ void WebPage::cancelPermission(QWebFrame* frame, QWebPage::PermissionDomain doma
}
}
-void WebPage::permissionSet(QWebPage::PermissionDomain domain)
+void WebPage::permissionSet(QWebPage::Feature feature)
{
- switch (domain) {
- case GeolocationPermissionDomain:
+ switch (feature) {
+ case Geolocation:
{
Q_ASSERT(m_drt->layoutTestController()->isGeolocationPermissionSet());
foreach (QWebFrame* frame, m_pendingGeolocationRequests)
if (m_drt->layoutTestController()->geolocationPermission())
- setUserPermission(frame, domain, PermissionGrantedByUser);
+ setUserPermission(frame, feature, PermissionGrantedByUser);
else
- setUserPermission(frame, domain, PermissionDeniedByUser);
+ setUserPermission(frame, feature, PermissionDeniedByUser);
m_pendingGeolocationRequests.clear();
break;
@@ -1077,7 +1077,7 @@ int DumpRenderTree::windowCount() const
void DumpRenderTree::geolocationPermissionSet()
{
- m_page->permissionSet(QWebPage::GeolocationPermissionDomain);
+ m_page->permissionSet(QWebPage::Geolocation);
}
void DumpRenderTree::switchFocus(bool focused)
diff --git a/WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.h b/WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.h
index 0382f96..283ebd9 100644
--- a/WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.h
+++ b/WebKitTools/DumpRenderTree/qt/DumpRenderTreeQt.h
@@ -194,12 +194,12 @@ public:
QObject* createPlugin(const QString&, const QUrl&, const QStringList&, const QStringList&);
- void permissionSet(QWebPage::PermissionDomain domain);
+ void permissionSet(QWebPage::Feature feature);
public slots:
bool shouldInterruptJavaScript() { return false; }
- void requestPermission(QWebFrame* frame, QWebPage::PermissionDomain domain);
- void cancelPermission(QWebFrame* frame, QWebPage::PermissionDomain domain);
+ void requestPermission(QWebFrame* frame, QWebPage::Feature feature);
+ void cancelPermission(QWebFrame* frame, QWebPage::Feature feature);
protected:
bool acceptNavigationRequest(QWebFrame* frame, const QNetworkRequest& request, NavigationType type);
diff --git a/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp b/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp
index 20a3584..7a1bd9d 100644
--- a/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp
+++ b/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp
@@ -198,7 +198,7 @@ int LayoutTestController::windowCount()
void LayoutTestController::grantDesktopNotificationPermission(const QString& origin)
{
QWebFrame* frame = m_drt->webPage()->mainFrame();
- m_drt->webPage()->setUserPermission(frame, QWebPage::NotificationsPermissionDomain, QWebPage::PermissionGrantedByUser);
+ m_drt->webPage()->setUserPermission(frame, QWebPage::Notifications, QWebPage::PermissionGrantedByUser);
m_desktopNotificationAllowedOrigins.append(origin);
}
diff --git a/WebKitTools/QtTestBrowser/webpage.cpp b/WebKitTools/QtTestBrowser/webpage.cpp
index 6660376..555467c 100644
--- a/WebKitTools/QtTestBrowser/webpage.cpp
+++ b/WebKitTools/QtTestBrowser/webpage.cpp
@@ -50,8 +50,8 @@ WebPage::WebPage(QObject* parent)
connect(networkAccessManager(), SIGNAL(authenticationRequired(QNetworkReply*, QAuthenticator*)),
this, SLOT(authenticationRequired(QNetworkReply*, QAuthenticator*)));
- connect(this, SIGNAL(requestPermissionFromUser(QWebFrame*, QWebPage::PermissionDomain)), this, SLOT(requestPermission(QWebFrame*, QWebPage::PermissionDomain)));
- connect(this, SIGNAL(cancelRequestsForPermission(QWebFrame*, QWebPage::PermissionDomain)), this, SLOT(cancelRequestsForPermission(QWebFrame*, QWebPage::PermissionDomain)));
+ connect(this, SIGNAL(requestPermissionFromUser(QWebFrame*, QWebPage::Feature)), this, SLOT(requestPermission(QWebFrame*, QWebPage::Feature)));
+ connect(this, SIGNAL(cancelRequestsForPermission(QWebFrame*, QWebPage::Feature)), this, SLOT(cancelRequestsForPermission(QWebFrame*, QWebPage::Feature)));
}
void WebPage::applyProxy()
@@ -167,12 +167,12 @@ void WebPage::authenticationRequired(QNetworkReply* reply, QAuthenticator* authe
delete dialog;
}
-void WebPage::requestPermission(QWebFrame* frame, QWebPage::PermissionDomain domain)
+void WebPage::requestPermission(QWebFrame* frame, QWebPage::Feature feature)
{
- setUserPermission(frame, domain, PermissionGrantedByUser);
+ setUserPermission(frame, feature, PermissionGrantedByUser);
}
-void WebPage::cancelRequestsForPermission(QWebFrame*, QWebPage::PermissionDomain)
+void WebPage::cancelRequestsForPermission(QWebFrame*, QWebPage::Feature)
{
}
diff --git a/WebKitTools/QtTestBrowser/webpage.h b/WebKitTools/QtTestBrowser/webpage.h
index 27198e5..8a46da5 100644
--- a/WebKitTools/QtTestBrowser/webpage.h
+++ b/WebKitTools/QtTestBrowser/webpage.h
@@ -57,8 +57,8 @@ public slots:
void setUserAgent(const QString& ua) { m_userAgent = ua; }
bool shouldInterruptJavaScript();
void authenticationRequired(QNetworkReply*, QAuthenticator*);
- void requestPermission(QWebFrame* frame, QWebPage::PermissionDomain domain);
- void cancelRequestsForPermission(QWebFrame* frame, QWebPage::PermissionDomain domain);
+ void requestPermission(QWebFrame* frame, QWebPage::Feature feature);
+ void cancelRequestsForPermission(QWebFrame* frame, QWebPage::Feature feature);
private:
void applyProxy();
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list