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

Ash Tray: Fix quick settings not closing after clicking on a notification.

This is a reland of the original fix (see bug), which was reverted due to
regressions.

This updated version fixes an edge case, which caused a crash when dismissing
the message center via accelerator in certian circumstances.

BUG=1024100

Change-Id: I525186a7075732946403ebffa5def4631bcde658
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2013525Reviewed-by: default avatarAhmed Mehfooz <amehfooz@chromium.org>
Commit-Queue: Tim Song <tengs@chromium.org>
Cr-Commit-Position: refs/heads/master@{#733852}
parent 80906e3b
......@@ -319,19 +319,21 @@ void UnifiedSystemTrayBubble::OnWindowActivated(ActivationReason reason,
return;
}
// Don't close the bubble if the message center is gaining or losing
// activation.
// Don't close the bubble if the message center is gaining activation.
if (features::IsUnifiedMessageCenterRefactorEnabled() &&
tray_->IsMessageCenterBubbleShown()) {
views::Widget* message_center_widget =
tray_->message_center_bubble()->GetBubbleWidget();
if (message_center_widget ==
views::Widget::GetWidgetForNativeView(gained_active) ||
(lost_active &&
message_center_widget ==
views::Widget::GetWidgetForNativeView(lost_active))) {
views::Widget::GetWidgetForNativeView(gained_active)) {
return;
}
// If the message center is not visible, ignore activation changes.
// Otherwise, this may cause a crash when closing the dialog via
// accelerator. See crbug.com/1041174.
if (!message_center_widget->IsVisible())
return;
}
tray_->CloseBubble();
......
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