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

Side by Side Diff: ash/system/brightness/tray_brightness.h

Issue 11415014: Stop using shell::GetInstance()->system_tray() in system tray items (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Removed unnecessary forward declarations. Renamed |tray| to |owner|. Created 8 years, 1 month 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 | Annotate | Revision Log
OLDNEW
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 namespace internal { 14 namespace internal {
15 15
16 namespace tray { 16 namespace tray {
17 class BrightnessView; 17 class BrightnessView;
18 } 18 }
19 19
20 class TrayBrightness : public SystemTrayItem, 20 class TrayBrightness : public SystemTrayItem,
21 public BrightnessObserver { 21 public BrightnessObserver {
22 public: 22 public:
23 TrayBrightness(); 23 explicit TrayBrightness(SystemTray* system_tray);
24 virtual ~TrayBrightness(); 24 virtual ~TrayBrightness();
25 25
26 private: 26 private:
27 // Sends a request to get the current screen brightness so |current_percent_| 27 // Sends a request to get the current screen brightness so |current_percent_|
28 // can be initialized. 28 // can be initialized.
29 void GetInitialBrightness(); 29 void GetInitialBrightness();
30 30
31 // Updates |current_percent_| with the initial brightness requested by 31 // Updates |current_percent_| with the initial brightness requested by
32 // GetInitialBrightness(), if we haven't seen the brightness already in the 32 // GetInitialBrightness(), if we haven't seen the brightness already in the
33 // meantime. 33 // meantime.
(...skipping 29 matching lines...) Expand all
63 // Has |current_percent_| been initialized? 63 // Has |current_percent_| been initialized?
64 bool got_current_percent_; 64 bool got_current_percent_;
65 65
66 DISALLOW_COPY_AND_ASSIGN(TrayBrightness); 66 DISALLOW_COPY_AND_ASSIGN(TrayBrightness);
67 }; 67 };
68 68
69 } // namespace internal 69 } // namespace internal
70 } // namespace ash 70 } // namespace ash
71 71
72 #endif // ASH_SYSTEM_BRIGHTNESS_TRAY_BRIGHTNESS_H_ 72 #endif // ASH_SYSTEM_BRIGHTNESS_TRAY_BRIGHTNESS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698