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

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

Issue 1409143004: Only allow action buttons in persistent notifications per spec update (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@sw-not-props
Patch Set: Address review nits Created 5 years, 2 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
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/notifications/serviceworker-notification-properties.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 e9a6ef8496814f79e63538f984efc90757cbafcb..17d20e60e9d9f4887f6e1f41fe2dc45f70c341ef 100644
--- a/third_party/WebKit/Source/modules/notifications/Notification.cpp
+++ b/third_party/WebKit/Source/modules/notifications/Notification.cpp
@@ -79,6 +79,11 @@ Notification* Notification::create(ExecutionContext* context, const String& titl
return nullptr;
}
+ if (!options.actions().isEmpty()) {
+ exceptionState.throwTypeError("Actions are only supported for persistent notifications shown using ServiceWorkerRegistration.showNotification().");
+ return nullptr;
+ }
+
String insecureOriginMessage;
UseCounter::Feature feature = context->isSecureContext(insecureOriginMessage)
? UseCounter::NotificationSecureOrigin
« no previous file with comments | « third_party/WebKit/LayoutTests/http/tests/notifications/serviceworker-notification-properties.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698