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

Side by Side Diff: ash/system/chromeos/brightness/brightness_controller_chromeos.cc

Issue 2095193002: clang-format all of //ash (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/brightness/brightness_controller_chromeos.h" 5 #include "ash/system/chromeos/brightness/brightness_controller_chromeos.h"
6 6
7 #include "base/metrics/user_metrics.h" 7 #include "base/metrics/user_metrics.h"
8 #include "chromeos/dbus/dbus_thread_manager.h" 8 #include "chromeos/dbus/dbus_thread_manager.h"
9 #include "chromeos/dbus/power_manager_client.h" 9 #include "chromeos/dbus/power_manager_client.h"
10 #include "ui/base/accelerators/accelerator.h" 10 #include "ui/base/accelerators/accelerator.h"
11 11
12 namespace ash { 12 namespace ash {
13 namespace system { 13 namespace system {
14 14
15 void BrightnessControllerChromeos::HandleBrightnessDown( 15 void BrightnessControllerChromeos::HandleBrightnessDown(
16 const ui::Accelerator& accelerator) { 16 const ui::Accelerator& accelerator) {
17 if (accelerator.key_code() == ui::VKEY_BRIGHTNESS_DOWN) 17 if (accelerator.key_code() == ui::VKEY_BRIGHTNESS_DOWN)
18 base::RecordAction( 18 base::RecordAction(base::UserMetricsAction("Accel_BrightnessDown_F6"));
19 base::UserMetricsAction("Accel_BrightnessDown_F6"));
20 19
21 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()-> 20 chromeos::DBusThreadManager::Get()
22 DecreaseScreenBrightness(true); 21 ->GetPowerManagerClient()
22 ->DecreaseScreenBrightness(true);
23 } 23 }
24 24
25 void BrightnessControllerChromeos::HandleBrightnessUp( 25 void BrightnessControllerChromeos::HandleBrightnessUp(
26 const ui::Accelerator& accelerator) { 26 const ui::Accelerator& accelerator) {
27 if (accelerator.key_code() == ui::VKEY_BRIGHTNESS_UP) 27 if (accelerator.key_code() == ui::VKEY_BRIGHTNESS_UP)
28 base::RecordAction(base::UserMetricsAction("Accel_BrightnessUp_F7")); 28 base::RecordAction(base::UserMetricsAction("Accel_BrightnessUp_F7"));
29 29
30 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()-> 30 chromeos::DBusThreadManager::Get()
31 IncreaseScreenBrightness(); 31 ->GetPowerManagerClient()
32 ->IncreaseScreenBrightness();
32 } 33 }
33 34
34 void BrightnessControllerChromeos::SetBrightnessPercent(double percent, 35 void BrightnessControllerChromeos::SetBrightnessPercent(double percent,
35 bool gradual) { 36 bool gradual) {
36 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()-> 37 chromeos::DBusThreadManager::Get()
37 SetScreenBrightnessPercent(percent, gradual); 38 ->GetPowerManagerClient()
39 ->SetScreenBrightnessPercent(percent, gradual);
38 } 40 }
39 41
40 void BrightnessControllerChromeos::GetBrightnessPercent( 42 void BrightnessControllerChromeos::GetBrightnessPercent(
41 const base::Callback<void(double)>& callback) { 43 const base::Callback<void(double)>& callback) {
42 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()-> 44 chromeos::DBusThreadManager::Get()
43 GetScreenBrightnessPercent(callback); 45 ->GetPowerManagerClient()
46 ->GetScreenBrightnessPercent(callback);
44 } 47 }
45 48
46 } // namespace system 49 } // namespace system
47 } // namespace ash 50 } // namespace ash
OLDNEW
« no previous file with comments | « ash/system/chromeos/bluetooth/tray_bluetooth.cc ('k') | ash/system/chromeos/brightness/tray_brightness.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698