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

Side by Side Diff: ash/common/accelerators/accelerator_controller.cc

Issue 2752643002: chromeos: Enable Alt-Shift-S to show system tray bubble for mash (Closed)
Patch Set: Created 3 years, 9 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/common/accelerators/accelerator_controller.h" 5 #include "ash/common/accelerators/accelerator_controller.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "ash/common/accelerators/accelerator_commands.h" 9 #include "ash/common/accelerators/accelerator_commands.h"
10 #include "ash/common/accelerators/accelerator_controller_delegate.h" 10 #include "ash/common/accelerators/accelerator_controller_delegate.h"
(...skipping 10 matching lines...) Expand all
21 #include "ash/common/shelf/shelf_widget.h" 21 #include "ash/common/shelf/shelf_widget.h"
22 #include "ash/common/shelf/wm_shelf.h" 22 #include "ash/common/shelf/wm_shelf.h"
23 #include "ash/common/shell_delegate.h" 23 #include "ash/common/shell_delegate.h"
24 #include "ash/common/system/brightness_control_delegate.h" 24 #include "ash/common/system/brightness_control_delegate.h"
25 #include "ash/common/system/chromeos/ime_menu/ime_menu_tray.h" 25 #include "ash/common/system/chromeos/ime_menu/ime_menu_tray.h"
26 #include "ash/common/system/chromeos/palette/palette_tray.h" 26 #include "ash/common/system/chromeos/palette/palette_tray.h"
27 #include "ash/common/system/chromeos/palette/palette_utils.h" 27 #include "ash/common/system/chromeos/palette/palette_utils.h"
28 #include "ash/common/system/keyboard_brightness_control_delegate.h" 28 #include "ash/common/system/keyboard_brightness_control_delegate.h"
29 #include "ash/common/system/status_area_widget.h" 29 #include "ash/common/system/status_area_widget.h"
30 #include "ash/common/system/system_notifier.h" 30 #include "ash/common/system/system_notifier.h"
31 #include "ash/common/system/tray/system_tray.h"
31 #include "ash/common/system/tray/system_tray_delegate.h" 32 #include "ash/common/system/tray/system_tray_delegate.h"
32 #include "ash/common/system/tray/system_tray_notifier.h" 33 #include "ash/common/system/tray/system_tray_notifier.h"
33 #include "ash/common/system/web_notification/web_notification_tray.h" 34 #include "ash/common/system/web_notification/web_notification_tray.h"
34 #include "ash/common/wm/mru_window_tracker.h" 35 #include "ash/common/wm/mru_window_tracker.h"
35 #include "ash/common/wm/overview/window_selector_controller.h" 36 #include "ash/common/wm/overview/window_selector_controller.h"
36 #include "ash/common/wm/window_cycle_controller.h" 37 #include "ash/common/wm/window_cycle_controller.h"
37 #include "ash/common/wm/window_positioning_utils.h" 38 #include "ash/common/wm/window_positioning_utils.h"
38 #include "ash/common/wm/window_state.h" 39 #include "ash/common/wm/window_state.h"
39 #include "ash/common/wm/wm_event.h" 40 #include "ash/common/wm/wm_event.h"
40 #include "ash/common/wm_shell.h" 41 #include "ash/common/wm_shell.h"
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 StatusAreaWidget* status_area_widget = 226 StatusAreaWidget* status_area_widget =
226 WmShelf::ForWindow(target_root)->shelf_widget()->status_area_widget(); 227 WmShelf::ForWindow(target_root)->shelf_widget()->status_area_widget();
227 if (status_area_widget) { 228 if (status_area_widget) {
228 WebNotificationTray* notification_tray = 229 WebNotificationTray* notification_tray =
229 status_area_widget->web_notification_tray(); 230 status_area_widget->web_notification_tray();
230 if (notification_tray->visible()) 231 if (notification_tray->visible())
231 notification_tray->ShowMessageCenterBubble(); 232 notification_tray->ShowMessageCenterBubble();
232 } 233 }
233 } 234 }
234 235
236 void HandleShowSystemTrayBubble() {
237 base::RecordAction(UserMetricsAction("Accel_Show_System_Tray_Bubble"));
238 WmWindow* target_root = Shell::GetWmRootWindowForNewWindows();
239 SystemTray* tray = target_root->GetRootWindowController()->GetSystemTray();
240 if (!tray->HasSystemBubble()) {
241 tray->ShowDefaultView(BUBBLE_CREATE_NEW);
242 tray->ActivateBubble();
243 }
244 }
245
235 void HandleShowTaskManager() { 246 void HandleShowTaskManager() {
236 base::RecordAction(UserMetricsAction("Accel_Show_Task_Manager")); 247 base::RecordAction(UserMetricsAction("Accel_Show_Task_Manager"));
237 WmShell::Get()->new_window_controller()->ShowTaskManager(); 248 WmShell::Get()->new_window_controller()->ShowTaskManager();
238 } 249 }
239 250
240 bool CanHandleSwitchIme(ImeControlDelegate* ime_control_delegate, 251 bool CanHandleSwitchIme(ImeControlDelegate* ime_control_delegate,
241 const ui::Accelerator& accelerator) { 252 const ui::Accelerator& accelerator) {
242 return ime_control_delegate && 253 return ime_control_delegate &&
243 ime_control_delegate->CanSwitchIme(accelerator); 254 ime_control_delegate->CanSwitchIme(accelerator);
244 } 255 }
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after
832 case NEW_TAB: 843 case NEW_TAB:
833 case NEW_WINDOW: 844 case NEW_WINDOW:
834 case OPEN_CROSH: 845 case OPEN_CROSH:
835 case OPEN_FEEDBACK_PAGE: 846 case OPEN_FEEDBACK_PAGE:
836 case OPEN_FILE_MANAGER: 847 case OPEN_FILE_MANAGER:
837 case OPEN_GET_HELP: 848 case OPEN_GET_HELP:
838 case PRINT_UI_HIERARCHIES: 849 case PRINT_UI_HIERARCHIES:
839 case RESTORE_TAB: 850 case RESTORE_TAB:
840 case SHOW_IME_MENU_BUBBLE: 851 case SHOW_IME_MENU_BUBBLE:
841 case SHOW_KEYBOARD_OVERLAY: 852 case SHOW_KEYBOARD_OVERLAY:
853 case SHOW_SYSTEM_TRAY_BUBBLE:
842 case SHOW_TASK_MANAGER: 854 case SHOW_TASK_MANAGER:
843 case SUSPEND: 855 case SUSPEND:
844 case TOGGLE_FULLSCREEN: 856 case TOGGLE_FULLSCREEN:
845 case TOGGLE_HIGH_CONTRAST: 857 case TOGGLE_HIGH_CONTRAST:
846 case TOGGLE_MAXIMIZED: 858 case TOGGLE_MAXIMIZED:
847 case TOGGLE_OVERVIEW: 859 case TOGGLE_OVERVIEW:
848 case TOGGLE_SPOKEN_FEEDBACK: 860 case TOGGLE_SPOKEN_FEEDBACK:
849 case TOGGLE_WIFI: 861 case TOGGLE_WIFI:
850 case VOLUME_DOWN: 862 case VOLUME_DOWN:
851 case VOLUME_MUTE: 863 case VOLUME_MUTE:
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
1011 break; 1023 break;
1012 case SHOW_KEYBOARD_OVERLAY: 1024 case SHOW_KEYBOARD_OVERLAY:
1013 HandleShowKeyboardOverlay(); 1025 HandleShowKeyboardOverlay();
1014 break; 1026 break;
1015 case SHOW_MESSAGE_CENTER_BUBBLE: 1027 case SHOW_MESSAGE_CENTER_BUBBLE:
1016 HandleShowMessageCenterBubble(); 1028 HandleShowMessageCenterBubble();
1017 break; 1029 break;
1018 case SHOW_STYLUS_TOOLS: 1030 case SHOW_STYLUS_TOOLS:
1019 HandleShowStylusTools(); 1031 HandleShowStylusTools();
1020 break; 1032 break;
1033 case SHOW_SYSTEM_TRAY_BUBBLE:
1034 HandleShowSystemTrayBubble();
1035 break;
1021 case SHOW_TASK_MANAGER: 1036 case SHOW_TASK_MANAGER:
1022 HandleShowTaskManager(); 1037 HandleShowTaskManager();
1023 break; 1038 break;
1024 case SUSPEND: 1039 case SUSPEND:
1025 HandleSuspend(); 1040 HandleSuspend();
1026 break; 1041 break;
1027 case SWITCH_IME: 1042 case SWITCH_IME:
1028 HandleSwitchIme(ime_control_delegate_.get(), accelerator); 1043 HandleSwitchIme(ime_control_delegate_.get(), accelerator);
1029 break; 1044 break;
1030 case SWITCH_TO_NEXT_USER: 1045 case SWITCH_TO_NEXT_USER:
(...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after
1167 data->old_shortcut_id, data->new_shortcut_id); 1182 data->old_shortcut_id, data->new_shortcut_id);
1168 } 1183 }
1169 1184
1170 if (!data->deprecated_enabled) 1185 if (!data->deprecated_enabled)
1171 return AcceleratorProcessingStatus::STOP; 1186 return AcceleratorProcessingStatus::STOP;
1172 1187
1173 return AcceleratorProcessingStatus::PROCEED; 1188 return AcceleratorProcessingStatus::PROCEED;
1174 } 1189 }
1175 1190
1176 } // namespace ash 1191 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698