Index: Source/modules/notifications/Notification.cpp |
diff --git a/Source/modules/notifications/Notification.cpp b/Source/modules/notifications/Notification.cpp |
index f0964c3a66a09ebc1a3393f1c2061024cd9fcf24..99e8720e3324f84952eb997f8972b02a7e28b8a7 100644 |
--- a/Source/modules/notifications/Notification.cpp |
+++ b/Source/modules/notifications/Notification.cpp |
@@ -161,6 +161,10 @@ const String& Notification::permission(ExecutionContext* context) |
void Notification::requestPermission(ExecutionContext* context, PassOwnPtrWillBeRawPtr<NotificationPermissionCallback> callback) |
{ |
+ if (!UserGestureIndicator::processingUserGesture()) { |
+ context->addConsoleMessage(ConsoleMessage::create(JSMessageSource, WarningMessageLevel, |
+ "Notification.requestPermission() was invoked by script, without any user interaction involved!")); |
+ } |
Peter Beverloo
2014/09/24 14:59:44
We removed the user gesture requirement for reques
Mayur Kankanwadi
2014/09/24 15:03:42
No, not seeing any permission dialog for notificat
Peter Beverloo
2014/09/24 17:14:20
I made a test-page here:
http://peter.sh/files/n
meacer
2014/09/24 17:59:21
I agree, a gesture isn't required for this API so
Mayur Kankanwadi
2014/09/25 06:43:01
Done.
|
// FIXME: Assert that this code-path will only be reached for Document environments |
// when Blink supports [Exposed] annotations on class members in IDL definitions. |
if (NotificationPermissionClient* permissionClient = NotificationPermissionClient::from(context)) { |