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

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

Issue 11417144: Use rewriting to make ChromeOS keyboard F<number> keys produce extended keycodes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: static const Created 8 years 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 | Annotate | Revision Log
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/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
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 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
724 // Disable the shortcut for minimizing full screen window due to 724 // Disable the shortcut for minimizing full screen window due to
725 // crbug.com/131709, which is a crashing issue related to minimizing 725 // crbug.com/131709, which is a crashing issue related to minimizing
726 // full screen pepper window. 726 // full screen pepper window.
727 if (!wm::IsWindowFullscreen(window)) { 727 if (!wm::IsWindowFullscreen(window)) {
728 wm::MinimizeWindow(window); 728 wm::MinimizeWindow(window);
729 return true; 729 return true;
730 } 730 }
731 break; 731 break;
732 } 732 }
733 case TOGGLE_MAXIMIZED: { 733 case TOGGLE_MAXIMIZED: {
734 if (key_code == ui::VKEY_F4 && shell->delegate()) { 734 if (key_code == ui::VKEY_MEDIA_LAUNCH_APP2 && shell->delegate()) {
735 shell->delegate()->RecordUserMetricsAction( 735 shell->delegate()->RecordUserMetricsAction(
736 UMA_ACCEL_MAXIMIZE_RESTORE_F4); 736 UMA_ACCEL_MAXIMIZE_RESTORE_F4);
737 } 737 }
738 shell->delegate()->ToggleMaximized(); 738 shell->delegate()->ToggleMaximized();
739 return true; 739 return true;
740 } 740 }
741 case WINDOW_POSITION_CENTER: { 741 case WINDOW_POSITION_CENTER: {
742 aura::Window* window = wm::GetActiveWindow(); 742 aura::Window* window = wm::GetActiveWindow();
743 if (window) { 743 if (window) {
744 wm::CenterWindow(window); 744 wm::CenterWindow(window);
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
877 keyboard_brightness_control_delegate) { 877 keyboard_brightness_control_delegate) {
878 keyboard_brightness_control_delegate_ = 878 keyboard_brightness_control_delegate_ =
879 keyboard_brightness_control_delegate.Pass(); 879 keyboard_brightness_control_delegate.Pass();
880 } 880 }
881 881
882 bool AcceleratorController::CanHandleAccelerators() const { 882 bool AcceleratorController::CanHandleAccelerators() const {
883 return true; 883 return true;
884 } 884 }
885 885
886 } // namespace ash 886 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/accelerators/accelerator_controller_unittest.cc » ('j') | chrome/browser/ui/ash/event_rewriter.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698