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 "ash/accelerators/accelerator_table.h" | 7 #include "ash/accelerators/accelerator_table.h" |
8 #include "ash/desktop_background/desktop_background_controller.h" | 8 #include "ash/desktop_background/desktop_background_controller.h" |
9 #include "ash/ash_switches.h" | 9 #include "ash/ash_switches.h" |
10 #include "ash/caps_lock_delegate.h" | 10 #include "ash/caps_lock_delegate.h" |
11 #include "ash/focus_cycler.h" | 11 #include "ash/focus_cycler.h" |
12 #include "ash/ime_control_delegate.h" | 12 #include "ash/ime_control_delegate.h" |
13 #include "ash/launcher/launcher.h" | 13 #include "ash/launcher/launcher.h" |
14 #include "ash/launcher/launcher_model.h" | 14 #include "ash/launcher/launcher_model.h" |
15 #include "ash/launcher/launcher_delegate.h" | 15 #include "ash/launcher/launcher_delegate.h" |
16 #include "ash/monitor/multi_monitor_manager.h" | 16 #include "ash/monitor/multi_monitor_manager.h" |
17 #include "ash/screenshot_delegate.h" | 17 #include "ash/screenshot_delegate.h" |
18 #include "ash/shell.h" | 18 #include "ash/shell.h" |
19 #include "ash/shell_delegate.h" | 19 #include "ash/shell_delegate.h" |
20 #include "ash/shell_window_ids.h" | 20 #include "ash/shell_window_ids.h" |
21 #include "ash/system/brightness/brightness_control_delegate.h" | 21 #include "ash/system/brightness/brightness_control_delegate.h" |
22 #include "ash/system/tray/system_tray.h" | 22 #include "ash/system/tray/system_tray.h" |
23 #include "ash/volume_control_delegate.h" | 23 #include "ash/volume_control_delegate.h" |
24 #include "ash/wm/property_util.h" | |
25 #include "ash/wm/window_cycle_controller.h" | 24 #include "ash/wm/window_cycle_controller.h" |
26 #include "ash/wm/window_util.h" | 25 #include "ash/wm/window_util.h" |
27 #include "ash/wm/workspace/snap_sizer.h" | |
28 #include "base/command_line.h" | 26 #include "base/command_line.h" |
29 #include "ui/aura/event.h" | 27 #include "ui/aura/event.h" |
30 #include "ui/aura/root_window.h" | 28 #include "ui/aura/root_window.h" |
31 #include "ui/base/accelerators/accelerator.h" | 29 #include "ui/base/accelerators/accelerator.h" |
32 #include "ui/base/accelerators/accelerator_manager.h" | 30 #include "ui/base/accelerators/accelerator_manager.h" |
33 #include "ui/gfx/compositor/debug_utils.h" | 31 #include "ui/gfx/compositor/debug_utils.h" |
34 #include "ui/gfx/compositor/layer.h" | 32 #include "ui/gfx/compositor/layer.h" |
35 #include "ui/gfx/compositor/layer_animation_sequence.h" | 33 #include "ui/gfx/compositor/layer_animation_sequence.h" |
36 #include "ui/gfx/compositor/layer_animator.h" | 34 #include "ui/gfx/compositor/layer_animator.h" |
37 #include "ui/gfx/compositor/screen_rotation.h" | 35 #include "ui/gfx/compositor/screen_rotation.h" |
(...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
447 break; | 445 break; |
448 case SELECT_WIN_6: | 446 case SELECT_WIN_6: |
449 SwitchToWindow(6); | 447 SwitchToWindow(6); |
450 break; | 448 break; |
451 case SELECT_WIN_7: | 449 case SELECT_WIN_7: |
452 SwitchToWindow(7); | 450 SwitchToWindow(7); |
453 break; | 451 break; |
454 case SELECT_LAST_WIN: | 452 case SELECT_LAST_WIN: |
455 SwitchToWindow(-1); | 453 SwitchToWindow(-1); |
456 break; | 454 break; |
457 case WINDOW_SNAP_LEFT: | |
458 case WINDOW_SNAP_RIGHT: { | |
459 aura::Window* window = wm::GetActiveWindow(); | |
460 if (!window) | |
461 break; | |
462 internal::SnapSizer sizer(window, | |
463 gfx::Point(), | |
464 action == WINDOW_SNAP_LEFT ? internal::SnapSizer::LEFT_EDGE : | |
465 internal::SnapSizer::RIGHT_EDGE, | |
466 shell->GetGridSize()); | |
467 window->SetBounds(sizer.GetSnapBounds(window->bounds())); | |
468 break; | |
469 } | |
470 case WINDOW_MINIMIZE: { | |
471 aura::Window* window = wm::GetActiveWindow(); | |
472 if (window) | |
473 wm::MinimizeWindow(window); | |
474 break; | |
475 } | |
476 case WINDOW_MAXIMIZE_RESTORE: { | |
477 aura::Window* window = wm::GetActiveWindow(); | |
478 if (window) { | |
479 if (wm::IsWindowMaximized(window)) | |
480 wm::RestoreWindow(window); | |
481 else | |
482 wm::MaximizeWindow(window); | |
483 } | |
484 break; | |
485 } | |
486 case WINDOW_POSITION_CENTER: { | |
487 aura::Window* window = wm::GetActiveWindow(); | |
488 if (window) | |
489 wm::CenterWindow(window); | |
490 break; | |
491 } | |
492 case ROTATE_WINDOWS: | 455 case ROTATE_WINDOWS: |
493 return HandleRotateWindows(); | 456 return HandleRotateWindows(); |
494 #if !defined(NDEBUG) | 457 #if !defined(NDEBUG) |
495 case ROTATE_SCREEN: | 458 case ROTATE_SCREEN: |
496 return HandleRotateScreen(); | 459 return HandleRotateScreen(); |
497 case TOGGLE_DESKTOP_BACKGROUND_MODE: | 460 case TOGGLE_DESKTOP_BACKGROUND_MODE: |
498 return HandleToggleDesktopBackgroundMode(); | 461 return HandleToggleDesktopBackgroundMode(); |
499 case TOGGLE_ROOT_WINDOW_FULL_SCREEN: | 462 case TOGGLE_ROOT_WINDOW_FULL_SCREEN: |
500 return HandleToggleRootWindowFullScreen(); | 463 return HandleToggleRootWindowFullScreen(); |
501 case PRINT_LAYER_HIERARCHY: | 464 case PRINT_LAYER_HIERARCHY: |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
541 // Then set this one as active. | 504 // Then set this one as active. |
542 ActivateLauncherItem(found_index); | 505 ActivateLauncherItem(found_index); |
543 } | 506 } |
544 } | 507 } |
545 | 508 |
546 bool AcceleratorController::CanHandleAccelerators() const { | 509 bool AcceleratorController::CanHandleAccelerators() const { |
547 return true; | 510 return true; |
548 } | 511 } |
549 | 512 |
550 } // namespace ash | 513 } // namespace ash |
OLD | NEW |