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

Side by Side Diff: third_party/WebKit/Source/modules/notifications/ServiceWorkerRegistrationNotifications.cpp

Issue 1619703002: Implement notificationclose event (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments Created 4 years, 11 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "modules/notifications/ServiceWorkerRegistrationNotifications.h" 5 #include "modules/notifications/ServiceWorkerRegistrationNotifications.h"
6 6
7 #include "bindings/core/v8/CallbackPromiseAdapter.h" 7 #include "bindings/core/v8/CallbackPromiseAdapter.h"
8 #include "bindings/core/v8/ExceptionState.h" 8 #include "bindings/core/v8/ExceptionState.h"
9 #include "bindings/core/v8/ScriptPromiseResolver.h" 9 #include "bindings/core/v8/ScriptPromiseResolver.h"
10 #include "core/dom/ExecutionContext.h" 10 #include "core/dom/ExecutionContext.h"
(...skipping 13 matching lines...) Expand all
24 // Allows using a CallbackPromiseAdapter with a WebVector to resolve the 24 // Allows using a CallbackPromiseAdapter with a WebVector to resolve the
25 // getNotifications() promise with a HeapVector owning Notifications. 25 // getNotifications() promise with a HeapVector owning Notifications.
26 class NotificationArray { 26 class NotificationArray {
27 public: 27 public:
28 using WebType = const WebVector<WebPersistentNotificationInfo>&; 28 using WebType = const WebVector<WebPersistentNotificationInfo>&;
29 29
30 static HeapVector<Member<Notification>> take(ScriptPromiseResolver* resolver , const WebVector<WebPersistentNotificationInfo>& notificationInfos) 30 static HeapVector<Member<Notification>> take(ScriptPromiseResolver* resolver , const WebVector<WebPersistentNotificationInfo>& notificationInfos)
31 { 31 {
32 HeapVector<Member<Notification>> notifications; 32 HeapVector<Member<Notification>> notifications;
33 for (const WebPersistentNotificationInfo& notificationInfo : notificatio nInfos) 33 for (const WebPersistentNotificationInfo& notificationInfo : notificatio nInfos)
34 notifications.append(Notification::create(resolver->executionContext (), notificationInfo.persistentId, notificationInfo.data)); 34 notifications.append(Notification::create(resolver->executionContext (), notificationInfo.persistentId, notificationInfo.data, true));
Peter Beverloo 2016/01/26 16:13:45 , true /* showing */)
Nina 2016/01/27 18:48:58 Added here and in two more analogous places.
35 35
36 return notifications; 36 return notifications;
37 } 37 }
38 38
39 private: 39 private:
40 NotificationArray() = delete; 40 NotificationArray() = delete;
41 }; 41 };
42 42
43 } // namespace 43 } // namespace
44 44
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
83 WebNotificationGetCallbacks* callbacks = new CallbackPromiseAdapter<Notifica tionArray, void>(resolver); 83 WebNotificationGetCallbacks* callbacks = new CallbackPromiseAdapter<Notifica tionArray, void>(resolver);
84 84
85 WebNotificationManager* notificationManager = Platform::current()->notificat ionManager(); 85 WebNotificationManager* notificationManager = Platform::current()->notificat ionManager();
86 ASSERT(notificationManager); 86 ASSERT(notificationManager);
87 87
88 notificationManager->getNotifications(options.tag(), serviceWorkerRegistrati on.webRegistration(), callbacks); 88 notificationManager->getNotifications(options.tag(), serviceWorkerRegistrati on.webRegistration(), callbacks);
89 return promise; 89 return promise;
90 } 90 }
91 91
92 } // namespace blink 92 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698