| 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 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 | 141 |
| 142 // A clock that can be mocked in tests to fast-forward time. | 142 // A clock that can be mocked in tests to fast-forward time. |
| 143 scoped_ptr<base::TickClock> clock_; | 143 scoped_ptr<base::TickClock> clock_; |
| 144 | 144 |
| 145 PrefChangeRegistrar local_state_registrar_; | 145 PrefChangeRegistrar local_state_registrar_; |
| 146 | 146 |
| 147 content::NotificationRegistrar notification_registrar_; | 147 content::NotificationRegistrar notification_registrar_; |
| 148 | 148 |
| 149 // Fires when the user has been idle on the login screen for a set amount of | 149 // Fires when the user has been idle on the login screen for a set amount of |
| 150 // time. | 150 // time. |
| 151 scoped_ptr<base::OneShotTimer<AutomaticRebootManager> > | 151 scoped_ptr<base::OneShotTimer> login_screen_idle_timer_; |
| 152 login_screen_idle_timer_; | |
| 153 | 152 |
| 154 // The time at which the device was booted, in |clock_| ticks. | 153 // The time at which the device was booted, in |clock_| ticks. |
| 155 bool have_boot_time_; | 154 bool have_boot_time_; |
| 156 base::TimeTicks boot_time_; | 155 base::TimeTicks boot_time_; |
| 157 | 156 |
| 158 // The time at which an update was applied and a reboot became necessary to | 157 // The time at which an update was applied and a reboot became necessary to |
| 159 // complete the update process, in |clock_| ticks. | 158 // complete the update process, in |clock_| ticks. |
| 160 bool have_update_reboot_needed_time_; | 159 bool have_update_reboot_needed_time_; |
| 161 base::TimeTicks update_reboot_needed_time_; | 160 base::TimeTicks update_reboot_needed_time_; |
| 162 | 161 |
| 163 // The reason for the reboot request. Updated whenever a reboot is scheduled. | 162 // The reason for the reboot request. Updated whenever a reboot is scheduled. |
| 164 AutomaticRebootManagerObserver::Reason reboot_reason_; | 163 AutomaticRebootManagerObserver::Reason reboot_reason_; |
| 165 | 164 |
| 166 // Whether a reboot has been requested. | 165 // Whether a reboot has been requested. |
| 167 bool reboot_requested_; | 166 bool reboot_requested_; |
| 168 | 167 |
| 169 // Timers that start and end the grace period. | 168 // Timers that start and end the grace period. |
| 170 scoped_ptr<base::OneShotTimer<AutomaticRebootManager> > grace_start_timer_; | 169 scoped_ptr<base::OneShotTimer> grace_start_timer_; |
| 171 scoped_ptr<base::OneShotTimer<AutomaticRebootManager> > grace_end_timer_; | 170 scoped_ptr<base::OneShotTimer> grace_end_timer_; |
| 172 | 171 |
| 173 base::ObserverList<AutomaticRebootManagerObserver, true> observers_; | 172 base::ObserverList<AutomaticRebootManagerObserver, true> observers_; |
| 174 | 173 |
| 175 base::WeakPtrFactory<AutomaticRebootManager> weak_ptr_factory_; | 174 base::WeakPtrFactory<AutomaticRebootManager> weak_ptr_factory_; |
| 176 | 175 |
| 177 DISALLOW_COPY_AND_ASSIGN(AutomaticRebootManager); | 176 DISALLOW_COPY_AND_ASSIGN(AutomaticRebootManager); |
| 178 }; | 177 }; |
| 179 | 178 |
| 180 } // namespace system | 179 } // namespace system |
| 181 } // namespace chromeos | 180 } // namespace chromeos |
| 182 | 181 |
| 183 #endif // CHROME_BROWSER_CHROMEOS_SYSTEM_AUTOMATIC_REBOOT_MANAGER_H_ | 182 #endif // CHROME_BROWSER_CHROMEOS_SYSTEM_AUTOMATIC_REBOOT_MANAGER_H_ |
| OLD | NEW |