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

Unified Diff: chrome/browser/notifications/platform_notification_service_impl.cc

Issue 1267673003: Plumb Blink notification actions to button UI on desktop (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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: chrome/browser/notifications/platform_notification_service_impl.cc
diff --git a/chrome/browser/notifications/platform_notification_service_impl.cc b/chrome/browser/notifications/platform_notification_service_impl.cc
index da15f65a863f65c6f47c28b96dcb36ded24a7313..48ed88acf310833e552687096cc6f5a94eea26fa 100644
--- a/chrome/browser/notifications/platform_notification_service_impl.cc
+++ b/chrome/browser/notifications/platform_notification_service_impl.cc
@@ -22,6 +22,7 @@
#include "content/public/browser/notification_event_dispatcher.h"
#include "content/public/browser/platform_notification_context.h"
#include "content/public/browser/storage_partition.h"
+#include "content/public/common/platform_notification_action.h"
#include "content/public/common/platform_notification_data.h"
#include "net/base/net_util.h"
#include "ui/message_center/notifier_settings.h"
@@ -335,6 +336,11 @@ Notification PlatformNotificationServiceImpl::CreateNotificationFromData(
notification.set_vibration_pattern(notification_data.vibration_pattern);
notification.set_silent(notification_data.silent);
+ std::vector<message_center::ButtonInfo> buttons;
+ for (content::PlatformNotificationAction action : notification_data.actions)
Peter Beverloo 2015/07/30 17:02:04 const& to avoid the copies. Fine to use auto.
johnme 2015/07/31 18:21:31 Done.
+ buttons.push_back(message_center::ButtonInfo(action.title));
+ notification.set_buttons(buttons);
Peter Beverloo 2015/07/30 17:02:05 micro nit: blank line above this one.
johnme 2015/07/31 18:21:31 Done.
+
// Web Notifications do not timeout.
notification.set_never_timeout(true);

Powered by Google App Engine
This is Rietveld 408576698