Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(12)

Unified Diff: ash/common/accelerators/accelerator_controller.cc

Issue 2304443002: ash: Move ShelfWidget ownership to WmShelf and refactor access to it (Closed)
Patch Set: review comments Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/aura/wm_shelf_aura.cc ('k') | ash/common/shelf/shelf_widget.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/accelerators/accelerator_controller.cc
diff --git a/ash/common/accelerators/accelerator_controller.cc b/ash/common/accelerators/accelerator_controller.cc
index bd150611ab1a0f3f5772595acc9fbdef46af9241..339f230e8ff8e04918a09c55c55f27ca8877195b 100644
--- a/ash/common/accelerators/accelerator_controller.cc
+++ b/ash/common/accelerators/accelerator_controller.cc
@@ -24,6 +24,7 @@
#include "ash/common/system/tray/system_tray_delegate.h"
#include "ash/common/system/tray/system_tray_notifier.h"
#include "ash/common/system/volume_control_delegate.h"
+#include "ash/common/system/web_notification/web_notification_tray.h"
#include "ash/common/wm/mru_window_tracker.h"
#include "ash/common/wm/overview/window_selector_controller.h"
#include "ash/common/wm/window_cycle_controller.h"
@@ -221,6 +222,27 @@ void HandleShowKeyboardOverlay() {
WmShell::Get()->new_window_delegate()->ShowKeyboardOverlay();
}
+bool CanHandleShowMessageCenterBubble() {
+ WmWindow* target_root = WmShell::Get()->GetRootWindowForNewWindows();
+ StatusAreaWidget* status_area_widget =
+ WmShelf::ForWindow(target_root)->shelf_widget()->status_area_widget();
+ return status_area_widget &&
+ status_area_widget->web_notification_tray()->visible();
+}
+
+void HandleShowMessageCenterBubble() {
+ base::RecordAction(UserMetricsAction("Accel_Show_Message_Center_Bubble"));
+ WmWindow* target_root = WmShell::Get()->GetRootWindowForNewWindows();
+ StatusAreaWidget* status_area_widget =
+ WmShelf::ForWindow(target_root)->shelf_widget()->status_area_widget();
+ if (status_area_widget) {
+ WebNotificationTray* notification_tray =
+ status_area_widget->web_notification_tray();
+ if (notification_tray->visible())
+ notification_tray->ShowMessageCenterBubble();
+ }
+}
+
void HandleShowTaskManager() {
base::RecordAction(UserMetricsAction("Accel_Show_Task_Manager"));
WmShell::Get()->new_window_delegate()->ShowTaskManager();
@@ -729,6 +751,8 @@ bool AcceleratorController::CanPerformAction(
return CanHandleNextIme(ime_control_delegate_.get());
case PREVIOUS_IME:
return CanHandlePreviousIme(ime_control_delegate_.get());
+ case SHOW_MESSAGE_CENTER_BUBBLE:
+ return CanHandleShowMessageCenterBubble();
case SWITCH_IME:
return CanHandleSwitchIme(ime_control_delegate_.get(), accelerator);
case TOGGLE_APP_LIST:
@@ -910,6 +934,9 @@ void AcceleratorController::PerformAction(AcceleratorAction action,
case SHOW_KEYBOARD_OVERLAY:
HandleShowKeyboardOverlay();
break;
+ case SHOW_MESSAGE_CENTER_BUBBLE:
+ HandleShowMessageCenterBubble();
+ break;
case SHOW_TASK_MANAGER:
HandleShowTaskManager();
break;
« no previous file with comments | « ash/aura/wm_shelf_aura.cc ('k') | ash/common/shelf/shelf_widget.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698