Commit 901ea08e authored by Tatsuhisa Yamaguchi's avatar Tatsuhisa Yamaguchi Committed by Commit Bot

Make notifications accessible by keyboard when opened by keyboard.


Bug: 637351
Test: manually verified as in the bug
Change-Id: I27c833a2a9514af9b105126d1db2d0adffe358c0
Reviewed-on: https://chromium-review.googlesource.com/1059369
Commit-Queue: Tatsuhisa Yamaguchi <yamaguchi@chromium.org>
Reviewed-by: default avatarTetsui Ohkubo <tetsui@chromium.org>
Reviewed-by: default avatarYoshiki Iguchi <yoshiki@chromium.org>
Reviewed-by: default avatarAhmed Fakhry <afakhry@chromium.org>
Cr-Commit-Position: refs/heads/master@{#561739}
parent be2b4c69
......@@ -422,10 +422,12 @@ void HandleToggleMessageCenterBubble() {
NotificationTray* notification_tray = status_area_widget->notification_tray();
if (!notification_tray->visible())
return;
if (notification_tray->IsMessageCenterVisible())
if (notification_tray->IsMessageCenterVisible()) {
notification_tray->CloseBubble();
else
} else {
notification_tray->ShowBubble(false /* show_by_click */);
notification_tray->ActivateBubble();
}
}
void HandleToggleSystemTrayBubble() {
......
......@@ -649,6 +649,15 @@ void NotificationTray::ShowBubble(bool show_by_click) {
message_center_ui_controller_->ShowMessageCenterBubble(show_by_click);
}
void NotificationTray::ActivateBubble() {
views::TrayBubbleView* bubble_view = GetBubbleView();
// If the bubble is in the process of closing, do not try to activate it.
if (bubble_view->GetWidget()->IsClosed())
return;
bubble_view->set_can_activate(true);
bubble_view->GetWidget()->Activate();
}
views::TrayBubbleView* NotificationTray::GetBubbleView() {
return message_center_bubble_ ? message_center_bubble_->bubble_view()
: nullptr;
......
......@@ -87,6 +87,9 @@ class ASH_EXPORT NotificationTray
void HidePopups() override;
bool ShowNotifierSettings() override;
// Activates the notification tray bubble.
void ActivateBubble();
message_center::MessageCenter* message_center() const;
private:
......
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