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

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

Issue 2337963003: Plumb through notification action types and placeholders on Android (Closed)
Patch Set: Created 4 years, 3 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 114f5caf15ab585db2a20ee968cee75327df1942..17ceab435e03b5b91102cefc72ade097e5357c06 100644
--- a/chrome/browser/notifications/platform_notification_service_impl.cc
+++ b/chrome/browser/notifications/platform_notification_service_impl.cc
@@ -42,6 +42,7 @@
#include "content/public/common/notification_resources.h"
#include "content/public/common/platform_notification_data.h"
#include "ui/base/resource/resource_bundle.h"
+#include "ui/message_center/notification.h"
#include "ui/message_center/notification_types.h"
#include "ui/message_center/notifier_settings.h"
#include "url/url_constants.h"
@@ -479,6 +480,15 @@ Notification PlatformNotificationServiceImpl::CreateNotificationFromData(
// the 1x bitmap - crbug.com/585815.
button.icon =
gfx::Image::CreateFrom1xBitmap(notification_resources.action_icons[i]);
+ button.placeholder = notification_data.actions[i].placeholder;
+ switch (notification_data.actions[i].type) {
+ case content::PLATFORM_NOTIFICATION_ACTION_TYPE_BUTTON:
+ button.type = message_center::NotificationActionType::BUTTON;
+ break;
+ case content::PLATFORM_NOTIFICATION_ACTION_TYPE_TEXT:
+ button.type = message_center::NotificationActionType::TEXT;
+ break;
+ }
buttons.push_back(button);
}
notification.set_buttons(buttons);

Powered by Google App Engine
This is Rietveld 408576698