Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(915)

Unified Diff: third_party/WebKit/Source/modules/notifications/NotificationData.cpp

Issue 1656243002: Implementation of renotify flag for Notifications. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/modules/notifications/NotificationData.cpp
diff --git a/third_party/WebKit/Source/modules/notifications/NotificationData.cpp b/third_party/WebKit/Source/modules/notifications/NotificationData.cpp
index 71e2e9b6ace75e9ed0bf86e26c91b5dc9f360223..e26722f3c95ad6101c87623c5885e12cf251117f 100644
--- a/third_party/WebKit/Source/modules/notifications/NotificationData.cpp
+++ b/third_party/WebKit/Source/modules/notifications/NotificationData.cpp
@@ -37,6 +37,12 @@ WebNotificationData createWebNotificationData(ExecutionContext* executionContext
return WebNotificationData();
}
+ // If renotify is true, the notification must have a tag.
+ if (options.renotify() && options.tag().isEmpty()) {
+ exceptionState.throwTypeError("Notifications which set the renotify flag must specify a non-empty tag.");
+ return WebNotificationData();
+ }
+
WebNotificationData webData;
webData.title = title;
@@ -56,6 +62,7 @@ WebNotificationData createWebNotificationData(ExecutionContext* executionContext
webData.icon = iconUrl;
webData.vibrate = NavigatorVibration::sanitizeVibrationPattern(options.vibrate());
webData.timestamp = options.hasTimestamp() ? static_cast<double>(options.timestamp()) : WTF::currentTimeMS();
+ webData.renotify = options.renotify();
webData.silent = options.silent();
webData.requireInteraction = options.requireInteraction();

Powered by Google App Engine
This is Rietveld 408576698