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

Unified Diff: ui/arc/notification/arc_custom_notification_item.cc

Issue 2765923003: Extend notifications.mojom for expandable notifications. (Closed)
Patch Set: Created 3 years, 9 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
« no previous file with comments | « ui/arc/notification/arc_custom_notification_item.h ('k') | ui/message_center/notification.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/arc/notification/arc_custom_notification_item.cc
diff --git a/ui/arc/notification/arc_custom_notification_item.cc b/ui/arc/notification/arc_custom_notification_item.cc
index f44884dd5c039ad80cf19ab073be0df5c6b3e581..ce9a05058d9e2c0ea0765bb8c2d431a4f91960d5 100644
--- a/ui/arc/notification/arc_custom_notification_item.cc
+++ b/ui/arc/notification/arc_custom_notification_item.cc
@@ -50,6 +50,23 @@ class ArcNotificationDelegate : public message_center::NotificationDelegate {
DISALLOW_COPY_AND_ASSIGN(ArcNotificationDelegate);
};
+message_center::NotificationExpandState ToNotificationExpandState(
yoshiki 2017/03/24 10:47:27 I think it's enough to use the mojo enum values (m
+ mojom::ArcNotificationExpandState state) {
+ switch (state) {
+ case mojom::ArcNotificationExpandState::FIXED_SIZE:
+ return message_center::NotificationExpandState::FIXED_SIZE;
+ case mojom::ArcNotificationExpandState::COLLAPSED:
+ return message_center::NotificationExpandState::COLLAPSED;
+ case mojom::ArcNotificationExpandState::EXPANDED:
+ return message_center::NotificationExpandState::EXPANDED;
+ default:
+ NOTREACHED();
+ break;
+ }
+ NOTREACHED();
+ return message_center::NotificationExpandState::FIXED_SIZE;
+}
+
} // namespace
ArcCustomNotificationItem::ArcCustomNotificationItem(
@@ -80,6 +97,7 @@ void ArcCustomNotificationItem::UpdateWithArcNotificationData(
message_center::RichNotificationData rich_data;
rich_data.pinned = (data->no_clear || data->ongoing_event);
+ rich_data.expand_state = ToNotificationExpandState(data->expand_state);
rich_data.priority = ConvertAndroidPriority(data->priority);
if (data->small_icon)
rich_data.small_image = gfx::Image::CreateFrom1xBitmap(*data->small_icon);
@@ -101,6 +119,7 @@ void ArcCustomNotificationItem::UpdateWithArcNotificationData(
SetNotification(std::move(notification));
pinned_ = rich_data.pinned;
+ expand_state_ = rich_data.expand_state;
if (!data->snapshot_image || data->snapshot_image->isNull()) {
snapshot_ = gfx::ImageSkia();
« no previous file with comments | « ui/arc/notification/arc_custom_notification_item.h ('k') | ui/message_center/notification.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698