NotificationClientBlackBerry.cpp [plain text]
#include "config.h"
#include "NotificationClientBlackBerry.h"
#if ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)
#include "Notification.h"
#include "NotificationPermissionCallback.h"
#include "ScriptExecutionContext.h"
#include "VoidCallback.h"
#include "WebPage_p.h"
#include <wtf/PassRefPtr.h>
#include <wtf/RefPtr.h>
namespace WebCore {
NotificationClientBlackBerry::NotificationClientBlackBerry(BlackBerry::WebKit::WebPagePrivate* webPagePrivate)
: m_webPagePrivate(webPagePrivate)
{
}
bool NotificationClientBlackBerry::show(Notification* notification)
{
m_webPagePrivate->notificationManager().show(notification);
return true;
}
void NotificationClientBlackBerry::cancel(Notification* notification)
{
m_webPagePrivate->notificationManager().cancel(notification);
}
void NotificationClientBlackBerry::clearNotifications(ScriptExecutionContext* context)
{
m_webPagePrivate->notificationManager().clearNotifications(context);
}
void NotificationClientBlackBerry::notificationObjectDestroyed(Notification* notification)
{
m_webPagePrivate->notificationManager().notificationObjectDestroyed(notification);
}
void NotificationClientBlackBerry::notificationControllerDestroyed()
{
delete this;
}
void NotificationClientBlackBerry::requestPermission(ScriptExecutionContext* context, PassRefPtr<VoidCallback> callback)
{
m_webPagePrivate->notificationManager().requestPermission(context, callback);
}
void NotificationClientBlackBerry::requestPermission(ScriptExecutionContext* context, PassRefPtr<NotificationPermissionCallback> callback)
{
m_webPagePrivate->notificationManager().requestPermission(context, callback);
}
void NotificationClientBlackBerry::cancelRequestsForPermission(ScriptExecutionContext* context)
{
m_webPagePrivate->notificationManager().cancelRequestsForPermission(context);
}
NotificationClient::Permission NotificationClientBlackBerry::checkPermission(ScriptExecutionContext* context)
{
return m_webPagePrivate->notificationManager().checkPermission(context);
}
}
#endif // ENABLE(NOTIFICATIONS) || ENABLE(LEGACY_NOTIFICATIONS)