Index: ui/message_center/views/message_popup_collection.cc |
diff --git a/ui/message_center/views/message_popup_collection.cc b/ui/message_center/views/message_popup_collection.cc |
index 1a28ffe591e6e9f7e29b0d9876aa3ac6fcd40cb5..03914900d670b8e5185967b88d1ee85a7230f137 100644 |
--- a/ui/message_center/views/message_popup_collection.cc |
+++ b/ui/message_center/views/message_popup_collection.cc |
@@ -83,7 +83,23 @@ void MessagePopupCollection::ClickOnNotification( |
void MessagePopupCollection::RemoveNotification( |
const std::string& notification_id, |
bool by_user) { |
- message_center_->RemoveNotification(notification_id, by_user); |
+ |
+ NotificationList::PopupNotifications notifications = |
+ message_center_->GetPopupNotifications(); |
+ for (NotificationList::PopupNotifications::iterator iter = |
+ notifications.begin(); iter != notifications.end(); ++iter) { |
+ Notification* notification = *iter; |
+ DCHECK(notification); |
+ |
+ if (notification->id() != notification_id) |
+ continue; |
+ |
+ // Don't remove the notification only when it's not closable. |
+ if (notification->closable()) |
dewittj
2016/02/03 19:31:37
Should there be an else clause, something like "Ma
yoshiki
2016/02/07 17:49:41
Good point. Done.
|
+ message_center_->RemoveNotification(notification_id, by_user); |
+ |
+ break; |
+ } |
} |
scoped_ptr<ui::MenuModel> MessagePopupCollection::CreateMenuModel( |
@@ -139,9 +155,13 @@ void MessagePopupCollection::UpdateWidgets() { |
if (FindToast((*iter)->id())) |
continue; |
+ Notification notification = *(*iter); |
+ // Override closable status, since toasts should be closable even when it's |
+ // non-closable. |
+ notification.set_closable(true); |
NotificationView* view = |
NotificationView::Create(NULL, |
- *(*iter), |
+ notification, |
true); // Create top-level notification. |
view->set_context_menu_controller(context_menu_controller_.get()); |
int view_height = ToastContentsView::GetToastSizeForView(view).height(); |