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

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: Added TypeError for incorrect options and unit test Created 4 years, 11 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 d7bc93f1ab08eb2ee0ef0ba8502bfcd7c0355ad7..231ca59ff7913fe8eb4538e766c063f8c11587d2 100644
--- a/third_party/WebKit/Source/modules/notifications/NotificationData.cpp
+++ b/third_party/WebKit/Source/modules/notifications/NotificationData.cpp
@@ -38,6 +38,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 valid tag.");
Peter Beverloo 2016/02/02 23:43:10 a valid tag -> a non-empty tag The only validity
harkness 2016/02/03 11:24:28 Done.
+ return WebNotificationData();
+ }
+
WebNotificationData webData;
webData.title = title;
@@ -59,6 +65,7 @@ WebNotificationData createWebNotificationData(ExecutionContext* executionContext
webData.vibrate = NavigatorVibration::sanitizeVibrationPattern(options.vibrate());
webData.timestamp = options.hasTimestamp() ? static_cast<double>(options.timestamp()) : WTF::currentTimeMS();
webData.silent = options.silent();
+ webData.renotify = options.renotify();
webData.requireInteraction = options.requireInteraction();
if (options.hasData()) {

Powered by Google App Engine
This is Rietveld 408576698