Commit bef9b05a authored by Ahmed Mehfooz's avatar Ahmed Mehfooz Committed by Commit Bot

Set message center collapse state after initializing bubble

The focus issue is caused by incorrect order of visibility changes
being propagated down to ArcNotificationContentView.

Bug: 1068964
Change-Id: Idbb902c9aa5d14a0c1648f41a25e366fd2f7f91d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2142755Reviewed-by: default avatarTim Song <tengs@chromium.org>
Commit-Queue: Ahmed Mehfooz <amehfooz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#757695}
parent 77b4ec2e
......@@ -85,18 +85,6 @@ UnifiedMessageCenterBubble::UnifiedMessageCenterBubble(UnifiedSystemTray* tray)
bubble_view_->AddChildView(std::make_unique<UnifiedMessageCenterView>(
nullptr /* parent */, tray->model(), this));
// Check if the message center bubble should be collapsed or expanded
// when it is initially opened.
if (CalculateAvailableHeight() < kMessageCenterCollapseThreshold &&
message_center_view_->GetPreferredSize().height()) {
if (tray_->IsQuickSettingsExplicitlyExpanded()) {
message_center_view_->SetCollapsed(false /*animate*/);
} else {
message_center_view_->SetExpanded();
tray_->EnsureQuickSettingsCollapsed(false /*animate*/);
}
}
message_center_view_->AddObserver(this);
}
......@@ -116,6 +104,18 @@ void UnifiedMessageCenterBubble::ShowBubble() {
bubble_view_->InitializeAndShowBubble();
// Check if the message center bubble should be collapsed or expanded
// when it is initially opened.
if (CalculateAvailableHeight() < kMessageCenterCollapseThreshold &&
message_center_view_->GetPreferredSize().height()) {
if (tray_->IsQuickSettingsExplicitlyExpanded()) {
message_center_view_->SetCollapsed(false /*animate*/);
} else {
message_center_view_->SetExpanded();
tray_->EnsureQuickSettingsCollapsed(false /*animate*/);
}
}
UpdatePosition();
}
......
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