| OLD | NEW |
| 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 #ifndef ASH_SYSTEM_CHROMEOS_BRIGHTNESS_TRAY_BRIGHTNESS_H_ | 5 #ifndef ASH_SYSTEM_CHROMEOS_BRIGHTNESS_TRAY_BRIGHTNESS_H_ |
| 6 #define ASH_SYSTEM_CHROMEOS_BRIGHTNESS_TRAY_BRIGHTNESS_H_ | 6 #define ASH_SYSTEM_CHROMEOS_BRIGHTNESS_TRAY_BRIGHTNESS_H_ |
| 7 | 7 |
| 8 #include "ash/system/tray/system_tray_item.h" | 8 #include "ash/system/tray/system_tray_item.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 | 35 |
| 36 // Overridden from SystemTrayItem. | 36 // Overridden from SystemTrayItem. |
| 37 virtual views::View* CreateTrayView(user::LoginStatus status) OVERRIDE; | 37 virtual views::View* CreateTrayView(user::LoginStatus status) OVERRIDE; |
| 38 virtual views::View* CreateDefaultView(user::LoginStatus status) OVERRIDE; | 38 virtual views::View* CreateDefaultView(user::LoginStatus status) OVERRIDE; |
| 39 virtual views::View* CreateDetailedView(user::LoginStatus status) OVERRIDE; | 39 virtual views::View* CreateDetailedView(user::LoginStatus status) OVERRIDE; |
| 40 virtual void DestroyTrayView() OVERRIDE; | 40 virtual void DestroyTrayView() OVERRIDE; |
| 41 virtual void DestroyDefaultView() OVERRIDE; | 41 virtual void DestroyDefaultView() OVERRIDE; |
| 42 virtual void DestroyDetailedView() OVERRIDE; | 42 virtual void DestroyDetailedView() OVERRIDE; |
| 43 virtual void UpdateAfterLoginStatusChange(user::LoginStatus status) OVERRIDE; | 43 virtual void UpdateAfterLoginStatusChange(user::LoginStatus status) OVERRIDE; |
| 44 virtual bool ShouldHideArrow() const OVERRIDE; | 44 virtual bool ShouldHideArrow() const OVERRIDE; |
| 45 virtual bool ShouldShowLauncher() const OVERRIDE; | 45 virtual bool ShouldShowShelf() const OVERRIDE; |
| 46 | 46 |
| 47 // Overriden from PowerManagerClient::Observer. | 47 // Overriden from PowerManagerClient::Observer. |
| 48 virtual void BrightnessChanged(int level, bool user_initiated) OVERRIDE; | 48 virtual void BrightnessChanged(int level, bool user_initiated) OVERRIDE; |
| 49 | 49 |
| 50 void HandleBrightnessChanged(double percent, bool user_initiated); | 50 void HandleBrightnessChanged(double percent, bool user_initiated); |
| 51 | 51 |
| 52 base::WeakPtrFactory<TrayBrightness> weak_ptr_factory_; | 52 base::WeakPtrFactory<TrayBrightness> weak_ptr_factory_; |
| 53 | 53 |
| 54 tray::BrightnessView* brightness_view_; | 54 tray::BrightnessView* brightness_view_; |
| 55 | 55 |
| 56 // Was |brightness_view_| created for CreateDefaultView() rather than | 56 // Was |brightness_view_| created for CreateDefaultView() rather than |
| 57 // CreateDetailedView()? Used to avoid resetting |brightness_view_| | 57 // CreateDetailedView()? Used to avoid resetting |brightness_view_| |
| 58 // inappropriately in DestroyDefaultView() or DestroyDetailedView(). | 58 // inappropriately in DestroyDefaultView() or DestroyDetailedView(). |
| 59 bool is_default_view_; | 59 bool is_default_view_; |
| 60 | 60 |
| 61 // Brightness level in the range [0.0, 100.0] that we've heard about most | 61 // Brightness level in the range [0.0, 100.0] that we've heard about most |
| 62 // recently. | 62 // recently. |
| 63 double current_percent_; | 63 double current_percent_; |
| 64 | 64 |
| 65 // Has |current_percent_| been initialized? | 65 // Has |current_percent_| been initialized? |
| 66 bool got_current_percent_; | 66 bool got_current_percent_; |
| 67 | 67 |
| 68 DISALLOW_COPY_AND_ASSIGN(TrayBrightness); | 68 DISALLOW_COPY_AND_ASSIGN(TrayBrightness); |
| 69 }; | 69 }; |
| 70 | 70 |
| 71 } // namespace internal | 71 } // namespace internal |
| 72 } // namespace ash | 72 } // namespace ash |
| 73 | 73 |
| 74 #endif // ASH_SYSTEM_CHROMEOS_BRIGHTNESS_TRAY_BRIGHTNESS_H_ | 74 #endif // ASH_SYSTEM_CHROMEOS_BRIGHTNESS_TRAY_BRIGHTNESS_H_ |
| OLD | NEW |