| OLD | NEW |
| 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 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 workerGlobalScope(), WaitUntilObserver::Install, eventID); | 237 workerGlobalScope(), WaitUntilObserver::Install, eventID); |
| 238 Event* event = InstallEvent::create(EventTypeNames::install, | 238 Event* event = InstallEvent::create(EventTypeNames::install, |
| 239 ExtendableEventInit(), observer); | 239 ExtendableEventInit(), observer); |
| 240 workerGlobalScope()->dispatchExtendableEvent(event, observer); | 240 workerGlobalScope()->dispatchExtendableEvent(event, observer); |
| 241 } | 241 } |
| 242 | 242 |
| 243 void ServiceWorkerGlobalScopeProxy::dispatchNotificationClickEvent( | 243 void ServiceWorkerGlobalScopeProxy::dispatchNotificationClickEvent( |
| 244 int eventID, | 244 int eventID, |
| 245 const WebString& notificationID, | 245 const WebString& notificationID, |
| 246 const WebNotificationData& data, | 246 const WebNotificationData& data, |
| 247 int actionIndex) { | 247 int actionIndex, |
| 248 const WebString& reply) { |
| 248 WaitUntilObserver* observer = WaitUntilObserver::create( | 249 WaitUntilObserver* observer = WaitUntilObserver::create( |
| 249 workerGlobalScope(), WaitUntilObserver::NotificationClick, eventID); | 250 workerGlobalScope(), WaitUntilObserver::NotificationClick, eventID); |
| 250 NotificationEventInit eventInit; | 251 NotificationEventInit eventInit; |
| 251 eventInit.setNotification(Notification::create( | 252 eventInit.setNotification(Notification::create( |
| 252 workerGlobalScope(), notificationID, data, true /* showing */)); | 253 workerGlobalScope(), notificationID, data, true /* showing */)); |
| 253 if (0 <= actionIndex && actionIndex < static_cast<int>(data.actions.size())) | 254 if (0 <= actionIndex && actionIndex < static_cast<int>(data.actions.size())) |
| 254 eventInit.setAction(data.actions[actionIndex].action); | 255 eventInit.setAction(data.actions[actionIndex].action); |
| 256 eventInit.setReply(reply); |
| 255 Event* event = NotificationEvent::create(EventTypeNames::notificationclick, | 257 Event* event = NotificationEvent::create(EventTypeNames::notificationclick, |
| 256 eventInit, observer); | 258 eventInit, observer); |
| 257 workerGlobalScope()->dispatchExtendableEvent(event, observer); | 259 workerGlobalScope()->dispatchExtendableEvent(event, observer); |
| 258 } | 260 } |
| 259 | 261 |
| 260 void ServiceWorkerGlobalScopeProxy::dispatchNotificationCloseEvent( | 262 void ServiceWorkerGlobalScopeProxy::dispatchNotificationCloseEvent( |
| 261 int eventID, | 263 int eventID, |
| 262 const WebString& notificationID, | 264 const WebString& notificationID, |
| 263 const WebNotificationData& data) { | 265 const WebNotificationData& data) { |
| 264 WaitUntilObserver* observer = WaitUntilObserver::create( | 266 WaitUntilObserver* observer = WaitUntilObserver::create( |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 407 return *m_document; | 409 return *m_document; |
| 408 } | 410 } |
| 409 | 411 |
| 410 ServiceWorkerGlobalScope* ServiceWorkerGlobalScopeProxy::workerGlobalScope() | 412 ServiceWorkerGlobalScope* ServiceWorkerGlobalScopeProxy::workerGlobalScope() |
| 411 const { | 413 const { |
| 412 DCHECK(m_workerGlobalScope); | 414 DCHECK(m_workerGlobalScope); |
| 413 return m_workerGlobalScope; | 415 return m_workerGlobalScope; |
| 414 } | 416 } |
| 415 | 417 |
| 416 } // namespace blink | 418 } // namespace blink |
| OLD | NEW |