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/chromeos/power/brightness_observer.h" | 5 #include "chrome/browser/chromeos/power/brightness_observer.h" |
6 | 6 |
7 #include "chrome/browser/chromeos/dbus/dbus_thread_manager.h" | |
8 #include "chrome/browser/chromeos/ui/brightness_bubble.h" | 7 #include "chrome/browser/chromeos/ui/brightness_bubble.h" |
9 #include "chrome/browser/chromeos/ui/volume_bubble.h" | 8 #include "chrome/browser/chromeos/ui/volume_bubble.h" |
10 #include "chrome/browser/extensions/system/system_api.h" | 9 #include "chrome/browser/extensions/system/system_api.h" |
| 10 #include "chromeos/dbus/dbus_thread_manager.h" |
11 | 11 |
12 namespace chromeos { | 12 namespace chromeos { |
13 | 13 |
14 BrightnessObserver::BrightnessObserver() { | 14 BrightnessObserver::BrightnessObserver() { |
15 DBusThreadManager::Get()->GetPowerManagerClient()->AddObserver(this); | 15 DBusThreadManager::Get()->GetPowerManagerClient()->AddObserver(this); |
16 } | 16 } |
17 | 17 |
18 BrightnessObserver::~BrightnessObserver() { | 18 BrightnessObserver::~BrightnessObserver() { |
19 DBusThreadManager::Get()->GetPowerManagerClient()->RemoveObserver(this); | 19 DBusThreadManager::Get()->GetPowerManagerClient()->RemoveObserver(this); |
20 } | 20 } |
21 | 21 |
22 void BrightnessObserver::BrightnessChanged(int level, bool user_initiated) { | 22 void BrightnessObserver::BrightnessChanged(int level, bool user_initiated) { |
23 if (user_initiated) | 23 if (user_initiated) |
24 BrightnessBubble::GetInstance()->ShowBubble(level, true); | 24 BrightnessBubble::GetInstance()->ShowBubble(level, true); |
25 else | 25 else |
26 BrightnessBubble::GetInstance()->UpdateWithoutShowingBubble(level, true); | 26 BrightnessBubble::GetInstance()->UpdateWithoutShowingBubble(level, true); |
27 | 27 |
28 extensions::DispatchBrightnessChangedEvent(level, user_initiated); | 28 extensions::DispatchBrightnessChangedEvent(level, user_initiated); |
29 | 29 |
30 VolumeBubble::GetInstance()->HideBubble(); | 30 VolumeBubble::GetInstance()->HideBubble(); |
31 } | 31 } |
32 | 32 |
33 } // namespace chromeos | 33 } // namespace chromeos |
OLD | NEW |