OLD | NEW |
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/accelerators/accelerator_controller.h" | 5 #include "ash/accelerators/accelerator_controller.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "ash/accelerators/accelerator_commands.h" | 9 #include "ash/accelerators/accelerator_commands.h" |
10 #include "ash/accelerators/accelerator_controller_delegate.h" | 10 #include "ash/accelerators/accelerator_controller_delegate.h" |
11 #include "ash/accelerators/debug_commands.h" | 11 #include "ash/accelerators/debug_commands.h" |
12 #include "ash/accessibility_delegate.h" | 12 #include "ash/accessibility_delegate.h" |
13 #include "ash/accessibility_types.h" | 13 #include "ash/accessibility_types.h" |
14 #include "ash/focus_cycler.h" | 14 #include "ash/focus_cycler.h" |
15 #include "ash/ime_control_delegate.h" | 15 #include "ash/ime_control_delegate.h" |
16 #include "ash/media_controller.h" | 16 #include "ash/media_controller.h" |
17 #include "ash/multi_profile_uma.h" | 17 #include "ash/multi_profile_uma.h" |
18 #include "ash/new_window_controller.h" | 18 #include "ash/new_window_controller.h" |
19 #include "ash/resources/vector_icons/vector_icons.h" | 19 #include "ash/resources/vector_icons/vector_icons.h" |
20 #include "ash/root_window_controller.h" | 20 #include "ash/root_window_controller.h" |
21 #include "ash/rotator/window_rotation.h" | 21 #include "ash/rotator/window_rotation.h" |
22 #include "ash/session/session_controller.h" | 22 #include "ash/session/session_controller.h" |
| 23 #include "ash/shelf/shelf.h" |
23 #include "ash/shelf/shelf_widget.h" | 24 #include "ash/shelf/shelf_widget.h" |
24 #include "ash/shelf/wm_shelf.h" | |
25 #include "ash/shell.h" | 25 #include "ash/shell.h" |
26 #include "ash/shell_delegate.h" | 26 #include "ash/shell_delegate.h" |
27 #include "ash/shell_port.h" | 27 #include "ash/shell_port.h" |
28 #include "ash/strings/grit/ash_strings.h" | 28 #include "ash/strings/grit/ash_strings.h" |
29 #include "ash/system/brightness_control_delegate.h" | 29 #include "ash/system/brightness_control_delegate.h" |
30 #include "ash/system/ime_menu/ime_menu_tray.h" | 30 #include "ash/system/ime_menu/ime_menu_tray.h" |
31 #include "ash/system/keyboard_brightness_control_delegate.h" | 31 #include "ash/system/keyboard_brightness_control_delegate.h" |
32 #include "ash/system/palette/palette_tray.h" | 32 #include "ash/system/palette/palette_tray.h" |
33 #include "ash/system/palette/palette_utils.h" | 33 #include "ash/system/palette/palette_utils.h" |
34 #include "ash/system/status_area_widget.h" | 34 #include "ash/system/status_area_widget.h" |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 base::RecordAction(UserMetricsAction("Accel_Focus_Previous_Pane")); | 198 base::RecordAction(UserMetricsAction("Accel_Focus_Previous_Pane")); |
199 break; | 199 break; |
200 } | 200 } |
201 } | 201 } |
202 Shell::Get()->focus_cycler()->RotateFocus(direction); | 202 Shell::Get()->focus_cycler()->RotateFocus(direction); |
203 } | 203 } |
204 | 204 |
205 void HandleFocusShelf() { | 205 void HandleFocusShelf() { |
206 base::RecordAction(UserMetricsAction("Accel_Focus_Shelf")); | 206 base::RecordAction(UserMetricsAction("Accel_Focus_Shelf")); |
207 // TODO(jamescook): Should this be GetRootWindowForNewWindows()? | 207 // TODO(jamescook): Should this be GetRootWindowForNewWindows()? |
208 WmShelf* shelf = WmShelf::ForWindow(Shell::GetPrimaryRootWindow()); | 208 Shelf* shelf = Shelf::ForWindow(Shell::GetPrimaryRootWindow()); |
209 Shell::Get()->focus_cycler()->FocusWidget(shelf->shelf_widget()); | 209 Shell::Get()->focus_cycler()->FocusWidget(shelf->shelf_widget()); |
210 } | 210 } |
211 | 211 |
212 void HandleLaunchAppN(int n) { | 212 void HandleLaunchAppN(int n) { |
213 base::RecordAction(UserMetricsAction("Accel_Launch_App")); | 213 base::RecordAction(UserMetricsAction("Accel_Launch_App")); |
214 WmShelf::LaunchShelfItem(n); | 214 Shelf::LaunchShelfItem(n); |
215 } | 215 } |
216 | 216 |
217 void HandleLaunchLastApp() { | 217 void HandleLaunchLastApp() { |
218 base::RecordAction(UserMetricsAction("Accel_Launch_Last_App")); | 218 base::RecordAction(UserMetricsAction("Accel_Launch_Last_App")); |
219 WmShelf::LaunchShelfItem(-1); | 219 Shelf::LaunchShelfItem(-1); |
220 } | 220 } |
221 | 221 |
222 void HandleMediaNextTrack() { | 222 void HandleMediaNextTrack() { |
223 Shell::Get()->media_controller()->HandleMediaNextTrack(); | 223 Shell::Get()->media_controller()->HandleMediaNextTrack(); |
224 } | 224 } |
225 | 225 |
226 void HandleMediaPlayPause() { | 226 void HandleMediaPlayPause() { |
227 Shell::Get()->media_controller()->HandleMediaPlayPause(); | 227 Shell::Get()->media_controller()->HandleMediaPlayPause(); |
228 } | 228 } |
229 | 229 |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 } | 312 } |
313 | 313 |
314 void HandleShowKeyboardOverlay() { | 314 void HandleShowKeyboardOverlay() { |
315 base::RecordAction(UserMetricsAction("Accel_Show_Keyboard_Overlay")); | 315 base::RecordAction(UserMetricsAction("Accel_Show_Keyboard_Overlay")); |
316 Shell::Get()->new_window_controller()->ShowKeyboardOverlay(); | 316 Shell::Get()->new_window_controller()->ShowKeyboardOverlay(); |
317 } | 317 } |
318 | 318 |
319 bool CanHandleShowMessageCenterBubble() { | 319 bool CanHandleShowMessageCenterBubble() { |
320 aura::Window* target_root = Shell::GetRootWindowForNewWindows(); | 320 aura::Window* target_root = Shell::GetRootWindowForNewWindows(); |
321 StatusAreaWidget* status_area_widget = | 321 StatusAreaWidget* status_area_widget = |
322 WmShelf::ForWindow(target_root)->shelf_widget()->status_area_widget(); | 322 Shelf::ForWindow(target_root)->shelf_widget()->status_area_widget(); |
323 return status_area_widget && | 323 return status_area_widget && |
324 status_area_widget->web_notification_tray()->visible(); | 324 status_area_widget->web_notification_tray()->visible(); |
325 } | 325 } |
326 | 326 |
327 void HandleShowMessageCenterBubble() { | 327 void HandleShowMessageCenterBubble() { |
328 base::RecordAction(UserMetricsAction("Accel_Show_Message_Center_Bubble")); | 328 base::RecordAction(UserMetricsAction("Accel_Show_Message_Center_Bubble")); |
329 aura::Window* target_root = Shell::GetRootWindowForNewWindows(); | 329 aura::Window* target_root = Shell::GetRootWindowForNewWindows(); |
330 StatusAreaWidget* status_area_widget = | 330 StatusAreaWidget* status_area_widget = |
331 WmShelf::ForWindow(target_root)->shelf_widget()->status_area_widget(); | 331 Shelf::ForWindow(target_root)->shelf_widget()->status_area_widget(); |
332 if (status_area_widget) { | 332 if (status_area_widget) { |
333 WebNotificationTray* notification_tray = | 333 WebNotificationTray* notification_tray = |
334 status_area_widget->web_notification_tray(); | 334 status_area_widget->web_notification_tray(); |
335 if (notification_tray->visible()) | 335 if (notification_tray->visible()) |
336 notification_tray->ShowMessageCenterBubble(); | 336 notification_tray->ShowMessageCenterBubble(); |
337 } | 337 } |
338 } | 338 } |
339 | 339 |
340 void HandleShowSystemTrayBubble() { | 340 void HandleShowSystemTrayBubble() { |
341 base::RecordAction(UserMetricsAction("Accel_Show_System_Tray_Bubble")); | 341 base::RecordAction(UserMetricsAction("Accel_Show_System_Tray_Bubble")); |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
438 | 438 |
439 void HandlePositionCenter() { | 439 void HandlePositionCenter() { |
440 base::RecordAction(UserMetricsAction("Accel_Window_Position_Center")); | 440 base::RecordAction(UserMetricsAction("Accel_Window_Position_Center")); |
441 wm::CenterWindow(WmWindow::Get(wm::GetActiveWindow())); | 441 wm::CenterWindow(WmWindow::Get(wm::GetActiveWindow())); |
442 } | 442 } |
443 | 443 |
444 void HandleShowImeMenuBubble() { | 444 void HandleShowImeMenuBubble() { |
445 base::RecordAction(UserMetricsAction("Accel_Show_Ime_Menu_Bubble")); | 445 base::RecordAction(UserMetricsAction("Accel_Show_Ime_Menu_Bubble")); |
446 | 446 |
447 StatusAreaWidget* status_area_widget = | 447 StatusAreaWidget* status_area_widget = |
448 WmShelf::ForWindow(Shell::GetPrimaryRootWindow())->GetStatusAreaWidget(); | 448 Shelf::ForWindow(Shell::GetPrimaryRootWindow())->GetStatusAreaWidget(); |
449 if (status_area_widget) { | 449 if (status_area_widget) { |
450 ImeMenuTray* ime_menu_tray = status_area_widget->ime_menu_tray(); | 450 ImeMenuTray* ime_menu_tray = status_area_widget->ime_menu_tray(); |
451 if (ime_menu_tray && ime_menu_tray->visible() && | 451 if (ime_menu_tray && ime_menu_tray->visible() && |
452 !ime_menu_tray->IsImeMenuBubbleShown()) { | 452 !ime_menu_tray->IsImeMenuBubbleShown()) { |
453 ime_menu_tray->ShowImeMenuBubble(); | 453 ime_menu_tray->ShowImeMenuBubble(); |
454 } | 454 } |
455 } | 455 } |
456 } | 456 } |
457 | 457 |
458 void HandleCrosh() { | 458 void HandleCrosh() { |
(...skipping 838 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1297 data->uma_histogram_name, data->notification_message_id, | 1297 data->uma_histogram_name, data->notification_message_id, |
1298 data->old_shortcut_id, data->new_shortcut_id); | 1298 data->old_shortcut_id, data->new_shortcut_id); |
1299 | 1299 |
1300 if (!data->deprecated_enabled) | 1300 if (!data->deprecated_enabled) |
1301 return AcceleratorProcessingStatus::STOP; | 1301 return AcceleratorProcessingStatus::STOP; |
1302 | 1302 |
1303 return AcceleratorProcessingStatus::PROCEED; | 1303 return AcceleratorProcessingStatus::PROCEED; |
1304 } | 1304 } |
1305 | 1305 |
1306 } // namespace ash | 1306 } // namespace ash |
OLD | NEW |