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

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

Issue 1855443002: Implement receiving side of web notification inline replies (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added test and removed unnecessary code. Created 4 years, 8 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 ed67c9e3882698816287013ef69bab0c2bbc438d..60a86876e6e384665d18932fe54e34e4a7943190 100644
--- a/third_party/WebKit/Source/modules/notifications/NotificationData.cpp
+++ b/third_party/WebKit/Source/modules/notifications/NotificationData.cpp
@@ -93,6 +93,20 @@ WebNotificationData createWebNotificationData(ExecutionContext* executionContext
webAction.action = action.action();
webAction.title = action.title();
+ if (action.type() == "button")
+ webAction.type = WebNotificationAction::Button;
+ else if (action.type() == "text")
+ webAction.type = WebNotificationAction::Text;
+ else
+ NOTREACHED() << "Unknown action type: " << action.type();
+
+ if (action.hasPlaceholder() && webAction.type == WebNotificationAction::Button) {
+ exceptionState.throwTypeError("Notifications of type \"button\" cannot specify a placeholder.");
+ return WebNotificationData();
+ }
+
+ webAction.placeholder = action.placeholder();
+
if (action.hasIcon() && !action.icon().isEmpty())
webAction.icon = completeURL(executionContext, action.icon());

Powered by Google App Engine
This is Rietveld 408576698