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

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

Issue 1864053002: Implement Android UI of web notification inline replies Base URL: https://chromium.googlesource.com/chromium/src.git@inline_replies_ps1
Patch Set: Fix filename? Created 4 years, 8 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 dc4cf994e758ec7dfa17e9e4813992c112de1eb4..9a30b059f66849da36e16822132d12d72516e313 100644
--- a/chrome/browser/notifications/platform_notification_service_impl.cc
+++ b/chrome/browser/notifications/platform_notification_service_impl.cc
@@ -8,6 +8,7 @@
#include <vector>
#include "base/command_line.h"
+#include "base/logging.h"
#include "base/metrics/histogram_macros.h"
#include "base/metrics/user_metrics_action.h"
#include "base/strings/string_number_conversions.h"
@@ -468,10 +469,20 @@ Notification PlatformNotificationServiceImpl::CreateNotificationFromData(
std::vector<message_center::ButtonInfo> buttons;
for (size_t i = 0; i < notification_data.actions.size(); i++) {
message_center::ButtonInfo button(notification_data.actions[i].title);
+ switch (notification_data.actions[i].type) {
+ case content::PLATFORM_NOTIFICATION_ACTION_TYPE_BUTTON:
+ button.type = message_center::BUTTON_INFO_TYPE_BUTTON;
+ break;
+ case content::PLATFORM_NOTIFICATION_ACTION_TYPE_TEXT:
+ button.type = message_center::BUTTON_INFO_TYPE_TEXT;
+ break;
+ }
+
// TODO(peter): Handle different screen densities instead of always using
// the 1x bitmap - crbug.com/585815.
button.icon =
gfx::Image::CreateFrom1xBitmap(notification_resources.action_icons[i]);
+ button.placeholder = notification_data.actions[i].placeholder;
buttons.push_back(button);
}
notification.set_buttons(buttons);

Powered by Google App Engine
This is Rietveld 408576698