X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=Source%2FWebCore%2Fnotifications%2FNotificationCenter.h;h=23b31e031f6d413dd9269adae9866b104131202b;hb=b96e33af77ac7d81a666d5aa202235b793aeeb21;hp=3ec4d9d5edf61e68270fd080c9abb31df198d237;hpb=2632619e54bc9f41ccea7c574710fe213e49212d;p=framework%2Fweb%2Fwebkit-efl.git diff --git a/Source/WebCore/notifications/NotificationCenter.h b/Source/WebCore/notifications/NotificationCenter.h index 3ec4d9d..23b31e0 100755 --- a/Source/WebCore/notifications/NotificationCenter.h +++ b/Source/WebCore/notifications/NotificationCenter.h @@ -1,5 +1,6 @@ /* * Copyright (C) 2009 Google Inc. All rights reserved. + * Copyright (C) 2011 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are @@ -31,6 +32,7 @@ #ifndef NotificationCenter_h #define NotificationCenter_h +#include "ExceptionCode.h" #include "Notification.h" #include "NotificationContents.h" #include "ScriptExecutionContext.h" @@ -42,49 +44,49 @@ #if ENABLE(NOTIFICATIONS) namespace WebCore { - - class NotificationPresenter; - class VoidCallback; - - class NotificationCenter : public RefCounted, public ActiveDOMObject { - public: - static PassRefPtr create(ScriptExecutionContext* context, NotificationPresenter* presenter) { return adoptRef(new NotificationCenter(context, presenter)); } - - PassRefPtr createHTMLNotification(const String& URI, ExceptionCode& ec) - { - if (!presenter()) { - ec = INVALID_STATE_ERR; - return 0; - } - if (URI.isEmpty()) { - ec = SYNTAX_ERR; - return 0; - } - return Notification::create(scriptExecutionContext()->completeURL(URI), scriptExecutionContext(), ec, this); + +class NotificationPresenter; +class VoidCallback; + +class NotificationCenter : public RefCounted, public ActiveDOMObject { +public: + static PassRefPtr create(ScriptExecutionContext* context, NotificationPresenter* presenter) { return adoptRef(new NotificationCenter(context, presenter)); } + + PassRefPtr createHTMLNotification(const String& URI, ExceptionCode& ec) + { + if (!presenter()) { + ec = INVALID_STATE_ERR; + return 0; + } + if (URI.isEmpty()) { + ec = SYNTAX_ERR; + return 0; } + return Notification::create(scriptExecutionContext()->completeURL(URI), scriptExecutionContext(), ec, this); + } - PassRefPtr createNotification(const String& iconURI, const String& title, const String& body, ExceptionCode& ec) - { - if (!presenter()) { - ec = INVALID_STATE_ERR; - return 0; - } - NotificationContents contents(iconURI.isEmpty() ? KURL() : scriptExecutionContext()->completeURL(iconURI), title, body); - return Notification::create(contents, scriptExecutionContext(), ec, this); + PassRefPtr createNotification(const String& iconURI, const String& title, const String& body, ExceptionCode& ec) + { + if (!presenter()) { + ec = INVALID_STATE_ERR; + return 0; } + NotificationContents contents(iconURI.isEmpty() ? KURL() : scriptExecutionContext()->completeURL(iconURI), title, body); + return Notification::create(contents, scriptExecutionContext(), ec, this); + } - NotificationPresenter* presenter() const { return m_notificationPresenter; } + NotificationPresenter* presenter() const { return m_notificationPresenter; } - int checkPermission(); - void requestPermission(PassRefPtr callback); + int checkPermission(); + void requestPermission(PassRefPtr); - void disconnectFrame(); + void disconnectFrame(); - private: - NotificationCenter(ScriptExecutionContext*, NotificationPresenter*); +private: + NotificationCenter(ScriptExecutionContext*, NotificationPresenter*); - NotificationPresenter* m_notificationPresenter; - }; + NotificationPresenter* m_notificationPresenter; +}; } // namespace WebCore