Commit 72af3a05 authored by Ahmed Mehfooz's avatar Ahmed Mehfooz Committed by Commit Bot

Only advance focus to first notification if notification bar is visible

If notification bar isn't visible the focus is already on the first
notification.

Change-Id: Ibc707d40687b601598258b8f318321520f16eeaa
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1974706Reviewed-by: default avatarTim Song <tengs@chromium.org>
Commit-Queue: Ahmed Mehfooz <amehfooz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#726514}
parent 6d79d0c5
......@@ -179,7 +179,9 @@ bool UnifiedMessageCenterBubble::FocusOut(bool reverse) {
}
void UnifiedMessageCenterBubble::FocusFirstNotification() {
message_center_view_->GetFocusManager()->AdvanceFocus(false /*reverse*/);
// Move focus to first notification from notification bar if it is visible.
if (message_center_view_->IsNotificationBarVisible())
message_center_view_->GetFocusManager()->AdvanceFocus(false /*reverse*/);
}
bool UnifiedMessageCenterBubble::IsMessageCenterVisible() {
......
......@@ -157,6 +157,10 @@ void UnifiedMessageCenterView::ExpandMessageCenter() {
message_center_bubble_->ExpandMessageCenter();
}
bool UnifiedMessageCenterView::IsNotificationBarVisible() {
return notification_bar_->GetVisible();
}
void UnifiedMessageCenterView::OnNotificationSlidOut() {
if (notification_bar_->GetVisible() &&
message_list_view_->GetTotalNotificationCount() <= 1) {
......
......@@ -111,6 +111,9 @@ class ASH_EXPORT UnifiedMessageCenterView
// Called when user clicks the see all notifications button.
void ExpandMessageCenter();
// Returns true if the notification bar is visible.
bool IsNotificationBarVisible();
// views::View:
void AddedToWidget() override;
void RemovedFromWidget() override;
......
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