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

Fix message center crash

Modify check for message center gaining activation to not
dereference the message center widget. There's a crash
caused by focus switching between the message center
and quick setting bubbles before the message center bubble's
constructor has exited.

Change-Id: Ia15acb47dc3806466a2f40a73e843333655e7953
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1860692
Commit-Queue: Ahmed Mehfooz <amehfooz@chromium.org>
Reviewed-by: default avatarTim Song <tengs@chromium.org>
Cr-Commit-Position: refs/heads/master@{#705749}
parent e20e15dd
...@@ -299,15 +299,9 @@ void UnifiedSystemTrayBubble::OnWindowActivated(ActivationReason reason, ...@@ -299,15 +299,9 @@ void UnifiedSystemTrayBubble::OnWindowActivated(ActivationReason reason,
// Don't close the bubble if the message center is gaining or losing // Don't close the bubble if the message center is gaining or losing
// activation. // activation.
if (features::IsUnifiedMessageCenterRefactorEnabled() && if (features::IsUnifiedMessageCenterRefactorEnabled()) {
tray_->IsMessageCenterBubbleShown()) { if (GetContainerForWindow(gained_active) ==
views::Widget* message_center_widget = GetContainerForWindow(lost_active)) {
tray_->message_center_bubble()->GetBubbleWidget();
if (message_center_widget ==
views::Widget::GetWidgetForNativeView(gained_active) ||
(lost_active &&
message_center_widget ==
views::Widget::GetWidgetForNativeView(lost_active))) {
return; return;
} }
} }
......
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