[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
yael.aharon at nokia.com
yael.aharon at nokia.com
Wed Dec 22 13:19:33 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit ab2352eecdb7bf70353853f0b3c7cbe176c9c224
Author: yael.aharon at nokia.com <yael.aharon at nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Sat Sep 11 03:42:09 2010 +0000
2010-09-10 Yael Aharon <yael.aharon at nokia.com>
Reviewed by Andreas Kling.
[Qt] Support click event for notifications
https://bugs.webkit.org/show_bug.cgi?id=44836
* fast/notifications/notifications-click-event-expected.txt:
* platform/qt/Skipped:
2010-09-10 Yael Aharon <yael.aharon at nokia.com>
Reviewed by Andreas Kling.
[Qt] Support click event for notifications
https://bugs.webkit.org/show_bug.cgi?id=44836
Propagate click events to JavaScript from either the
platform plugn or from QSystemTrayIcon.
Also added the method NotificationWrapper::openerPageUrl so that
if the platform plugin can reopen the page that created the
notification directly, when the user clicks the notification.
Added DumpRenderTreeSupportQt::simulateDesktopNotificationClick
for testing purpose.
* Api/qwebkitplatformplugin.h:
* WebCoreSupport/DumpRenderTreeSupportQt.cpp:
(DumpRenderTreeSupportQt::simulateDesktopNotificationClick):
* WebCoreSupport/DumpRenderTreeSupportQt.h:
* WebCoreSupport/NotificationPresenterClientQt.cpp:
(WebCore::NotificationWrapper::openerPageUrl):
(WebCore::NotificationWrapper::notificationClicked):
(WebCore::NotificationPresenterClientQt::displayNotification):
(WebCore::NotificationPresenterClientQt::notificationClicked):
* WebCoreSupport/NotificationPresenterClientQt.h:
* examples/platformplugin/WebNotificationPresenter.cpp:
(WebNotificationWidget::event):
* examples/platformplugin/WebNotificationPresenter.h:
(WebNotificationPresenter::WebNotificationPresenter):
* examples/platformplugin/qwebkitplatformplugin.h:
2010-09-10 Yael Aharon <yael.aharon at nokia.com>
Reviewed by Andreas Kling.
[Qt] Support click event for notifications
https://bugs.webkit.org/show_bug.cgi?id=44836
Add support for simulateDesktopNotificationClick by calling
back to DumpRenderTreeSupportQt.cpp.
* DumpRenderTree/qt/LayoutTestControllerQt.cpp:
(LayoutTestController::simulateDesktopNotificationClick):
* DumpRenderTree/qt/LayoutTestControllerQt.h:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@67272 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index c0d303b..22cc669 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,13 @@
+2010-09-10 Yael Aharon <yael.aharon at nokia.com>
+
+ Reviewed by Andreas Kling.
+
+ [Qt] Support click event for notifications
+ https://bugs.webkit.org/show_bug.cgi?id=44836
+
+ * fast/notifications/notifications-click-event-expected.txt:
+ * platform/qt/Skipped:
+
2010-09-10 Peter Kasting <pkasting at google.com>
Reviewed by Darin Adler.
diff --git a/LayoutTests/platform/qt/Skipped b/LayoutTests/platform/qt/Skipped
index 2c3f4c8..71afe7b 100644
--- a/LayoutTests/platform/qt/Skipped
+++ b/LayoutTests/platform/qt/Skipped
@@ -5335,7 +5335,6 @@ svg/W3C-SVG-1.1/filters-light-04-f.svg
# new skipped tests yet to be sorted
# ============================================================================= #
fast/dom/Geolocation/callback-to-remote-context2.html
-fast/notifications/notifications-click-event.html
# Link prefetch is disabled by default
fast/dom/HTMLLinkElement/prefetch.html
diff --git a/WebKit/qt/Api/qwebkitplatformplugin.h b/WebKit/qt/Api/qwebkitplatformplugin.h
index 3c56c98..76496c5 100644
--- a/WebKit/qt/Api/qwebkitplatformplugin.h
+++ b/WebKit/qt/Api/qwebkitplatformplugin.h
@@ -27,6 +27,7 @@
*/
#include <QObject>
+#include <QUrl>
class QWebSelectData
{
@@ -66,6 +67,7 @@ public:
virtual const QString title() const = 0;
virtual const QString message() const = 0;
virtual const QByteArray iconData() const = 0;
+ virtual const QUrl openerPageUrl() const = 0;
};
class QWebNotificationPresenter : public QObject
@@ -79,6 +81,7 @@ public:
Q_SIGNALS:
void notificationClosed();
+ void notificationClicked();
};
class QWebHapticFeedbackPlayer
@@ -113,6 +116,6 @@ public:
};
-Q_DECLARE_INTERFACE(QWebKitPlatformPlugin, "com.nokia.Qt.WebKit.PlatformPlugin/1.3");
+Q_DECLARE_INTERFACE(QWebKitPlatformPlugin, "com.nokia.Qt.WebKit.PlatformPlugin/1.4");
#endif // QWEBKITPLATFORMPLUGIN_H
diff --git a/WebKit/qt/ChangeLog b/WebKit/qt/ChangeLog
index ec3b6b2..50ecb39 100644
--- a/WebKit/qt/ChangeLog
+++ b/WebKit/qt/ChangeLog
@@ -1,3 +1,35 @@
+2010-09-10 Yael Aharon <yael.aharon at nokia.com>
+
+ Reviewed by Andreas Kling.
+
+ [Qt] Support click event for notifications
+ https://bugs.webkit.org/show_bug.cgi?id=44836
+
+ Propagate click events to JavaScript from either the
+ platform plugn or from QSystemTrayIcon.
+ Also added the method NotificationWrapper::openerPageUrl so that
+ if the platform plugin can reopen the page that created the
+ notification directly, when the user clicks the notification.
+
+ Added DumpRenderTreeSupportQt::simulateDesktopNotificationClick
+ for testing purpose.
+
+ * Api/qwebkitplatformplugin.h:
+ * WebCoreSupport/DumpRenderTreeSupportQt.cpp:
+ (DumpRenderTreeSupportQt::simulateDesktopNotificationClick):
+ * WebCoreSupport/DumpRenderTreeSupportQt.h:
+ * WebCoreSupport/NotificationPresenterClientQt.cpp:
+ (WebCore::NotificationWrapper::openerPageUrl):
+ (WebCore::NotificationWrapper::notificationClicked):
+ (WebCore::NotificationPresenterClientQt::displayNotification):
+ (WebCore::NotificationPresenterClientQt::notificationClicked):
+ * WebCoreSupport/NotificationPresenterClientQt.h:
+ * examples/platformplugin/WebNotificationPresenter.cpp:
+ (WebNotificationWidget::event):
+ * examples/platformplugin/WebNotificationPresenter.h:
+ (WebNotificationPresenter::WebNotificationPresenter):
+ * examples/platformplugin/qwebkitplatformplugin.h:
+
2010-09-10 Adam Barth <abarth at webkit.org>
Attempt to fix the failign Qt tests. This patch adapts code from
diff --git a/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp b/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp
index c1be131..d2e65a8 100644
--- a/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp
+++ b/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.cpp
@@ -698,6 +698,13 @@ void DumpRenderTreeSupportQt::addUserStyleSheet(QWebPage* page, const QString& s
page->handle()->page->group().addUserStyleSheetToWorld(mainThreadNormalWorld(), sourceCode, QUrl(), 0, 0, WebCore::InjectInAllFrames);
}
+void DumpRenderTreeSupportQt::simulateDesktopNotificationClick(const QString& title)
+{
+#if ENABLE(NOTIFICATIONS)
+ NotificationPresenterClientQt::notificationPresenter()->notificationClicked(title);
+#endif
+}
+
// Provide a backward compatibility with previously exported private symbols as of QtWebKit 4.6 release
void QWEBKIT_EXPORT qt_resumeActiveDOMObjects(QWebFrame* frame)
diff --git a/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h b/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h
index 2069114..5c4dd65 100644
--- a/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h
+++ b/WebKit/qt/WebCoreSupport/DumpRenderTreeSupportQt.h
@@ -127,7 +127,7 @@ public:
static QString pageSizeAndMarginsInPixels(QWebFrame* frame, int pageIndex, int width, int height, int marginTop, int marginRight, int marginBottom, int marginLeft);
static QString pageProperty(QWebFrame* frame, const QString& propertyName, int pageNumber);
static void addUserStyleSheet(QWebPage* page, const QString& sourceCode);
-
+ static void simulateDesktopNotificationClick(const QString& title);
};
#endif
diff --git a/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.cpp b/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.cpp
index c24c4d5..7b33d9e 100644
--- a/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.cpp
+++ b/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.cpp
@@ -118,6 +118,26 @@ const QByteArray NotificationWrapper::iconData() const
return iconData;
}
+const QUrl NotificationWrapper::openerPageUrl() const
+{
+ QUrl url;
+#if ENABLE(NOTIFICATIONS)
+ Notification* notification = NotificationPresenterClientQt::notificationPresenter()->notificationForWrapper(this);
+ if (notification) {
+ if (notification->scriptExecutionContext())
+ url = static_cast<Document*>(notification->scriptExecutionContext())->page()->mainFrame()->document()->url();
+ }
+#endif
+ return url;
+}
+
+void NotificationWrapper::notificationClicked()
+{
+#if ENABLE(NOTIFICATIONS)
+ NotificationPresenterClientQt::notificationPresenter()->notificationClicked(this);
+#endif
+}
+
void NotificationWrapper::notificationClosed()
{
#if ENABLE(NOTIFICATIONS)
@@ -204,11 +224,13 @@ void NotificationPresenterClientQt::displayNotification(Notification* notificati
if (wrapper->m_presenter) {
wrapper->connect(wrapper->m_presenter.get(), SIGNAL(notificationClosed()), wrapper, SLOT(notificationClosed()), Qt::QueuedConnection);
+ wrapper->connect(wrapper->m_presenter.get(), SIGNAL(notificationClicked()), wrapper, SLOT(notificationClicked()));
wrapper->m_presenter->showNotification(wrapper);
return;
}
#ifndef QT_NO_SYSTEMTRAYICON
+ wrapper->connect(wrapper->m_notificationIcon.get(), SIGNAL(messageClicked()), wrapper, SLOT(notificationClicked()));
wrapper->m_notificationIcon->show();
wrapper->m_notificationIcon->showMessage(notification->contents().title(), notification->contents().body());
#endif
@@ -237,6 +259,35 @@ void NotificationPresenterClientQt::cancel(NotificationWrapper* wrapper)
cancel(notification);
}
+void NotificationPresenterClientQt::notificationClicked(NotificationWrapper* wrapper)
+{
+ Notification* notification = notificationForWrapper(wrapper);
+ if (notification)
+ sendEvent(notification, eventNames().clickEvent);
+}
+
+void NotificationPresenterClientQt::notificationClicked(const QString& title)
+{
+ if (!dumpNotification)
+ return;
+ NotificationsQueue::ConstIterator end = m_notifications.end();
+ NotificationsQueue::ConstIterator iter = m_notifications.begin();
+ Notification* notification = 0;
+ while (iter != end) {
+ notification = iter.key();
+ QString notificationTitle;
+ if (notification->isHTML())
+ notificationTitle = notification->url().string();
+ else
+ notificationTitle = notification->contents().title();
+ if (notificationTitle == title)
+ break;
+ iter++;
+ }
+ if (notification)
+ sendEvent(notification, eventNames().clickEvent);
+}
+
Notification* NotificationPresenterClientQt::notificationForWrapper(const NotificationWrapper* wrapper) const
{
NotificationsQueue::ConstIterator end = m_notifications.end();
diff --git a/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.h b/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.h
index e8481d4..2520f6c 100644
--- a/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.h
+++ b/WebKit/qt/WebCoreSupport/NotificationPresenterClientQt.h
@@ -61,9 +61,11 @@ public:
const QString title() const;
const QString message() const;
const QByteArray iconData() const;
+ const QUrl openerPageUrl() const;
public Q_SLOTS:
void notificationClosed();
+ void notificationClicked();
public:
#ifndef QT_NO_SYSTEMTRAYICON
@@ -102,6 +104,8 @@ public:
static NotificationPresenterClientQt* notificationPresenter();
Notification* notificationForWrapper(const NotificationWrapper*) const;
+ void notificationClicked(NotificationWrapper*);
+ void notificationClicked(const QString& title);
private:
void sendEvent(Notification*, const AtomicString& eventName);
diff --git a/WebKit/qt/examples/platformplugin/WebNotificationPresenter.cpp b/WebKit/qt/examples/platformplugin/WebNotificationPresenter.cpp
index c992236..d991ab1 100644
--- a/WebKit/qt/examples/platformplugin/WebNotificationPresenter.cpp
+++ b/WebKit/qt/examples/platformplugin/WebNotificationPresenter.cpp
@@ -57,7 +57,11 @@ void WebNotificationWidget::showNotification(const QWebNotificationData* data)
bool WebNotificationWidget::event(QEvent* ev)
{
- if (ev->type() == QEvent::MouseButtonRelease || ev->type() == QEvent::Close) {
+ if (ev->type() == QEvent::MouseButtonRelease) {
+ emit notificationClicked();
+ return true;
+ }
+ if (ev->type() == QEvent::Close) {
emit notificationClosed();
return true;
}
diff --git a/WebKit/qt/examples/platformplugin/WebNotificationPresenter.h b/WebKit/qt/examples/platformplugin/WebNotificationPresenter.h
index a2563b2..f46e5cb 100644
--- a/WebKit/qt/examples/platformplugin/WebNotificationPresenter.h
+++ b/WebKit/qt/examples/platformplugin/WebNotificationPresenter.h
@@ -36,6 +36,7 @@ public:
Q_SIGNALS:
void notificationClosed();
+ void notificationClicked();
};
class WebNotificationPresenter : public QWebNotificationPresenter
@@ -47,6 +48,7 @@ public:
{
m_widget = new WebNotificationWidget();
connect(m_widget, SIGNAL(notificationClosed()), this, SIGNAL(notificationClosed()));
+ connect(m_widget, SIGNAL(notificationClicked()), this, SIGNAL(notificationClicked()));
}
virtual ~WebNotificationPresenter() { m_widget->close(); delete m_widget; }
diff --git a/WebKit/qt/examples/platformplugin/qwebkitplatformplugin.h b/WebKit/qt/examples/platformplugin/qwebkitplatformplugin.h
index 3c56c98..76496c5 100644
--- a/WebKit/qt/examples/platformplugin/qwebkitplatformplugin.h
+++ b/WebKit/qt/examples/platformplugin/qwebkitplatformplugin.h
@@ -27,6 +27,7 @@
*/
#include <QObject>
+#include <QUrl>
class QWebSelectData
{
@@ -66,6 +67,7 @@ public:
virtual const QString title() const = 0;
virtual const QString message() const = 0;
virtual const QByteArray iconData() const = 0;
+ virtual const QUrl openerPageUrl() const = 0;
};
class QWebNotificationPresenter : public QObject
@@ -79,6 +81,7 @@ public:
Q_SIGNALS:
void notificationClosed();
+ void notificationClicked();
};
class QWebHapticFeedbackPlayer
@@ -113,6 +116,6 @@ public:
};
-Q_DECLARE_INTERFACE(QWebKitPlatformPlugin, "com.nokia.Qt.WebKit.PlatformPlugin/1.3");
+Q_DECLARE_INTERFACE(QWebKitPlatformPlugin, "com.nokia.Qt.WebKit.PlatformPlugin/1.4");
#endif // QWEBKITPLATFORMPLUGIN_H
diff --git a/WebKitTools/ChangeLog b/WebKitTools/ChangeLog
index 23c234e..02cc85b 100644
--- a/WebKitTools/ChangeLog
+++ b/WebKitTools/ChangeLog
@@ -1,3 +1,17 @@
+2010-09-10 Yael Aharon <yael.aharon at nokia.com>
+
+ Reviewed by Andreas Kling.
+
+ [Qt] Support click event for notifications
+ https://bugs.webkit.org/show_bug.cgi?id=44836
+
+ Add support for simulateDesktopNotificationClick by calling
+ back to DumpRenderTreeSupportQt.cpp.
+
+ * DumpRenderTree/qt/LayoutTestControllerQt.cpp:
+ (LayoutTestController::simulateDesktopNotificationClick):
+ * DumpRenderTree/qt/LayoutTestControllerQt.h:
+
2010-09-10 Mihai Parparita <mihaip at chromium.org>
Reviewed by Eric Seidel.
diff --git a/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp b/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp
index b783141..7d06340 100644
--- a/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp
+++ b/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.cpp
@@ -206,6 +206,11 @@ bool LayoutTestController::checkDesktopNotificationPermission(const QString& ori
return !m_ignoreDesktopNotification && m_desktopNotificationAllowedOrigins.contains(origin);
}
+void LayoutTestController::simulateDesktopNotificationClick(const QString& title)
+{
+ DumpRenderTreeSupportQt::simulateDesktopNotificationClick(title);
+}
+
void LayoutTestController::display()
{
emit showPage();
diff --git a/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h b/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h
index 7e58f44..d14e0e4 100644
--- a/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h
+++ b/WebKitTools/DumpRenderTree/qt/LayoutTestControllerQt.h
@@ -124,6 +124,7 @@ public slots:
void grantDesktopNotificationPermission(const QString& origin);
void ignoreDesktopNotificationPermissionRequests();
bool checkDesktopNotificationPermission(const QString& origin);
+ void simulateDesktopNotificationClick(const QString& title);
void display();
void clearBackForwardList();
QString pathToLocalResource(const QString& url);
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list