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

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

Issue 10200006: ash: Refresh the tray items, instead of recreating them, when login status changes. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « ash/system/bluetooth/tray_bluetooth.cc ('k') | ash/system/brightness/tray_brightness.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #pragma once 7 #pragma once
8 8
9 #include "ash/system/brightness/brightness_observer.h" 9 #include "ash/system/brightness/brightness_observer.h"
10 #include "ash/system/tray/system_tray_item.h" 10 #include "ash/system/tray/system_tray_item.h"
(...skipping 23 matching lines...) Expand all
34 // meantime. 34 // meantime.
35 void HandleInitialBrightness(double percent); 35 void HandleInitialBrightness(double percent);
36 36
37 // Overridden from SystemTrayItem. 37 // Overridden from SystemTrayItem.
38 virtual views::View* CreateTrayView(user::LoginStatus status) OVERRIDE; 38 virtual views::View* CreateTrayView(user::LoginStatus status) OVERRIDE;
39 virtual views::View* CreateDefaultView(user::LoginStatus status) OVERRIDE; 39 virtual views::View* CreateDefaultView(user::LoginStatus status) OVERRIDE;
40 virtual views::View* CreateDetailedView(user::LoginStatus status) OVERRIDE; 40 virtual views::View* CreateDetailedView(user::LoginStatus status) OVERRIDE;
41 virtual void DestroyTrayView() OVERRIDE; 41 virtual void DestroyTrayView() OVERRIDE;
42 virtual void DestroyDefaultView() OVERRIDE; 42 virtual void DestroyDefaultView() OVERRIDE;
43 virtual void DestroyDetailedView() OVERRIDE; 43 virtual void DestroyDetailedView() OVERRIDE;
44 virtual void UpdateAfterLoginStatusChange(user::LoginStatus status) OVERRIDE;
44 45
45 // Overridden from BrightnessObserver. 46 // Overridden from BrightnessObserver.
46 virtual void OnBrightnessChanged(double percent, 47 virtual void OnBrightnessChanged(double percent,
47 bool user_initiated) OVERRIDE; 48 bool user_initiated) OVERRIDE;
48 49
49 base::WeakPtrFactory<TrayBrightness> weak_ptr_factory_; 50 base::WeakPtrFactory<TrayBrightness> weak_ptr_factory_;
50 51
51 scoped_ptr<tray::BrightnessView> brightness_view_; 52 scoped_ptr<tray::BrightnessView> brightness_view_;
52 53
53 // Was |brightness_view_| created for CreateDefaultView() rather than 54 // Was |brightness_view_| created for CreateDefaultView() rather than
54 // CreateDetailedView()? Used to avoid resetting |brightness_view_| 55 // CreateDetailedView()? Used to avoid resetting |brightness_view_|
55 // inappropriately in DestroyDefaultView() or DestroyDetailedView(). 56 // inappropriately in DestroyDefaultView() or DestroyDetailedView().
56 bool is_default_view_; 57 bool is_default_view_;
57 58
58 // Brightness level in the range [0.0, 100.0] that we've heard about most 59 // Brightness level in the range [0.0, 100.0] that we've heard about most
59 // recently. 60 // recently.
60 double current_percent_; 61 double current_percent_;
61 62
62 // Has |current_percent_| been initialized? 63 // Has |current_percent_| been initialized?
63 bool got_current_percent_; 64 bool got_current_percent_;
64 65
65 DISALLOW_COPY_AND_ASSIGN(TrayBrightness); 66 DISALLOW_COPY_AND_ASSIGN(TrayBrightness);
66 }; 67 };
67 68
68 } // namespace internal 69 } // namespace internal
69 } // namespace ash 70 } // namespace ash
70 71
71 #endif // ASH_SYSTEM_BRIGHTNESS_TRAY_BRIGHTNESS_H_ 72 #endif // ASH_SYSTEM_BRIGHTNESS_TRAY_BRIGHTNESS_H_
OLDNEW
« no previous file with comments | « ash/system/bluetooth/tray_bluetooth.cc ('k') | ash/system/brightness/tray_brightness.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698