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

Side by Side Diff: third_party/WebKit/Source/web/ServiceWorkerGlobalScopeProxy.cpp

Issue 2392343002: Plumbing in notification replies: PlatformNotificationService -> SW (Closed)
Patch Set: Send NullableString through IPC, remove settings check from ButtonClickWithReply, add TODO in messa… Created 4 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 workerGlobalScope(), WaitUntilObserver::Install, eventID); 238 workerGlobalScope(), WaitUntilObserver::Install, eventID);
239 Event* event = InstallEvent::create(EventTypeNames::install, 239 Event* event = InstallEvent::create(EventTypeNames::install,
240 ExtendableEventInit(), observer); 240 ExtendableEventInit(), observer);
241 workerGlobalScope()->dispatchExtendableEvent(event, observer); 241 workerGlobalScope()->dispatchExtendableEvent(event, observer);
242 } 242 }
243 243
244 void ServiceWorkerGlobalScopeProxy::dispatchNotificationClickEvent( 244 void ServiceWorkerGlobalScopeProxy::dispatchNotificationClickEvent(
245 int eventID, 245 int eventID,
246 const WebString& notificationID, 246 const WebString& notificationID,
247 const WebNotificationData& data, 247 const WebNotificationData& data,
248 int actionIndex) { 248 int actionIndex,
249 const WebString& reply) {
249 WaitUntilObserver* observer = WaitUntilObserver::create( 250 WaitUntilObserver* observer = WaitUntilObserver::create(
250 workerGlobalScope(), WaitUntilObserver::NotificationClick, eventID); 251 workerGlobalScope(), WaitUntilObserver::NotificationClick, eventID);
251 NotificationEventInit eventInit; 252 NotificationEventInit eventInit;
252 eventInit.setNotification(Notification::create( 253 eventInit.setNotification(Notification::create(
253 workerGlobalScope(), notificationID, data, true /* showing */)); 254 workerGlobalScope(), notificationID, data, true /* showing */));
254 if (0 <= actionIndex && actionIndex < static_cast<int>(data.actions.size())) 255 if (0 <= actionIndex && actionIndex < static_cast<int>(data.actions.size()))
255 eventInit.setAction(data.actions[actionIndex].action); 256 eventInit.setAction(data.actions[actionIndex].action);
257 eventInit.setReply(reply);
256 Event* event = NotificationEvent::create(EventTypeNames::notificationclick, 258 Event* event = NotificationEvent::create(EventTypeNames::notificationclick,
257 eventInit, observer); 259 eventInit, observer);
258 workerGlobalScope()->dispatchExtendableEvent(event, observer); 260 workerGlobalScope()->dispatchExtendableEvent(event, observer);
259 } 261 }
260 262
261 void ServiceWorkerGlobalScopeProxy::dispatchNotificationCloseEvent( 263 void ServiceWorkerGlobalScopeProxy::dispatchNotificationCloseEvent(
262 int eventID, 264 int eventID,
263 const WebString& notificationID, 265 const WebString& notificationID,
264 const WebNotificationData& data) { 266 const WebNotificationData& data) {
265 WaitUntilObserver* observer = WaitUntilObserver::create( 267 WaitUntilObserver* observer = WaitUntilObserver::create(
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
408 return *m_document; 410 return *m_document;
409 } 411 }
410 412
411 ServiceWorkerGlobalScope* ServiceWorkerGlobalScopeProxy::workerGlobalScope() 413 ServiceWorkerGlobalScope* ServiceWorkerGlobalScopeProxy::workerGlobalScope()
412 const { 414 const {
413 DCHECK(m_workerGlobalScope); 415 DCHECK(m_workerGlobalScope);
414 return m_workerGlobalScope; 416 return m_workerGlobalScope;
415 } 417 }
416 418
417 } // namespace blink 419 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698