Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1656)

Unified Diff: Source/modules/notifications/Notification.h

Issue 624033003: [WIP] Move Web Notifications to a WebFrame-less code path (Blink). (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: current state Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/modules/modules.gypi ('k') | Source/modules/notifications/Notification.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/notifications/Notification.h
diff --git a/Source/modules/notifications/Notification.h b/Source/modules/notifications/Notification.h
index 0d355398f678fd7e23f3c0151f7d03988872766b..68f24af927211b14800e0c882c3348757c916c5e 100644
--- a/Source/modules/notifications/Notification.h
+++ b/Source/modules/notifications/Notification.h
@@ -33,11 +33,12 @@
#include "core/dom/ActiveDOMObject.h"
#include "modules/EventTargetModules.h"
-#include "modules/notifications/NotificationClient.h"
#include "platform/AsyncMethodRunner.h"
#include "platform/heap/Handle.h"
#include "platform/text/TextDirection.h"
#include "platform/weborigin/KURL.h"
+#include "public/platform/WebNotificationDelegate.h"
+#include "public/platform/WebNotificationPermission.h"
#include "wtf/PassOwnPtr.h"
#include "wtf/RefCounted.h"
@@ -46,8 +47,9 @@ namespace blink {
class ExecutionContext;
class NotificationOptions;
class NotificationPermissionCallback;
+class WebNotificationPresenter;
-class Notification : public RefCountedGarbageCollectedWillBeGarbageCollectedFinalized<Notification>, public ActiveDOMObject, public EventTargetWithInlineData {
+class Notification : public RefCountedGarbageCollectedWillBeGarbageCollectedFinalized<Notification>, public ActiveDOMObject, public EventTargetWithInlineData, public WebNotificationDelegate {
DEFINE_EVENT_TARGET_REFCOUNTING_WILL_BE_REMOVED(RefCountedGarbageCollected<Notification>);
DEFINE_WRAPPERTYPEINFO();
WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(Notification);
@@ -63,10 +65,11 @@ public:
DEFINE_ATTRIBUTE_EVENT_LISTENER(error);
DEFINE_ATTRIBUTE_EVENT_LISTENER(close);
- void dispatchShowEvent();
- void dispatchClickEvent();
- void dispatchErrorEvent();
- void dispatchCloseEvent();
+ // WebNotificationDelegate implementation.
+ virtual void dispatchShowEvent() override;
+ virtual void dispatchClickEvent() override;
+ virtual void dispatchErrorEvent() override;
+ virtual void dispatchCloseEvent() override;
String title() const { return m_title; }
String dir() const { return m_dir; }
@@ -78,8 +81,9 @@ public:
TextDirection direction() const;
KURL iconURL() const { return m_iconUrl; }
- static const String& permissionString(NotificationClient::Permission);
+ static const String& permissionString(WebNotificationPermission);
static const String& permission(ExecutionContext*);
+ static WebNotificationPermission checkPermission(ExecutionContext*);
static void requestPermission(ExecutionContext*, NotificationPermissionCallback* = nullptr);
// EventTarget interface.
@@ -92,7 +96,7 @@ public:
virtual bool hasPendingActivity() const override;
private:
- Notification(const String& title, ExecutionContext*, NotificationClient*);
+ Notification(const String& title, ExecutionContext*);
// Calling show() may start asynchronous operation. If this object has
// a V8 wrapper, hasPendingActivity() prevents the wrapper from being
@@ -124,8 +128,6 @@ private:
NotificationState m_state;
- NotificationClient* m_client;
-
AsyncMethodRunner<Notification> m_asyncRunner;
};
« no previous file with comments | « Source/modules/modules.gypi ('k') | Source/modules/notifications/Notification.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698