Commit 014461c9 authored by Ahmed Mehfooz's avatar Ahmed Mehfooz Committed by Commit Bot

Transfer focus from Message Center when it becomes invisible

Bug: 1009523
Change-Id: Ie52edb90f65e4a90007c18be2a3051fc351fb040
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2018184
Commit-Queue: Ahmed Mehfooz <amehfooz@chromium.org>
Reviewed-by: default avatarTim Song <tengs@chromium.org>
Cr-Commit-Position: refs/heads/master@{#735110}
parent 301e9c70
......@@ -394,12 +394,17 @@ void UnifiedMessageCenterView::UpdateVisibility() {
(!session_controller->IsScreenLocked() ||
AshMessageCenterLockScreenController::IsEnabled()));
// When notification list went invisible, the last notification should be
// targeted next time.
if (!GetVisible()) {
// When notification list went invisible, the last notification should be
// targeted next time.
model_->set_notification_target_mode(
UnifiedSystemTrayModel::NotificationTargetMode::LAST_NOTIFICATION);
NotifyRectBelowScroll();
// Transfer focus to quick settings when going invisible.
auto* widget = GetWidget();
if (widget && widget->IsActive())
FocusOut(false);
}
}
......@@ -507,7 +512,8 @@ void UnifiedMessageCenterView::NotifyRectBelowScroll() {
}
void UnifiedMessageCenterView::FocusOut(bool reverse) {
message_center_bubble_->FocusOut(reverse);
if (message_center_bubble_)
message_center_bubble_->FocusOut(reverse);
}
void UnifiedMessageCenterView::FocusEntered(bool reverse) {
......
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