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

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

Issue 9309098: Handle F6 and F7 (brightness keys) in ash [part 3 of 3]. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 10 months 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 "ash/brightness_control_delegate.h" 7 #include "ash/brightness_control_delegate.h"
8 #include "ash/caps_lock_delegate.h" 8 #include "ash/caps_lock_delegate.h"
9 #include "ash/launcher/launcher.h" 9 #include "ash/launcher/launcher.h"
10 #include "ash/launcher/launcher_model.h" 10 #include "ash/launcher/launcher_model.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 ui::KeyboardCode keycode; 53 ui::KeyboardCode keycode;
54 bool shift; 54 bool shift;
55 bool ctrl; 55 bool ctrl;
56 bool alt; 56 bool alt;
57 AcceleratorAction action; 57 AcceleratorAction action;
58 } kAcceleratorData[] = { 58 } kAcceleratorData[] = {
59 { ui::VKEY_TAB, false, false, true, CYCLE_FORWARD }, 59 { ui::VKEY_TAB, false, false, true, CYCLE_FORWARD },
60 { ui::VKEY_TAB, true, false, true, CYCLE_BACKWARD }, 60 { ui::VKEY_TAB, true, false, true, CYCLE_BACKWARD },
61 { ui::VKEY_F5, false, false, false, CYCLE_FORWARD }, 61 { ui::VKEY_F5, false, false, false, CYCLE_FORWARD },
62 #if defined(OS_CHROMEOS) 62 #if defined(OS_CHROMEOS)
63 { ui::VKEY_BRIGHTNESS_DOWN, false, false, false, BRIGHTNESS_DOWN },
64 { ui::VKEY_BRIGHTNESS_UP, false, false, false, BRIGHTNESS_UP },
63 { ui::VKEY_L, true, true, false, LOCK_SCREEN }, 65 { ui::VKEY_L, true, true, false, LOCK_SCREEN },
64 #endif 66 #endif
65 { ui::VKEY_Q, true, true, false, EXIT }, 67 { ui::VKEY_Q, true, true, false, EXIT },
66 { ui::VKEY_F5, true, false, false, CYCLE_BACKWARD }, 68 { ui::VKEY_F5, true, false, false, CYCLE_BACKWARD },
67 { ui::VKEY_F5, false, true, false, TAKE_SCREENSHOT }, 69 { ui::VKEY_F5, false, true, false, TAKE_SCREENSHOT },
68 { ui::VKEY_F5, true, true, false, TAKE_PARTIAL_SCREENSHOT }, 70 { ui::VKEY_F5, true, true, false, TAKE_PARTIAL_SCREENSHOT },
69 { ui::VKEY_PRINT, false, false, false, TAKE_SCREENSHOT }, 71 { ui::VKEY_PRINT, false, false, false, TAKE_SCREENSHOT },
70 // On Chrome OS, Search key is mapped to LWIN. 72 // On Chrome OS, Search key is mapped to LWIN.
71 { ui::VKEY_LWIN, true, false, false, TOGGLE_CAPS_LOCK }, 73 { ui::VKEY_LWIN, true, false, false, TOGGLE_CAPS_LOCK },
72 // TODO(yusukes): Support multimedia keys for controlling brightness on an
73 // external USB keyboard.
74 { ui::VKEY_F6, false, false, false, BRIGHTNESS_DOWN }, 74 { ui::VKEY_F6, false, false, false, BRIGHTNESS_DOWN },
75 { ui::VKEY_F7, false, false, false, BRIGHTNESS_UP }, 75 { ui::VKEY_F7, false, false, false, BRIGHTNESS_UP },
76 { ui::VKEY_F8, false, false, false, VOLUME_MUTE }, 76 { ui::VKEY_F8, false, false, false, VOLUME_MUTE },
77 { ui::VKEY_VOLUME_MUTE, false, false, false, VOLUME_MUTE }, 77 { ui::VKEY_VOLUME_MUTE, false, false, false, VOLUME_MUTE },
78 { ui::VKEY_F9, false, false, false, VOLUME_DOWN }, 78 { ui::VKEY_F9, false, false, false, VOLUME_DOWN },
79 { ui::VKEY_VOLUME_DOWN, false, false, false, VOLUME_DOWN }, 79 { ui::VKEY_VOLUME_DOWN, false, false, false, VOLUME_DOWN },
80 { ui::VKEY_F10, false, false, false, VOLUME_UP }, 80 { ui::VKEY_F10, false, false, false, VOLUME_UP },
81 { ui::VKEY_VOLUME_UP, false, false, false, VOLUME_UP }, 81 { ui::VKEY_VOLUME_UP, false, false, false, VOLUME_UP },
82 #if !defined(NDEBUG) 82 #if !defined(NDEBUG)
83 { ui::VKEY_HOME, false, true, false, ROTATE_SCREEN }, 83 { ui::VKEY_HOME, false, true, false, ROTATE_SCREEN },
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 NOTREACHED() << "Unhandled action " << it->second;; 309 NOTREACHED() << "Unhandled action " << it->second;;
310 } 310 }
311 return false; 311 return false;
312 } 312 }
313 313
314 bool AcceleratorController::CanHandleAccelerators() const { 314 bool AcceleratorController::CanHandleAccelerators() const {
315 return true; 315 return true;
316 } 316 }
317 317
318 } // namespace ash 318 } // 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