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

Unified Diff: ui/message_center/views/message_list_view.cc

Issue 2544533005: Remove newly-added notification correctly in the message center (Closed)
Patch Set: Created 4 years 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/message_center/views/message_list_view.cc
diff --git a/ui/message_center/views/message_list_view.cc b/ui/message_center/views/message_list_view.cc
index a5f2a70a2fd939df21fed5c11775b6cd8ecf811f..74393646ac1c63893466c0615d374ae3d863b2a1 100644
--- a/ui/message_center/views/message_list_view.cc
+++ b/ui/message_center/views/message_list_view.cc
@@ -102,13 +102,19 @@ void MessageListView::AddNotificationAt(MessageView* view, int index) {
void MessageListView::RemoveNotification(MessageView* view) {
DCHECK_EQ(view->parent(), this);
+
+
if (GetContentsBounds().IsEmpty()) {
delete view;
} else {
+ if (adding_views_.find(view) != adding_views_.end())
+ adding_views_.erase(view);
+ if (animator_.IsAnimating(view))
+ animator_.StopAnimatingView(view);
+
if (view->layer()) {
deleting_views_.insert(view);
} else {
- animator_.StopAnimatingView(view);
delete view;
}
DoUpdateIfPossible();
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698