| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 ATHENA_SYSTEM_POWER_BUTTON_CONTROLLER_H_ | 5 #ifndef ATHENA_SYSTEM_POWER_BUTTON_CONTROLLER_H_ |
| 6 #define ATHENA_SYSTEM_POWER_BUTTON_CONTROLLER_H_ | 6 #define ATHENA_SYSTEM_POWER_BUTTON_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
| 10 #include "base/timer/timer.h" | 10 #include "base/timer/timer.h" |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 STATE_OTHER | 41 STATE_OTHER |
| 42 }; | 42 }; |
| 43 | 43 |
| 44 // Shows the shutdown warning dialog. | 44 // Shows the shutdown warning dialog. |
| 45 void ShowShutdownWarningDialog(); | 45 void ShowShutdownWarningDialog(); |
| 46 | 46 |
| 47 // Requests shutdown. | 47 // Requests shutdown. |
| 48 void Shutdown(); | 48 void Shutdown(); |
| 49 | 49 |
| 50 // chromeos::PowerManagerClient::Observer: | 50 // chromeos::PowerManagerClient::Observer: |
| 51 virtual void BrightnessChanged(int level, bool user_initiated) OVERRIDE; | 51 virtual void BrightnessChanged(int level, bool user_initiated) override; |
| 52 virtual void PowerButtonEventReceived( | 52 virtual void PowerButtonEventReceived( |
| 53 bool down, | 53 bool down, |
| 54 const base::TimeTicks& timestamp) OVERRIDE; | 54 const base::TimeTicks& timestamp) override; |
| 55 | 55 |
| 56 // |shutdown_warning_message_|'s parent container. | 56 // |shutdown_warning_message_|'s parent container. |
| 57 aura::Window* warning_message_container_; | 57 aura::Window* warning_message_container_; |
| 58 | 58 |
| 59 // Shows a warning that the device is about to be shutdown. | 59 // Shows a warning that the device is about to be shutdown. |
| 60 scoped_ptr<views::Widget> shutdown_warning_message_; | 60 scoped_ptr<views::Widget> shutdown_warning_message_; |
| 61 | 61 |
| 62 // Whether the screen brightness was reduced to 0%. | 62 // Whether the screen brightness was reduced to 0%. |
| 63 bool brightness_is_zero_; | 63 bool brightness_is_zero_; |
| 64 | 64 |
| 65 // The last time at which the screen brightness was 0%. | 65 // The last time at which the screen brightness was 0%. |
| 66 base::TimeTicks zero_brightness_end_time_; | 66 base::TimeTicks zero_brightness_end_time_; |
| 67 | 67 |
| 68 State state_; | 68 State state_; |
| 69 | 69 |
| 70 base::OneShotTimer<PowerButtonController> timer_; | 70 base::OneShotTimer<PowerButtonController> timer_; |
| 71 | 71 |
| 72 DISALLOW_COPY_AND_ASSIGN(PowerButtonController); | 72 DISALLOW_COPY_AND_ASSIGN(PowerButtonController); |
| 73 }; | 73 }; |
| 74 | 74 |
| 75 } // namespace athena | 75 } // namespace athena |
| 76 | 76 |
| 77 #endif // ATHENA_SYSTEM_POWER_BUTTON_CONTROLLER_H_ | 77 #endif // ATHENA_SYSTEM_POWER_BUTTON_CONTROLLER_H_ |
| OLD | NEW |