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

Unified Diff: third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp

Issue 2528683002: PaymentApp: Blink side of payment request event dispatching in service worker. (Closed)
Patch Set: PaymentApp: Blink side of payment request event dispatching in service worker. Created 4 years 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 | « third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.h ('k') | third_party/WebKit/public/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp
diff --git a/third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp b/third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp
index 7f6f81b1b9e1f8e90603e49de0dae8c32a3632d1..b1c68559a6e24993f279bda58776f7d953136991 100644
--- a/third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp
+++ b/third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp
@@ -46,6 +46,9 @@
#include "modules/notifications/Notification.h"
#include "modules/notifications/NotificationEvent.h"
#include "modules/notifications/NotificationEventInit.h"
+#include "modules/payments/PaymentAppRequestData.h"
+#include "modules/payments/PaymentAppRequestDataConversion.h"
+#include "modules/payments/PaymentRequestEvent.h"
#include "modules/push_messaging/PushEvent.h"
#include "modules/push_messaging/PushMessageData.h"
#include "modules/serviceworkers/ExtendableEvent.h"
@@ -328,6 +331,19 @@ void ServiceWorkerGlobalScopeProxy::dispatchSyncEvent(
workerGlobalScope()->dispatchExtendableEvent(event, observer);
}
+void ServiceWorkerGlobalScopeProxy::dispatchPaymentRequestEvent(
+ int eventID,
+ const WebPaymentAppRequestData& webData) {
+ WaitUntilObserver* observer = WaitUntilObserver::create(
+ workerGlobalScope(), WaitUntilObserver::PaymentRequest, eventID);
+ Event* event = PaymentRequestEvent::create(
+ EventTypeNames::paymentrequest,
+ PaymentAppRequestDataConversion::toPaymentAppRequestData(
+ workerGlobalScope()->scriptController()->getScriptState(), webData),
+ observer);
+ workerGlobalScope()->dispatchExtendableEvent(event, observer);
+}
+
bool ServiceWorkerGlobalScopeProxy::hasFetchEventHandler() {
DCHECK(m_workerGlobalScope);
return m_workerGlobalScope->hasEventListeners(EventTypeNames::fetch);
« no previous file with comments | « third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.h ('k') | third_party/WebKit/public/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698