Chromium Code Reviews| 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..13789d1e4cf82fe12b66f59ee3bdf663a3685acf 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,22 @@ 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; |
| + default: |
|
Michael van Ouwerkerk
2016/04/06 13:27:35
I think there's a clang check for switches over en
Nina
2016/04/06 16:05:49
There is, and since we're not jumping layers there
|
| + NOTREACHED(); |
| + } |
| + |
| // 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); |