| Index: chrome/browser/chromeos/system/automatic_reboot_manager.cc
|
| diff --git a/chrome/browser/chromeos/system/automatic_reboot_manager.cc b/chrome/browser/chromeos/system/automatic_reboot_manager.cc
|
| index 81d6dcdfc3ff888994f99c15c930ea47013388f9..f6855e3337d7c12e9ae86740369eb9846bf0e13e 100644
|
| --- a/chrome/browser/chromeos/system/automatic_reboot_manager.cc
|
| +++ b/chrome/browser/chromeos/system/automatic_reboot_manager.cc
|
| @@ -32,7 +32,6 @@
|
| #include "base/time/tick_clock.h"
|
| #include "chrome/browser/browser_process.h"
|
| #include "chrome/browser/chrome_notification_types.h"
|
| -#include "chrome/browser/chromeos/system/automatic_reboot_manager_observer.h"
|
| #include "chrome/common/pref_names.h"
|
| #include "chromeos/chromeos_paths.h"
|
| #include "chromeos/chromeos_switches.h"
|
| @@ -151,6 +150,7 @@ AutomaticRebootManager::AutomaticRebootManager(
|
| : clock_(clock.Pass()),
|
| have_boot_time_(false),
|
| have_update_reboot_needed_time_(false),
|
| + reboot_reason_(AutomaticRebootManagerObserver::REBOOT_REASON_UNKNOWN),
|
| reboot_requested_(false),
|
| weak_ptr_factory_(this) {
|
| local_state_registrar_.Init(g_browser_process->local_state());
|
| @@ -317,8 +317,6 @@ void AutomaticRebootManager::Reschedule() {
|
| reboot_requested_ = false;
|
|
|
| const base::TimeDelta kZeroTimeDelta;
|
| - AutomaticRebootManagerObserver::Reason reboot_reason =
|
| - AutomaticRebootManagerObserver::REBOOT_REASON_UNKNOWN;
|
|
|
| // If an uptime limit is set, calculate the time at which it should cause a
|
| // reboot to be requested.
|
| @@ -327,7 +325,7 @@ void AutomaticRebootManager::Reschedule() {
|
| base::TimeTicks reboot_request_time = boot_time_ + uptime_limit;
|
| bool have_reboot_request_time = uptime_limit != kZeroTimeDelta;
|
| if (have_reboot_request_time)
|
| - reboot_reason = AutomaticRebootManagerObserver::REBOOT_REASON_PERIODIC;
|
| + reboot_reason_ = AutomaticRebootManagerObserver::REBOOT_REASON_PERIODIC;
|
|
|
| // If the policy to automatically reboot after an update is enabled and an
|
| // update has been applied, set the time at which a reboot should be
|
| @@ -339,7 +337,7 @@ void AutomaticRebootManager::Reschedule() {
|
| update_reboot_needed_time_ < reboot_request_time)) {
|
| reboot_request_time = update_reboot_needed_time_;
|
| have_reboot_request_time = true;
|
| - reboot_reason = AutomaticRebootManagerObserver::REBOOT_REASON_OS_UPDATE;
|
| + reboot_reason_ = AutomaticRebootManagerObserver::REBOOT_REASON_OS_UPDATE;
|
| }
|
|
|
| // If no reboot should be requested, remove any grace period.
|
| @@ -375,15 +373,15 @@ void AutomaticRebootManager::Reschedule() {
|
| base::Bind(&AutomaticRebootManager::Reboot,
|
| base::Unretained(this)));
|
|
|
| - DCHECK_NE(AutomaticRebootManagerObserver::REBOOT_REASON_UNKNOWN,
|
| - reboot_reason);
|
| - FOR_EACH_OBSERVER(AutomaticRebootManagerObserver,
|
| - observers_,
|
| - OnRebootScheduled(reboot_reason));
|
| }
|
|
|
| void AutomaticRebootManager::RequestReboot() {
|
| reboot_requested_ = true;
|
| + DCHECK_NE(AutomaticRebootManagerObserver::REBOOT_REASON_UNKNOWN,
|
| + reboot_reason_);
|
| + FOR_EACH_OBSERVER(AutomaticRebootManagerObserver,
|
| + observers_,
|
| + OnRebootRequested(reboot_reason_));
|
| MaybeReboot(false);
|
| }
|
|
|
|
|