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

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

Issue 1412223007: Ship Notification action buttons by default (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@notexp
Patch Set: Rebase 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
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 34b697d920c12d970bc75f32767b2f2f9ee71386..4052706c4241c29ad52a66f149b3e93e68dd8ab9 100644
--- a/third_party/WebKit/Source/modules/notifications/NotificationData.cpp
+++ b/third_party/WebKit/Source/modules/notifications/NotificationData.cpp
@@ -71,35 +71,32 @@ WebNotificationData createWebNotificationData(ExecutionContext* executionContext
webData.data = serializedData;
}
- // Ignore experimental NotificationOptions members if the flag is not set.
- if (RuntimeEnabledFeatures::notificationExperimentalEnabled()) {
- Vector<WebNotificationAction> actions;
-
- const size_t maxActions = Notification::maxActions();
- for (const NotificationAction& action : options.actions()) {
- if (action.action().isEmpty()) {
- exceptionState.throwTypeError("NotificationAction `action` must not be empty.");
- return WebNotificationData();
- }
-
- if (action.title().isEmpty()) {
- exceptionState.throwTypeError("NotificationAction `title` must not be empty.");
- return WebNotificationData();
- }
-
- if (actions.size() >= maxActions)
- continue;
-
- WebNotificationAction webAction;
- webAction.action = action.action();
- webAction.title = action.title();
-
- actions.append(webAction);
+ Vector<WebNotificationAction> actions;
+
+ const size_t maxActions = Notification::maxActions();
+ for (const NotificationAction& action : options.actions()) {
+ if (action.action().isEmpty()) {
+ exceptionState.throwTypeError("NotificationAction `action` must not be empty.");
+ return WebNotificationData();
+ }
+
+ if (action.title().isEmpty()) {
+ exceptionState.throwTypeError("NotificationAction `title` must not be empty.");
+ return WebNotificationData();
}
- webData.actions = actions;
+ if (actions.size() >= maxActions)
+ continue;
+
+ WebNotificationAction webAction;
+ webAction.action = action.action();
+ webAction.title = action.title();
+
+ actions.append(webAction);
}
+ webData.actions = actions;
+
return webData;
}

Powered by Google App Engine
This is Rietveld 408576698