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 <algorithm> | 7 #include <algorithm> |
8 #include <cmath> | 8 #include <cmath> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
460 if (key_code == ui::VKEY_TAB && shell->delegate()) | 460 if (key_code == ui::VKEY_TAB && shell->delegate()) |
461 shell->delegate()->RecordUserMetricsAction(UMA_ACCEL_PREVWINDOW_TAB); | 461 shell->delegate()->RecordUserMetricsAction(UMA_ACCEL_PREVWINDOW_TAB); |
462 return HandleCycleWindowMRU(WindowCycleController::BACKWARD, | 462 return HandleCycleWindowMRU(WindowCycleController::BACKWARD, |
463 accelerator.IsAltDown()); | 463 accelerator.IsAltDown()); |
464 case CYCLE_FORWARD_MRU: | 464 case CYCLE_FORWARD_MRU: |
465 if (key_code == ui::VKEY_TAB && shell->delegate()) | 465 if (key_code == ui::VKEY_TAB && shell->delegate()) |
466 shell->delegate()->RecordUserMetricsAction(UMA_ACCEL_NEXTWINDOW_TAB); | 466 shell->delegate()->RecordUserMetricsAction(UMA_ACCEL_NEXTWINDOW_TAB); |
467 return HandleCycleWindowMRU(WindowCycleController::FORWARD, | 467 return HandleCycleWindowMRU(WindowCycleController::FORWARD, |
468 accelerator.IsAltDown()); | 468 accelerator.IsAltDown()); |
469 case CYCLE_BACKWARD_LINEAR: | 469 case CYCLE_BACKWARD_LINEAR: |
470 if (key_code == ui::VKEY_F5 && shell->delegate()) | 470 if (key_code == ui::VKEY_MEDIA_LAUNCH_APP1 && shell->delegate()) |
471 shell->delegate()->RecordUserMetricsAction(UMA_ACCEL_PREVWINDOW_F5); | 471 shell->delegate()->RecordUserMetricsAction(UMA_ACCEL_PREVWINDOW_F5); |
472 HandleCycleWindowLinear(CYCLE_BACKWARD); | 472 HandleCycleWindowLinear(CYCLE_BACKWARD); |
473 return true; | 473 return true; |
474 case CYCLE_FORWARD_LINEAR: | 474 case CYCLE_FORWARD_LINEAR: |
475 if (key_code == ui::VKEY_F5 && shell->delegate()) | 475 if (key_code == ui::VKEY_MEDIA_LAUNCH_APP1 && shell->delegate()) |
476 shell->delegate()->RecordUserMetricsAction(UMA_ACCEL_NEXTWINDOW_F5); | 476 shell->delegate()->RecordUserMetricsAction(UMA_ACCEL_NEXTWINDOW_F5); |
477 HandleCycleWindowLinear(CYCLE_FORWARD); | 477 HandleCycleWindowLinear(CYCLE_FORWARD); |
478 return true; | 478 return true; |
479 #if defined(OS_CHROMEOS) | 479 #if defined(OS_CHROMEOS) |
480 case CYCLE_DISPLAY_MODE: | 480 case CYCLE_DISPLAY_MODE: |
481 HandleCycleDisplayMode(); | 481 HandleCycleDisplayMode(); |
482 return true; | 482 return true; |
483 case LOCK_SCREEN: | 483 case LOCK_SCREEN: |
484 return HandleLock(); | 484 return HandleLock(); |
485 case OPEN_FILE_MANAGER_DIALOG: | 485 case OPEN_FILE_MANAGER_DIALOG: |
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
741 // Disable the shortcut for minimizing full screen window due to | 741 // Disable the shortcut for minimizing full screen window due to |
742 // crbug.com/131709, which is a crashing issue related to minimizing | 742 // crbug.com/131709, which is a crashing issue related to minimizing |
743 // full screen pepper window. | 743 // full screen pepper window. |
744 if (!wm::IsWindowFullscreen(window)) { | 744 if (!wm::IsWindowFullscreen(window)) { |
745 wm::MinimizeWindow(window); | 745 wm::MinimizeWindow(window); |
746 return true; | 746 return true; |
747 } | 747 } |
748 break; | 748 break; |
749 } | 749 } |
750 case TOGGLE_MAXIMIZED: { | 750 case TOGGLE_MAXIMIZED: { |
751 if (key_code == ui::VKEY_F4 && shell->delegate()) { | 751 if (key_code == ui::VKEY_MEDIA_LAUNCH_APP2 && shell->delegate()) { |
752 shell->delegate()->RecordUserMetricsAction( | 752 shell->delegate()->RecordUserMetricsAction( |
753 UMA_ACCEL_MAXIMIZE_RESTORE_F4); | 753 UMA_ACCEL_MAXIMIZE_RESTORE_F4); |
754 } | 754 } |
755 shell->delegate()->ToggleMaximized(); | 755 shell->delegate()->ToggleMaximized(); |
756 return true; | 756 return true; |
757 } | 757 } |
758 case WINDOW_POSITION_CENTER: { | 758 case WINDOW_POSITION_CENTER: { |
759 aura::Window* window = wm::GetActiveWindow(); | 759 aura::Window* window = wm::GetActiveWindow(); |
760 if (window) { | 760 if (window) { |
761 wm::CenterWindow(window); | 761 wm::CenterWindow(window); |
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
894 keyboard_brightness_control_delegate) { | 894 keyboard_brightness_control_delegate) { |
895 keyboard_brightness_control_delegate_ = | 895 keyboard_brightness_control_delegate_ = |
896 keyboard_brightness_control_delegate.Pass(); | 896 keyboard_brightness_control_delegate.Pass(); |
897 } | 897 } |
898 | 898 |
899 bool AcceleratorController::CanHandleAccelerators() const { | 899 bool AcceleratorController::CanHandleAccelerators() const { |
900 return true; | 900 return true; |
901 } | 901 } |
902 | 902 |
903 } // namespace ash | 903 } // namespace ash |
OLD | NEW |