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

Unified Diff: content/browser/notifications/notification_message_filter.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: Fix size_t Created 5 years, 4 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: content/browser/notifications/notification_message_filter.cc
diff --git a/content/browser/notifications/notification_message_filter.cc b/content/browser/notifications/notification_message_filter.cc
index 8f22f429515aa8c3fca0dc42b9fcdab6b63b5808..32691565d7f90140b1b43ec38b61f35bcdcf13fe 100644
--- a/content/browser/notifications/notification_message_filter.cc
+++ b/content/browser/notifications/notification_message_filter.cc
@@ -8,6 +8,7 @@
#include "content/browser/bad_message.h"
#include "content/browser/notifications/page_notification_delegate.h"
#include "content/browser/notifications/platform_notification_context_impl.h"
+#include "content/common/notification_constants.h"
#include "content/common/platform_notification_messages.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/browser_thread.h"
@@ -35,6 +36,10 @@ PlatformNotificationData SanitizeNotificationData(
std::max(kMinimumVibrationDurationMs, pattern));
}
+ // Ensure there aren't more actions than supported.
+ if (sanitized_data.actions.size() > kPlatformNotificationMaxActions)
+ sanitized_data.actions.resize(kPlatformNotificationMaxActions);
+
return sanitized_data;
}

Powered by Google App Engine
This is Rietveld 408576698