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

Unified Diff: chrome/browser/extensions/api/runtime/runtime_api.h

Issue 16844020: app_mode: Add runtime.onRestartRequired event. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: restore onBrowserUpdateAvailable and address comments in #2 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/extensions/api/runtime/runtime_api.h
diff --git a/chrome/browser/extensions/api/runtime/runtime_api.h b/chrome/browser/extensions/api/runtime/runtime_api.h
index 4baa2f4c61f6bb119b458aa163a3d7b02c53730b..b9e50c9deb178e14237ae7096e925c8fe41fac45 100644
--- a/chrome/browser/extensions/api/runtime/runtime_api.h
+++ b/chrome/browser/extensions/api/runtime/runtime_api.h
@@ -5,6 +5,8 @@
#ifndef CHROME_BROWSER_EXTENSIONS_API_RUNTIME_RUNTIME_API_H_
#define CHROME_BROWSER_EXTENSIONS_API_RUNTIME_RUNTIME_API_H_
+#include <string>
+
#include "chrome/browser/extensions/extension_function.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
@@ -21,6 +23,13 @@ class ExtensionHost;
class RuntimeEventRouter {
public:
+ enum RestartReason {
+ RESTART_REASON_UNKNOWN,
+ RESTART_REASON_APP_UPDATE,
+ RESTART_REASON_OS_UPDATE,
+ RESTART_REASON_PERIODIC,
+ };
+
// Dispatches the onStartup event to all currently-loaded extensions.
static void DispatchOnStartupEvent(Profile* profile,
const std::string& extension_id);
@@ -40,6 +49,11 @@ class RuntimeEventRouter {
// Dispatches the onBrowserUpdateAvailable event to all extensions.
static void DispatchOnBrowserUpdateAvailableEvent(Profile* profile);
+ // Dispatches the onRestartRequired event to the given app.
+ static void DispatchOnRestartRequiredEvent(Profile* profile,
+ const std::string& app_id,
+ RestartReason reason);
+
// Does any work needed at extension uninstall (e.g. load uninstall url).
static void OnExtensionUninstalled(Profile* profile,
const std::string& extension_id);

Powered by Google App Engine
This is Rietveld 408576698