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 eea467bd9b203d395bc38da3b5069f346412e0af..27d3dc36a4f0cb4d3cd9b28bc1e4ce38fda5203b 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" |
@@ -219,9 +220,10 @@ void Notification::didShowNotification(const WebString& notificationId) { |
} |
void Notification::didClickNotification() { |
- UserGestureIndicator gestureIndicator( |
- UserGestureToken::create(UserGestureToken::NewGesture)); |
- |
+ ExecutionContext* context = getExecutionContext(); |
+ UserGestureIndicator gestureIndicator(DocumentUserGestureToken::create( |
+ context->isDocument() ? toDocument(context) : nullptr, |
Peter Beverloo
2016/10/19 16:36:48
Prefer DCHECK(context->isDocument()) for this code
Nate Chapin
2016/10/21 18:11:04
Done.
Nate Chapin
2016/10/21 20:43:28
...actually, the layout tests disagree. Switched b
|
+ UserGestureToken::NewGesture)); |
ScopedWindowFocusAllowedIndicator windowFocusAllowed(getExecutionContext()); |
dispatchEvent(Event::create(EventTypeNames::click)); |
} |