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 #ifndef ASH_SYSTEM_BRIGHTNESS_TRAY_BRIGHTNESS_H_ | 5 #ifndef ASH_SYSTEM_BRIGHTNESS_TRAY_BRIGHTNESS_H_ |
6 #define ASH_SYSTEM_BRIGHTNESS_TRAY_BRIGHTNESS_H_ | 6 #define ASH_SYSTEM_BRIGHTNESS_TRAY_BRIGHTNESS_H_ |
7 | 7 |
8 #include "ash/system/brightness/brightness_observer.h" | 8 #include "ash/system/brightness/brightness_observer.h" |
9 #include "ash/system/tray/system_tray_item.h" | 9 #include "ash/system/tray/system_tray_item.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
11 #include "base/memory/weak_ptr.h" | 11 #include "base/memory/weak_ptr.h" |
12 | 12 |
13 namespace ash { | 13 namespace ash { |
| 14 |
| 15 class SystemTray; |
| 16 |
14 namespace internal { | 17 namespace internal { |
15 | 18 |
16 namespace tray { | 19 namespace tray { |
17 class BrightnessView; | 20 class BrightnessView; |
18 } | 21 } |
19 | 22 |
20 class TrayBrightness : public SystemTrayItem, | 23 class TrayBrightness : public SystemTrayItem, |
21 public BrightnessObserver { | 24 public BrightnessObserver { |
22 public: | 25 public: |
23 TrayBrightness(); | 26 explicit TrayBrightness(SystemTray* system_tray); |
24 virtual ~TrayBrightness(); | 27 virtual ~TrayBrightness(); |
25 | 28 |
26 private: | 29 private: |
27 // Sends a request to get the current screen brightness so |current_percent_| | 30 // Sends a request to get the current screen brightness so |current_percent_| |
28 // can be initialized. | 31 // can be initialized. |
29 void GetInitialBrightness(); | 32 void GetInitialBrightness(); |
30 | 33 |
31 // Updates |current_percent_| with the initial brightness requested by | 34 // Updates |current_percent_| with the initial brightness requested by |
32 // GetInitialBrightness(), if we haven't seen the brightness already in the | 35 // GetInitialBrightness(), if we haven't seen the brightness already in the |
33 // meantime. | 36 // meantime. |
(...skipping 29 matching lines...) Expand all Loading... |
63 // Has |current_percent_| been initialized? | 66 // Has |current_percent_| been initialized? |
64 bool got_current_percent_; | 67 bool got_current_percent_; |
65 | 68 |
66 DISALLOW_COPY_AND_ASSIGN(TrayBrightness); | 69 DISALLOW_COPY_AND_ASSIGN(TrayBrightness); |
67 }; | 70 }; |
68 | 71 |
69 } // namespace internal | 72 } // namespace internal |
70 } // namespace ash | 73 } // namespace ash |
71 | 74 |
72 #endif // ASH_SYSTEM_BRIGHTNESS_TRAY_BRIGHTNESS_H_ | 75 #endif // ASH_SYSTEM_BRIGHTNESS_TRAY_BRIGHTNESS_H_ |
OLD | NEW |