Commit 418f4c4e authored by Ahmed Mehfooz's avatar Ahmed Mehfooz Committed by Commit Bot

Revert "Fix message center crash"

This reverts commit d680737d.

Reason for revert: Causes a different crash in return for fixing one.

Original change's description:
> 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: Tim Song <tengs@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#705749}

TBR=tengs@chromium.org,amehfooz@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Change-Id: Ie38a91a9c3ef177425b461ec6b42822d0c0c5bdb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1865657Reviewed-by: default avatarAhmed Mehfooz <amehfooz@chromium.org>
Commit-Queue: Ahmed Mehfooz <amehfooz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#706680}
parent f054cdf3
...@@ -316,9 +316,15 @@ void UnifiedSystemTrayBubble::OnWindowActivated(ActivationReason reason, ...@@ -316,9 +316,15 @@ 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() &&
if (GetContainerForWindow(gained_active) == tray_->IsMessageCenterBubbleShown()) {
GetContainerForWindow(lost_active)) { 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))) {
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