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

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

Issue 1644573002: Notification actions may have an icon url. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 10 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..71e2e9b6ace75e9ed0bf86e26c91b5dc9f360223 100644
--- a/third_party/WebKit/Source/modules/notifications/NotificationData.cpp
+++ b/third_party/WebKit/Source/modules/notifications/NotificationData.cpp
@@ -11,7 +11,6 @@
#include "modules/notifications/Notification.h"
#include "modules/notifications/NotificationOptions.h"
#include "modules/vibration/NavigatorVibration.h"
-#include "platform/RuntimeEnabledFeatures.h"
#include "platform/weborigin/KURL.h"
#include "wtf/CurrentTime.h"
@@ -48,7 +47,6 @@ WebNotificationData createWebNotificationData(ExecutionContext* executionContext
KURL iconUrl;
- // TODO(peter): Apply the appropriate CORS checks on the |iconUrl|.
if (options.hasIcon() && !options.icon().isEmpty()) {
iconUrl = executionContext->completeURL(options.icon());
if (!iconUrl.isValid())
@@ -83,6 +81,14 @@ WebNotificationData createWebNotificationData(ExecutionContext* executionContext
webAction.action = action.action();
webAction.title = action.title();
+ KURL iconUrl;
+ if (action.hasIcon() && !action.icon().isEmpty()) {
+ iconUrl = executionContext->completeURL(action.icon());
+ if (!iconUrl.isValid())
+ iconUrl = KURL();
+ }
+ webAction.icon = iconUrl;
+
actions.append(webAction);
}

Powered by Google App Engine
This is Rietveld 408576698