| Index: Source/modules/notifications/Notification.cpp
|
| diff --git a/Source/modules/notifications/Notification.cpp b/Source/modules/notifications/Notification.cpp
|
| index 742e6b7517f5fa90285c79f957aa4a0cadbea9ca..a2d0c8d5e7abac55cd8287c4f774c1e499d0cc3d 100644
|
| --- a/Source/modules/notifications/Notification.cpp
|
| +++ b/Source/modules/notifications/Notification.cpp
|
| @@ -199,11 +199,15 @@ void Notification::finalize()
|
|
|
| void Notification::dispatchShowEvent()
|
| {
|
| +#if ENABLE(LEGACY_NOTIFICATIONS)
|
| + dispatchEvent(Event::create(eventNames().displayEvent, false, false));
|
| +#endif
|
| dispatchEvent(Event::create(eventNames().showEvent, false, false));
|
| }
|
|
|
| void Notification::dispatchClickEvent()
|
| {
|
| + UserGestureIndicator gestureIndicator(DefinitelyProcessingNewUserGesture);
|
| WindowFocusAllowedIndicator windowFocusAllowed;
|
| dispatchEvent(Event::create(eventNames().clickEvent, false, false));
|
| }
|
| @@ -228,6 +232,14 @@ void Notification::taskTimerFired(Timer<Notification>* timer)
|
| }
|
| #endif
|
|
|
| +bool Notification::dispatchEvent(PassRefPtr<Event> event)
|
| +{
|
| + // Do not dispatch if the context is gone.
|
| + if (!scriptExecutionContext())
|
| + return false;
|
| +
|
| + return EventTarget::dispatchEvent(event);
|
| +}
|
|
|
| #if ENABLE(NOTIFICATIONS)
|
| const String& Notification::permission(ScriptExecutionContext* context)
|
|
|