Index: third_party/WebKit/Source/modules/notifications/Notification.cpp |
diff --git a/third_party/WebKit/Source/modules/notifications/Notification.cpp b/third_party/WebKit/Source/modules/notifications/Notification.cpp |
index af9ad5b05de815721b36bc7ea43af3bf48a5b67a..980b5ac8521881772ebd762e78bf2cc255fc922d 100644 |
--- a/third_party/WebKit/Source/modules/notifications/Notification.cpp |
+++ b/third_party/WebKit/Source/modules/notifications/Notification.cpp |
@@ -35,6 +35,7 @@ |
#include "bindings/core/v8/SerializedScriptValueFactory.h" |
#include "bindings/modules/v8/V8NotificationAction.h" |
#include "core/dom/Document.h" |
+#include "core/dom/DocumentUserGestureToken.h" |
#include "core/dom/ExecutionContext.h" |
#include "core/dom/ExecutionContextTask.h" |
#include "core/dom/ScopedWindowFocusAllowedIndicator.h" |
@@ -208,8 +209,10 @@ void Notification::dispatchShowEvent() { |
} |
void Notification::dispatchClickEvent() { |
- UserGestureIndicator gestureIndicator( |
- UserGestureToken::create(UserGestureToken::NewGesture)); |
+ ExecutionContext* context = getExecutionContext(); |
+ UserGestureIndicator gestureIndicator(DocumentUserGestureToken::create( |
+ context->isDocument() ? toDocument(context) : nullptr, |
+ UserGestureToken::NewGesture)); |
ScopedWindowFocusAllowedIndicator windowFocusAllowed(getExecutionContext()); |
dispatchEvent(Event::create(EventTypeNames::click)); |
} |