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/system/chromeos/keyboard_brightness_controller.h" | 5 #include "ash/system/chromeos/keyboard_brightness_controller.h" |
6 | 6 |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/shell_delegate.h" | 8 #include "ash/shell_delegate.h" |
9 #include "chromeos/dbus/dbus_thread_manager.h" | 9 #include "chromeos/dbus/dbus_thread_manager.h" |
10 #include "chromeos/dbus/power_manager_client.h" | 10 #include "chromeos/dbus/power_manager_client.h" |
11 #include "content/public/browser/user_metrics.h" | 11 #include "content/public/browser/user_metrics.h" |
12 #include "ui/base/accelerators/accelerator.h" | 12 #include "ui/base/accelerators/accelerator.h" |
13 | 13 |
14 namespace ash { | 14 namespace ash { |
15 | 15 |
16 bool KeyboardBrightnessController::HandleKeyboardBrightnessDown( | 16 bool KeyboardBrightnessController::HandleKeyboardBrightnessDown( |
17 const ui::Accelerator& accelerator) { | 17 const ui::Accelerator& accelerator) { |
18 if (accelerator.key_code() == ui::VKEY_F6) { | 18 if (accelerator.key_code() == ui::VKEY_BRIGHTNESS_DOWN) { |
19 Shell::GetInstance()->delegate()->RecordUserMetricsAction( | 19 Shell::GetInstance()->delegate()->RecordUserMetricsAction( |
20 UMA_ACCEL_KEYBOARD_BRIGHTNESS_DOWN_F6); | 20 UMA_ACCEL_KEYBOARD_BRIGHTNESS_DOWN_F6); |
21 } | 21 } |
22 | 22 |
23 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()-> | 23 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()-> |
24 DecreaseKeyboardBrightness(); | 24 DecreaseKeyboardBrightness(); |
25 return true; | 25 return true; |
26 } | 26 } |
27 | 27 |
28 bool KeyboardBrightnessController::HandleKeyboardBrightnessUp( | 28 bool KeyboardBrightnessController::HandleKeyboardBrightnessUp( |
29 const ui::Accelerator& accelerator) { | 29 const ui::Accelerator& accelerator) { |
30 if (accelerator.key_code() == ui::VKEY_F7) { | 30 if (accelerator.key_code() == ui::VKEY_BRIGHTNESS_UP) { |
31 Shell::GetInstance()->delegate()->RecordUserMetricsAction( | 31 Shell::GetInstance()->delegate()->RecordUserMetricsAction( |
32 UMA_ACCEL_KEYBOARD_BRIGHTNESS_UP_F7); | 32 UMA_ACCEL_KEYBOARD_BRIGHTNESS_UP_F7); |
33 } | 33 } |
34 | 34 |
35 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()-> | 35 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()-> |
36 IncreaseKeyboardBrightness(); | 36 IncreaseKeyboardBrightness(); |
37 return true; | 37 return true; |
38 } | 38 } |
39 | 39 |
40 } // namespace ash | 40 } // namespace ash |
OLD | NEW |