Chromium Code Reviews| Index: ui/arc/notification/arc_notification_item.cc |
| diff --git a/ui/arc/notification/arc_notification_item.cc b/ui/arc/notification/arc_notification_item.cc |
| index dc7288546f67f9027a7a9f57c14738782afb4e74..8ec85e7bd6401ee70218abe1cf0a82f5df7bc37b 100644 |
| --- a/ui/arc/notification/arc_notification_item.cc |
| +++ b/ui/arc/notification/arc_notification_item.cc |
| @@ -39,6 +39,23 @@ SkBitmap DecodeImage(const std::vector<uint8_t>& data) { |
| return bitmap; |
| } |
| +int convertAndroidPriority(const int androidPriority) { |
|
hidehiko
2016/04/28 17:07:48
Could you comment your intention of this mapping?
yoshiki
2016/04/28 18:09:07
Done.
|
| + switch (androidPriority) { |
| + case -2: // PRIORITY_MIN |
| + case -1: // PRIORITY_LOW |
| + return -2; |
| + case 0: // PRIORITY_DEFAULT |
| + return -1; |
| + case 1: // PRIORITY_HIGH |
| + return 0; |
| + case 2: // PRIORITY_MAX |
| + return 2; |
| + default: |
| + NOTREACHED() << "Invalid Priority"; |
| + return 0; |
|
hidehiko
2016/04/28 17:07:48
Maybe -1 not to show the popup?
yoshiki
2016/04/28 18:09:07
I think the default priority (= 0) should be used
|
| + } |
| +} |
| + |
| class ArcNotificationDelegate : public message_center::NotificationDelegate { |
| public: |
| explicit ArcNotificationDelegate(base::WeakPtr<ArcNotificationItem> item) |
| @@ -139,6 +156,8 @@ void ArcNotificationItem::UpdateWithArcNotificationData( |
| // are false. |
| rich_data.pinned = (data.no_clear || data.ongoing_event); |
| + rich_data.priority = convertAndroidPriority(data.priority); |
| + |
| // The identifier of the notifier, which is used to distinguish the notifiers |
| // in the message center. |
| message_center::NotifierId notifier_id( |