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, ...@@ -362,4 +362,4 @@ void StackedNotificationBar::ButtonPressed(views::Button* sender,
} }
} }
} // namespace ash } // namespace ash
\ No newline at end of file
...@@ -259,6 +259,7 @@ TEST_F(UnifiedMessageCenterBubbleTest, ReverseFocusCycle) { ...@@ -259,6 +259,7 @@ TEST_F(UnifiedMessageCenterBubbleTest, ReverseFocusCycle) {
TEST_F(UnifiedMessageCenterBubbleTest, CollapseState) { TEST_F(UnifiedMessageCenterBubbleTest, CollapseState) {
EnableMessageCenterRefactor(); EnableMessageCenterRefactor();
AddNotification();
GetPrimaryUnifiedSystemTray()->ShowBubble(true); GetPrimaryUnifiedSystemTray()->ShowBubble(true);
int small_display_height = int small_display_height =
......
...@@ -122,7 +122,7 @@ void UnifiedMessageCenterView::SetAvailableHeight(int available_height) { ...@@ -122,7 +122,7 @@ void UnifiedMessageCenterView::SetAvailableHeight(int available_height) {
} }
void UnifiedMessageCenterView::SetExpanded() { void UnifiedMessageCenterView::SetExpanded() {
if (!collapsed_) if (!GetVisible() || !collapsed_)
return; return;
collapsed_ = false; collapsed_ = false;
...@@ -132,7 +132,7 @@ void UnifiedMessageCenterView::SetExpanded() { ...@@ -132,7 +132,7 @@ void UnifiedMessageCenterView::SetExpanded() {
} }
void UnifiedMessageCenterView::SetCollapsed(bool animate) { void UnifiedMessageCenterView::SetCollapsed(bool animate) {
if (collapsed_) if (!GetVisible() || collapsed_)
return; return;
collapsed_ = true; 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