| 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/macros.h" | 10 #include "base/macros.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 // Sends a request to get the current screen brightness so |current_percent_| | 29 // Sends a request to get the current screen brightness so |current_percent_| |
| 30 // can be initialized. | 30 // can be initialized. |
| 31 void GetInitialBrightness(); | 31 void GetInitialBrightness(); |
| 32 | 32 |
| 33 // Updates |current_percent_| with the initial brightness requested by | 33 // Updates |current_percent_| with the initial brightness requested by |
| 34 // GetInitialBrightness(), if we haven't seen the brightness already in the | 34 // GetInitialBrightness(), if we haven't seen the brightness already in the |
| 35 // meantime. | 35 // meantime. |
| 36 void HandleInitialBrightness(double percent); | 36 void HandleInitialBrightness(double percent); |
| 37 | 37 |
| 38 // Overridden from SystemTrayItem. | 38 // Overridden from SystemTrayItem. |
| 39 views::View* CreateTrayView(user::LoginStatus status) override; | 39 views::View* CreateTrayView(LoginStatus status) override; |
| 40 views::View* CreateDefaultView(user::LoginStatus status) override; | 40 views::View* CreateDefaultView(LoginStatus status) override; |
| 41 views::View* CreateDetailedView(user::LoginStatus status) override; | 41 views::View* CreateDetailedView(LoginStatus status) override; |
| 42 void DestroyTrayView() override; | 42 void DestroyTrayView() override; |
| 43 void DestroyDefaultView() override; | 43 void DestroyDefaultView() override; |
| 44 void DestroyDetailedView() override; | 44 void DestroyDetailedView() override; |
| 45 void UpdateAfterLoginStatusChange(user::LoginStatus status) override; | 45 void UpdateAfterLoginStatusChange(LoginStatus status) override; |
| 46 bool ShouldHideArrow() const override; | 46 bool ShouldHideArrow() const override; |
| 47 bool ShouldShowShelf() const override; | 47 bool ShouldShowShelf() const override; |
| 48 | 48 |
| 49 // Overriden from PowerManagerClient::Observer. | 49 // Overriden from PowerManagerClient::Observer. |
| 50 void BrightnessChanged(int level, bool user_initiated) override; | 50 void BrightnessChanged(int level, bool user_initiated) override; |
| 51 | 51 |
| 52 void HandleBrightnessChanged(double percent, bool user_initiated); | 52 void HandleBrightnessChanged(double percent, bool user_initiated); |
| 53 | 53 |
| 54 tray::BrightnessView* brightness_view_; | 54 tray::BrightnessView* brightness_view_; |
| 55 | 55 |
| 56 // Brightness level in the range [0.0, 100.0] that we've heard about most | 56 // Brightness level in the range [0.0, 100.0] that we've heard about most |
| 57 // recently. | 57 // recently. |
| 58 double current_percent_; | 58 double current_percent_; |
| 59 | 59 |
| 60 // Has |current_percent_| been initialized? | 60 // Has |current_percent_| been initialized? |
| 61 bool got_current_percent_; | 61 bool got_current_percent_; |
| 62 | 62 |
| 63 base::WeakPtrFactory<TrayBrightness> weak_ptr_factory_; | 63 base::WeakPtrFactory<TrayBrightness> weak_ptr_factory_; |
| 64 | 64 |
| 65 DISALLOW_COPY_AND_ASSIGN(TrayBrightness); | 65 DISALLOW_COPY_AND_ASSIGN(TrayBrightness); |
| 66 }; | 66 }; |
| 67 | 67 |
| 68 } // namespace ash | 68 } // namespace ash |
| 69 | 69 |
| 70 #endif // ASH_SYSTEM_CHROMEOS_BRIGHTNESS_TRAY_BRIGHTNESS_H_ | 70 #endif // ASH_SYSTEM_CHROMEOS_BRIGHTNESS_TRAY_BRIGHTNESS_H_ |
| OLD | NEW |