OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #include "ash/common/system/chromeos/keyboard_brightness_controller.h" | |
6 | |
7 #include "ash/common/wm_shell.h" | |
8 #include "chromeos/dbus/dbus_thread_manager.h" | |
9 #include "chromeos/dbus/power_manager_client.h" | |
10 #include "ui/base/accelerators/accelerator.h" | |
11 | |
12 namespace ash { | |
13 | |
14 void KeyboardBrightnessController::HandleKeyboardBrightnessDown( | |
15 const ui::Accelerator& accelerator) { | |
16 if (accelerator.key_code() == ui::VKEY_BRIGHTNESS_DOWN) { | |
17 WmShell::Get()->RecordUserMetricsAction( | |
18 UMA_ACCEL_KEYBOARD_BRIGHTNESS_DOWN_F6); | |
19 } | |
20 | |
21 chromeos::DBusThreadManager::Get() | |
22 ->GetPowerManagerClient() | |
23 ->DecreaseKeyboardBrightness(); | |
24 } | |
25 | |
26 void KeyboardBrightnessController::HandleKeyboardBrightnessUp( | |
27 const ui::Accelerator& accelerator) { | |
28 if (accelerator.key_code() == ui::VKEY_BRIGHTNESS_UP) { | |
29 WmShell::Get()->RecordUserMetricsAction( | |
30 UMA_ACCEL_KEYBOARD_BRIGHTNESS_UP_F7); | |
31 } | |
32 | |
33 chromeos::DBusThreadManager::Get() | |
34 ->GetPowerManagerClient() | |
35 ->IncreaseKeyboardBrightness(); | |
36 } | |
37 | |
38 } // namespace ash | |
OLD | NEW |