Commit 382a5c03 authored by Tetsui Ohkubo's avatar Tetsui Ohkubo Committed by Commit Bot

Re-enable Alt-Shift-N for UnifiedSystemTray.

Alt-Shift-N was disabled for UnifiedSystemTray. Because we have
Alt-Shift-S. https://crrev.com/c/1023500

In response to feedback, the expected behavior of Alt-Shift-N is
changed, and now it does the same action as Alt-Shift-S.

TEST=manual
BUG=none

Change-Id: I8314e8205512d70c095b7ca45839f386e7a8fea7
Reviewed-on: https://chromium-review.googlesource.com/1147780Reviewed-by: default avatarYoshiki Iguchi <yoshiki@chromium.org>
Reviewed-by: default avatarJames Cook <jamescook@chromium.org>
Commit-Queue: Tetsui Ohkubo <tetsui@chromium.org>
Cr-Commit-Position: refs/heads/master@{#578961}
parent 91d29692
...@@ -413,7 +413,7 @@ void HandleTakeScreenshot() { ...@@ -413,7 +413,7 @@ void HandleTakeScreenshot() {
bool CanHandleToggleMessageCenterBubble() { bool CanHandleToggleMessageCenterBubble() {
if (features::IsSystemTrayUnifiedEnabled()) if (features::IsSystemTrayUnifiedEnabled())
return false; return true;
aura::Window* target_root = Shell::GetRootWindowForNewWindows(); aura::Window* target_root = Shell::GetRootWindowForNewWindows();
StatusAreaWidget* status_area_widget = StatusAreaWidget* status_area_widget =
Shelf::ForWindow(target_root)->shelf_widget()->status_area_widget(); Shelf::ForWindow(target_root)->shelf_widget()->status_area_widget();
...@@ -421,24 +421,6 @@ bool CanHandleToggleMessageCenterBubble() { ...@@ -421,24 +421,6 @@ bool CanHandleToggleMessageCenterBubble() {
status_area_widget->notification_tray()->visible(); status_area_widget->notification_tray()->visible();
} }
void HandleToggleMessageCenterBubble() {
base::RecordAction(UserMetricsAction("Accel_Toggle_Message_Center_Bubble"));
aura::Window* target_root = Shell::GetRootWindowForNewWindows();
StatusAreaWidget* status_area_widget =
Shelf::ForWindow(target_root)->shelf_widget()->status_area_widget();
if (!status_area_widget)
return;
NotificationTray* notification_tray = status_area_widget->notification_tray();
if (!notification_tray->visible())
return;
if (notification_tray->IsMessageCenterVisible()) {
notification_tray->CloseBubble();
} else {
notification_tray->ShowBubble(false /* show_by_click */);
notification_tray->ActivateBubble();
}
}
void HandleToggleSystemTrayBubble() { void HandleToggleSystemTrayBubble() {
base::RecordAction(UserMetricsAction("Accel_Toggle_System_Tray_Bubble")); base::RecordAction(UserMetricsAction("Accel_Toggle_System_Tray_Bubble"));
aura::Window* target_root = Shell::GetRootWindowForNewWindows(); aura::Window* target_root = Shell::GetRootWindowForNewWindows();
...@@ -464,6 +446,28 @@ void HandleToggleSystemTrayBubble() { ...@@ -464,6 +446,28 @@ void HandleToggleSystemTrayBubble() {
} }
} }
void HandleToggleMessageCenterBubble() {
base::RecordAction(UserMetricsAction("Accel_Toggle_Message_Center_Bubble"));
if (features::IsSystemTrayUnifiedEnabled()) {
HandleToggleSystemTrayBubble();
return;
}
aura::Window* target_root = Shell::GetRootWindowForNewWindows();
StatusAreaWidget* status_area_widget =
Shelf::ForWindow(target_root)->shelf_widget()->status_area_widget();
if (!status_area_widget)
return;
NotificationTray* notification_tray = status_area_widget->notification_tray();
if (!notification_tray->visible())
return;
if (notification_tray->IsMessageCenterVisible()) {
notification_tray->CloseBubble();
} else {
notification_tray->ShowBubble(false /* show_by_click */);
notification_tray->ActivateBubble();
}
}
void HandleShowTaskManager() { void HandleShowTaskManager() {
base::RecordAction(UserMetricsAction("Accel_Show_Task_Manager")); base::RecordAction(UserMetricsAction("Accel_Show_Task_Manager"));
Shell::Get()->new_window_controller()->ShowTaskManager(); Shell::Get()->new_window_controller()->ShowTaskManager();
......
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