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

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: forlanding3 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
« no previous file with comments | « no previous file | ash/accelerators/accelerator_controller_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) 460 if (key_code == ui::VKEY_TAB)
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) 465 if (key_code == ui::VKEY_TAB)
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) 470 if (key_code == ui::VKEY_MEDIA_LAUNCH_APP1)
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) 475 if (key_code == ui::VKEY_MEDIA_LAUNCH_APP1)
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 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
723 // Disable the shortcut for minimizing full screen window due to 723 // Disable the shortcut for minimizing full screen window due to
724 // crbug.com/131709, which is a crashing issue related to minimizing 724 // crbug.com/131709, which is a crashing issue related to minimizing
725 // full screen pepper window. 725 // full screen pepper window.
726 if (!wm::IsWindowFullscreen(window)) { 726 if (!wm::IsWindowFullscreen(window)) {
727 wm::MinimizeWindow(window); 727 wm::MinimizeWindow(window);
728 return true; 728 return true;
729 } 729 }
730 break; 730 break;
731 } 731 }
732 case TOGGLE_MAXIMIZED: { 732 case TOGGLE_MAXIMIZED: {
733 if (key_code == ui::VKEY_F4) { 733 if (key_code == ui::VKEY_MEDIA_LAUNCH_APP2) {
734 shell->delegate()->RecordUserMetricsAction( 734 shell->delegate()->RecordUserMetricsAction(
735 UMA_ACCEL_MAXIMIZE_RESTORE_F4); 735 UMA_ACCEL_MAXIMIZE_RESTORE_F4);
736 } 736 }
737 shell->delegate()->ToggleMaximized(); 737 shell->delegate()->ToggleMaximized();
738 return true; 738 return true;
739 } 739 }
740 case WINDOW_POSITION_CENTER: { 740 case WINDOW_POSITION_CENTER: {
741 aura::Window* window = wm::GetActiveWindow(); 741 aura::Window* window = wm::GetActiveWindow();
742 if (window) { 742 if (window) {
743 wm::CenterWindow(window); 743 wm::CenterWindow(window);
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
876 keyboard_brightness_control_delegate) { 876 keyboard_brightness_control_delegate) {
877 keyboard_brightness_control_delegate_ = 877 keyboard_brightness_control_delegate_ =
878 keyboard_brightness_control_delegate.Pass(); 878 keyboard_brightness_control_delegate.Pass();
879 } 879 }
880 880
881 bool AcceleratorController::CanHandleAccelerators() const { 881 bool AcceleratorController::CanHandleAccelerators() const {
882 return true; 882 return true;
883 } 883 }
884 884
885 } // namespace ash 885 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/accelerators/accelerator_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698