Commit c5164ad9 authored by yael.aharon@nokia.com's avatar yael.aharon@nokia.com

[Qt] QtTestLauncher should allow notifications by default.

https://bugs.webkit.org/show_bug.cgi?id=40078

Reviewed by Simon Hausmann.

* QtTestBrowser/main.cpp:
(NotificationsPermissionController::NotificationsPermissionController):
(NotificationsPermissionController::checkPermission):
(NotificationsPermissionController::requestPermission):
(LauncherWindow::LauncherWindow):



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@60678 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent a8302ac6
2010-06-04 Yael Aharon <yael.aharon@nokia.com>
Reviewed by Simon Hausmann.
[Qt] QtTestLauncher should allow notifications by default.
https://bugs.webkit.org/show_bug.cgi?id=40078
* QtTestBrowser/main.cpp:
(NotificationsPermissionController::NotificationsPermissionController):
(NotificationsPermissionController::checkPermission):
(NotificationsPermissionController::requestPermission):
(LauncherWindow::LauncherWindow):
2010-06-04 Tony Gentilcore <tonyg@chromium.org>
Reviewed by Adam Barth.
......
......@@ -92,6 +92,28 @@ static bool gUseFrameFlattening = false;
static bool gUseQGLWidgetViewport = false;
#endif
class NotificationsPermissionController : public QObject {
Q_OBJECT
public:
NotificationsPermissionController(QObject* parent) : QObject(parent)
{
DumpRenderTreeSupportQt::setNotificationsReceiver(this);
DumpRenderTreeSupportQt::setCheckPermissionFunction(checkPermission);
DumpRenderTreeSupportQt::setRequestPermissionFunction(requestPermission);
}
static void checkPermission(QObject*, const QUrl&, NotificationPermission& permission)
{
permission = NotificationAllowed;
}
static void requestPermission(QObject*, const QString& origin)
{
DumpRenderTreeSupportQt::allowNotificationForOrigin(origin);
}
};
NotificationsPermissionController* notificationsPermissionController = 0;
class LauncherWindow : public MainWindow {
Q_OBJECT
......@@ -210,6 +232,8 @@ LauncherWindow::LauncherWindow(LauncherWindow* other, bool shareScene)
}
createChrome();
if (!notificationsPermissionController)
notificationsPermissionController = new NotificationsPermissionController(QCoreApplication::instance());
}
LauncherWindow::~LauncherWindow()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment