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 "chrome/browser/ui/views/aura/brightness_controller_chromeos.h" | 5 #include "chrome/browser/ui/views/ash/brightness_controller_chromeos.h" |
6 | 6 |
7 #include "chrome/browser/chromeos/dbus/dbus_thread_manager.h" | 7 #include "chrome/browser/chromeos/dbus/dbus_thread_manager.h" |
8 #include "chrome/browser/chromeos/dbus/power_manager_client.h" | 8 #include "chrome/browser/chromeos/dbus/power_manager_client.h" |
9 #include "content/public/browser/user_metrics.h" | 9 #include "content/public/browser/user_metrics.h" |
10 #include "ui/base/accelerators/accelerator.h" | 10 #include "ui/base/accelerators/accelerator.h" |
11 | 11 |
12 bool BrightnessController::HandleBrightnessDown( | 12 bool BrightnessController::HandleBrightnessDown( |
13 const ui::Accelerator& accelerator) { | 13 const ui::Accelerator& accelerator) { |
14 if (accelerator.key_code() == ui::VKEY_F6) | 14 if (accelerator.key_code() == ui::VKEY_F6) |
15 content::RecordAction( | 15 content::RecordAction( |
16 content::UserMetricsAction("Accel_BrightnessDown_F6")); | 16 content::UserMetricsAction("Accel_BrightnessDown_F6")); |
17 | 17 |
18 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()-> | 18 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()-> |
19 DecreaseScreenBrightness(true); | 19 DecreaseScreenBrightness(true); |
20 return true; | 20 return true; |
21 } | 21 } |
22 | 22 |
23 bool BrightnessController::HandleBrightnessUp( | 23 bool BrightnessController::HandleBrightnessUp( |
24 const ui::Accelerator& accelerator) { | 24 const ui::Accelerator& accelerator) { |
25 if (accelerator.key_code() == ui::VKEY_F7) | 25 if (accelerator.key_code() == ui::VKEY_F7) |
26 content::RecordAction(content::UserMetricsAction("Accel_BrightnessUp_F7")); | 26 content::RecordAction(content::UserMetricsAction("Accel_BrightnessUp_F7")); |
27 | 27 |
28 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()-> | 28 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()-> |
29 IncreaseScreenBrightness(); | 29 IncreaseScreenBrightness(); |
30 return true; | 30 return true; |
31 } | 31 } |
OLD | NEW |