| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 CHROME_BROWSER_CHROMEOS_SYSTEM_AUTOMATIC_REBOOT_MANAGER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_SYSTEM_AUTOMATIC_REBOOT_MANAGER_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_SYSTEM_AUTOMATIC_REBOOT_MANAGER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_SYSTEM_AUTOMATIC_REBOOT_MANAGER_H_ |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 SystemEventTimes(const base::TimeDelta& uptime, | 83 SystemEventTimes(const base::TimeDelta& uptime, |
| 84 const base::TimeDelta& update_reboot_needed_uptime); | 84 const base::TimeDelta& update_reboot_needed_uptime); |
| 85 | 85 |
| 86 bool has_boot_time; | 86 bool has_boot_time; |
| 87 base::TimeTicks boot_time; | 87 base::TimeTicks boot_time; |
| 88 | 88 |
| 89 bool has_update_reboot_needed_time; | 89 bool has_update_reboot_needed_time; |
| 90 base::TimeTicks update_reboot_needed_time; | 90 base::TimeTicks update_reboot_needed_time; |
| 91 }; | 91 }; |
| 92 | 92 |
| 93 explicit AutomaticRebootManager(scoped_ptr<base::TickClock> clock); | 93 explicit AutomaticRebootManager(const scoped_refptr<base::TickClock>& clock); |
| 94 virtual ~AutomaticRebootManager(); | 94 virtual ~AutomaticRebootManager(); |
| 95 | 95 |
| 96 void AddObserver(AutomaticRebootManagerObserver* observer); | 96 void AddObserver(AutomaticRebootManagerObserver* observer); |
| 97 void RemoveObserver(AutomaticRebootManagerObserver* observer); | 97 void RemoveObserver(AutomaticRebootManagerObserver* observer); |
| 98 | 98 |
| 99 // PowerManagerClient::Observer: | 99 // PowerManagerClient::Observer: |
| 100 virtual void SuspendDone(const base::TimeDelta& sleep_duration) override; | 100 virtual void SuspendDone(const base::TimeDelta& sleep_duration) override; |
| 101 | 101 |
| 102 // UpdateEngineClient::Observer: | 102 // UpdateEngineClient::Observer: |
| 103 virtual void UpdateStatusChanged( | 103 virtual void UpdateStatusChanged( |
| (...skipping 26 matching lines...) Expand all Loading... |
| 130 // Called whenever the status of the criteria inhibiting reboots may have | 130 // Called whenever the status of the criteria inhibiting reboots may have |
| 131 // changed. Reboots immediately if a reboot has actually been requested and | 131 // changed. Reboots immediately if a reboot has actually been requested and |
| 132 // none of the criteria inhibiting it apply anymore. Otherwise, does nothing. | 132 // none of the criteria inhibiting it apply anymore. Otherwise, does nothing. |
| 133 // If |ignore_session|, a session in progress does not inhibit reboots. | 133 // If |ignore_session|, a session in progress does not inhibit reboots. |
| 134 void MaybeReboot(bool ignore_session); | 134 void MaybeReboot(bool ignore_session); |
| 135 | 135 |
| 136 // Reboots immediately. | 136 // Reboots immediately. |
| 137 void Reboot(); | 137 void Reboot(); |
| 138 | 138 |
| 139 // A clock that can be mocked in tests to fast-forward time. | 139 // A clock that can be mocked in tests to fast-forward time. |
| 140 scoped_ptr<base::TickClock> clock_; | 140 scoped_refptr<base::TickClock> clock_; |
| 141 | 141 |
| 142 PrefChangeRegistrar local_state_registrar_; | 142 PrefChangeRegistrar local_state_registrar_; |
| 143 | 143 |
| 144 content::NotificationRegistrar notification_registrar_; | 144 content::NotificationRegistrar notification_registrar_; |
| 145 | 145 |
| 146 // Fires when the user has been idle on the login screen for a set amount of | 146 // Fires when the user has been idle on the login screen for a set amount of |
| 147 // time. | 147 // time. |
| 148 scoped_ptr<base::OneShotTimer<AutomaticRebootManager> > | 148 scoped_ptr<base::OneShotTimer<AutomaticRebootManager> > |
| 149 login_screen_idle_timer_; | 149 login_screen_idle_timer_; |
| 150 | 150 |
| (...skipping 17 matching lines...) Expand all Loading... |
| 168 | 168 |
| 169 base::WeakPtrFactory<AutomaticRebootManager> weak_ptr_factory_; | 169 base::WeakPtrFactory<AutomaticRebootManager> weak_ptr_factory_; |
| 170 | 170 |
| 171 DISALLOW_COPY_AND_ASSIGN(AutomaticRebootManager); | 171 DISALLOW_COPY_AND_ASSIGN(AutomaticRebootManager); |
| 172 }; | 172 }; |
| 173 | 173 |
| 174 } // namespace system | 174 } // namespace system |
| 175 } // namespace chromeos | 175 } // namespace chromeos |
| 176 | 176 |
| 177 #endif // CHROME_BROWSER_CHROMEOS_SYSTEM_AUTOMATIC_REBOOT_MANAGER_H_ | 177 #endif // CHROME_BROWSER_CHROMEOS_SYSTEM_AUTOMATIC_REBOOT_MANAGER_H_ |
| OLD | NEW |