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

Unified Diff: chrome/browser/chromeos/app_mode/kiosk_app_update_service.h

Issue 16844020: app_mode: Add runtime.onRestartRequired event. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 6 months 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/app_mode/kiosk_app_update_service.h
diff --git a/chrome/browser/chromeos/app_mode/kiosk_app_update_service.h b/chrome/browser/chromeos/app_mode/kiosk_app_update_service.h
index 7421a81a3db7655eee6cfa31f968f293e3fc9446..729da7fad389254917966911e01002de900acf6a 100644
--- a/chrome/browser/chromeos/app_mode/kiosk_app_update_service.h
+++ b/chrome/browser/chromeos/app_mode/kiosk_app_update_service.h
@@ -11,6 +11,7 @@
#include "base/compiler_specific.h"
#include "base/memory/singleton.h"
#include "base/timer.h"
+#include "chrome/browser/chromeos/system/automatic_reboot_manager_observer.h"
#include "chrome/browser/extensions/update_observer.h"
#include "components/browser_context_keyed_service/browser_context_keyed_service.h"
#include "components/browser_context_keyed_service/browser_context_keyed_service_factory.h"
@@ -19,34 +20,48 @@ class Profile;
namespace chromeos {
+namespace system {
+class AutomaticRebootManager;
+}
+
// This class enforces automatic restart on app and Chrome updates in app mode.
class KioskAppUpdateService : public BrowserContextKeyedService,
- public extensions::UpdateObserver {
+ public extensions::UpdateObserver,
+ public system::AutomaticRebootManagerObserver {
public:
- explicit KioskAppUpdateService(Profile* profile);
+ KioskAppUpdateService(
+ Profile* profile,
+ system::AutomaticRebootManager* automatic_reboot_manager);
virtual ~KioskAppUpdateService();
void set_app_id(const std::string& app_id) { app_id_ = app_id; }
std::string get_app_id() const { return app_id_; }
private:
- void StartRestartTimer();
- void ForceRestart();
+ friend class KioskAppUpdateServiceTest;
+
+ void StartAppUpdateRestartTimer();
+ void ForceAppUpdateRestart();
+
+ // BrowserContextKeyedService overrides:
+ virtual void Shutdown() OVERRIDE;
// extensions::UpdateObserver overrides:
virtual void OnAppUpdateAvailable(const std::string& app_id) OVERRIDE;
virtual void OnChromeUpdateAvailable() OVERRIDE {}
- // BrowserContextKeyedService overrides:
- virtual void Shutdown() OVERRIDE;
+ // system::AutomaticRebootManagerObserver overrides:
+ virtual void OnRebootScheduled(Reason reason) OVERRIDE;
+ virtual void WillDestroyAutomaticRebootManager() OVERRIDE;
- private:
Profile* profile_;
std::string app_id_;
// After we detect an upgrade we start a one-short timer to force restart.
base::OneShotTimer<KioskAppUpdateService> restart_timer_;
+ system::AutomaticRebootManager* automatic_reboot_manager_; // Not owned.
+
DISALLOW_COPY_AND_ASSIGN(KioskAppUpdateService);
};
« no previous file with comments | « chrome/browser/browser_process_platform_part_chromeos.cc ('k') | chrome/browser/chromeos/app_mode/kiosk_app_update_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698