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

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

Issue 1904163002: Move Web Notifications to use Mojo Base URL: https://chromium.googlesource.com/chromium/src.git@skbitmap-blink
Patch Set: resolves the promise Created 4 years, 8 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
Index: third_party/WebKit/Source/modules/notifications/Notification.h
diff --git a/third_party/WebKit/Source/modules/notifications/Notification.h b/third_party/WebKit/Source/modules/notifications/Notification.h
index cf5c627b6ea058e3acdae6211829e286875ba0bf..ffaf1f7a95a25fce88c0934422a6ddb94ada2bb4 100644
--- a/third_party/WebKit/Source/modules/notifications/Notification.h
+++ b/third_party/WebKit/Source/modules/notifications/Notification.h
@@ -44,14 +44,15 @@
#include "platform/heap/Handle.h"
#include "platform/weborigin/KURL.h"
#include "public/platform/WebVector.h"
-#include "public/platform/modules/notifications/WebNotificationData.h"
#include "public/platform/modules/notifications/WebNotificationDelegate.h"
+#include "public/platform/modules/notifications/notification.mojom-wtf.h"
#include "public/platform/modules/permissions/permission_status.mojom.h"
namespace blink {
class ExecutionContext;
class NotificationAction;
+class NotificationManager;
class NotificationOptions;
class NotificationPermissionCallback;
class NotificationResourcesLoader;
@@ -67,7 +68,7 @@ public:
// Used for embedder-created Notification objects. If |showing| is true, will initialize the
// Notification's state as showing, or as closed otherwise.
- static Notification* create(ExecutionContext*, int64_t persistentId, const WebNotificationData&, bool showing);
+ static Notification* create(ExecutionContext*, int64_t persistentId, mojom::wtf::NotificationPtr, bool showing);
~Notification() override;
@@ -101,7 +102,6 @@ public:
static String permissionString(mojom::PermissionStatus);
static String permission(ExecutionContext*);
- static mojom::PermissionStatus checkPermission(ExecutionContext*);
static ScriptPromise requestPermission(ScriptState*, NotificationPermissionCallback*);
static size_t maxActions();
@@ -123,7 +123,10 @@ protected:
DispatchEventResult dispatchEventInternal(Event*) final;
private:
- Notification(ExecutionContext*, const WebNotificationData&);
+ Notification(ExecutionContext*, mojom::wtf::NotificationPtr);
+
+ // Returns the notification manager responsible for this notification.
+ NotificationManager* manager() const;
// Schedules an asynchronous call to |prepareShow|, allowing the constructor
// to return so that events can be fired on the notification object.
@@ -133,13 +136,12 @@ private:
// before showing the notification.
void prepareShow();
- // Shows the notification, using the resources loaded by the
- // NotificationResourcesLoader.
- void didLoadResources(NotificationResourcesLoader*);
+ // Shows the |notification|, using the resources loaded by the given loader.
+ void didLoadResources(NotificationResourcesLoader*, mojom::wtf::NotificationPtr notification);
void setPersistentId(int64_t persistentId) { m_persistentId = persistentId; }
- WebNotificationData m_data;
+ mojom::wtf::NotificationPtr m_data;
// ScriptValue representations of the developer-associated data. Initialized lazily on first access.
ScriptValue m_developerData;

Powered by Google App Engine
This is Rietveld 408576698