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

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

Issue 2337963003: Plumb through notification action types and placeholders on Android (Closed)
Patch Set: Plumb through the notification action types and placeholder text for inline replies 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 7b1472ac7d62e6cf12000c86bb5b7f3d667b9a75..b6f2add616f041f964da8934923e1a83080bce49 100644
--- a/chrome/browser/notifications/platform_notification_service_impl.cc
+++ b/chrome/browser/notifications/platform_notification_service_impl.cc
@@ -39,6 +39,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"
@@ -448,6 +449,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::ButtonType::BUTTON;
+ break;
+ case content::PLATFORM_NOTIFICATION_ACTION_TYPE_TEXT:
+ button.type = message_center::ButtonType::TEXT;
+ break;
+ }
buttons.push_back(button);
}
notification.set_buttons(buttons);

Powered by Google App Engine
This is Rietveld 408576698