Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2276)

Unified Diff: chrome/browser/chromeos/system/automatic_reboot_manager.h

Issue 727363002: Fire notifications when reboot is requested, not scheduled (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@managed_cros
Patch Set: Add missing run_loop.Run(); Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/system/automatic_reboot_manager.h
diff --git a/chrome/browser/chromeos/system/automatic_reboot_manager.h b/chrome/browser/chromeos/system/automatic_reboot_manager.h
index 638c9ace6e306fc0a0b25fd80e783fcadcb753ff..5ecf8d6bada4a2f87c0901fec014ce1a3f843a7d 100644
--- a/chrome/browser/chromeos/system/automatic_reboot_manager.h
+++ b/chrome/browser/chromeos/system/automatic_reboot_manager.h
@@ -13,6 +13,7 @@
#include "base/prefs/pref_change_registrar.h"
#include "base/time/time.h"
#include "base/timer/timer.h"
+#include "chrome/browser/chromeos/system/automatic_reboot_manager_observer.h"
#include "chromeos/dbus/power_manager_client.h"
#include "chromeos/dbus/update_engine_client.h"
#include "content/public/browser/notification_observer.h"
@@ -28,8 +29,6 @@ class TickClock;
namespace chromeos {
namespace system {
-class AutomaticRebootManagerObserver;
-
// Schedules and executes automatic reboots.
//
// Automatic reboots may be scheduled for any number of reasons. Currently, the
@@ -93,6 +92,11 @@ class AutomaticRebootManager : public PowerManagerClient::Observer,
explicit AutomaticRebootManager(scoped_ptr<base::TickClock> clock);
virtual ~AutomaticRebootManager();
+ AutomaticRebootManagerObserver::Reason reboot_reason() const {
+ return reboot_reason_;
+ }
+ bool reboot_requested() const { return reboot_requested_; }
+
void AddObserver(AutomaticRebootManagerObserver* observer);
void RemoveObserver(AutomaticRebootManagerObserver* observer);
@@ -157,6 +161,9 @@ class AutomaticRebootManager : public PowerManagerClient::Observer,
bool have_update_reboot_needed_time_;
base::TimeTicks update_reboot_needed_time_;
+ // The reason for the reboot request. Updated whenever a reboot is scheduled.
+ AutomaticRebootManagerObserver::Reason reboot_reason_;
+
// Whether a reboot has been requested.
bool reboot_requested_;

Powered by Google App Engine
This is Rietveld 408576698