Commit c22819ba authored by Tim Song's avatar Tim Song Committed by Commit Bot

Ash Tray: Fix message center visibility when collapsing with no notifications.

This CL also adds unit tests for the collapse/expand behaviour for the message
center.

TEST=manual + new unit tests
BUG=1019405

Change-Id: I1189549e41e6f11f2d513c4d041de6e5ac108caf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1888187
Commit-Queue: Ahmed Mehfooz <amehfooz@chromium.org>
Reviewed-by: default avatarAhmed Mehfooz <amehfooz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#711131}
parent 696b04ea
......@@ -362,4 +362,4 @@ void StackedNotificationBar::ButtonPressed(views::Button* sender,
}
}
} // namespace ash
\ No newline at end of file
} // namespace ash
......@@ -259,6 +259,7 @@ TEST_F(UnifiedMessageCenterBubbleTest, ReverseFocusCycle) {
TEST_F(UnifiedMessageCenterBubbleTest, CollapseState) {
EnableMessageCenterRefactor();
AddNotification();
GetPrimaryUnifiedSystemTray()->ShowBubble(true);
int small_display_height =
......
......@@ -122,7 +122,7 @@ void UnifiedMessageCenterView::SetAvailableHeight(int available_height) {
}
void UnifiedMessageCenterView::SetExpanded() {
if (!collapsed_)
if (!GetVisible() || !collapsed_)
return;
collapsed_ = false;
......@@ -132,7 +132,7 @@ void UnifiedMessageCenterView::SetExpanded() {
}
void UnifiedMessageCenterView::SetCollapsed(bool animate) {
if (collapsed_)
if (!GetVisible() || collapsed_)
return;
collapsed_ = true;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment