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

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

Issue 2856833002: Fix a bug that old height is set in DoUpdateIfPossible(). (Closed)
Patch Set: rebase Created 3 years, 7 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 | « no previous file | ui/message_center/views/message_list_view_unittest.cc » ('j') | 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 06cce39c28a3b0defe6e473284cfcea9da3e3661..653b3f825a6fea4004c1f07a230e1f38bc848424 100644
--- a/ui/message_center/views/message_list_view.cc
+++ b/ui/message_center/views/message_list_view.cc
@@ -349,15 +349,17 @@ void MessageListView::DoUpdateIfPossible() {
return;
}
- int new_height = GetHeightForWidth(child_area.width() + GetInsets().width());
- SetSize(gfx::Size(child_area.width() + GetInsets().width(), new_height));
-
if (base::CommandLine::ForCurrentProcess()->HasSwitch(
switches::kEnableMessageCenterAlwaysScrollUpUponNotificationRemoval))
AnimateNotificationsBelowTarget();
else
AnimateNotifications();
+ // Should calculate and set new size after calling AnimateNotifications()
+ // because fixed_height_ may be updated in it.
+ int new_height = GetHeightForWidth(child_area.width() + GetInsets().width());
+ SetSize(gfx::Size(child_area.width() + GetInsets().width(), new_height));
+
adding_views_.clear();
deleting_views_.clear();
« no previous file with comments | « no previous file | ui/message_center/views/message_list_view_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698