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

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

Issue 1263043003: Add NotificationAction.action member (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@actions
Patch Set: Created 5 years, 5 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: Source/modules/notifications/Notification.cpp
diff --git a/Source/modules/notifications/Notification.cpp b/Source/modules/notifications/Notification.cpp
index 6b73d6cfee3a64f03201bfc8e1020f79390b4960..8f8d0730f65877bca9914caf87688a03e1b61055 100644
--- a/Source/modules/notifications/Notification.cpp
+++ b/Source/modules/notifications/Notification.cpp
@@ -93,8 +93,12 @@ Notification* Notification::create(ExecutionContext* context, const String& titl
}
for (NotificationAction action : options.actions()) {
+ if (action.action().isEmpty()) {
+ exceptionState.throwTypeError("NotificationAction action must not be empty.");
+ return nullptr;
+ }
if (action.title().isEmpty()) {
- exceptionState.throwTypeError("Notification action titles must not be empty.");
+ exceptionState.throwTypeError("NotificationAction title must not be empty.");
return nullptr;
}
}
@@ -309,6 +313,7 @@ void Notification::webActionsToActions(const WebVector<WebNotificationAction>& w
actions.clear();
actions.grow(webActions.size());
for (size_t i = 0; i < webActions.size(); ++i) {
+ actions[i].setAction(webActions[i].action);
actions[i].setTitle(webActions[i].title);
}
}

Powered by Google App Engine
This is Rietveld 408576698