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

Unified Diff: extensions/browser/api/runtime/runtime_event_router.h

Issue 206613005: Extract RuntimeEventRouter from extensions Runtime API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove from android whitelist (runtime-api) Created 6 years, 9 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
« no previous file with comments | « extensions/browser/DEPS ('k') | extensions/browser/api/runtime/runtime_event_router.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/api/runtime/runtime_event_router.h
diff --git a/extensions/browser/api/runtime/runtime_event_router.h b/extensions/browser/api/runtime/runtime_event_router.h
new file mode 100644
index 0000000000000000000000000000000000000000..7808cffb3c9b181da7262396b82cbc9c4a436d82
--- /dev/null
+++ b/extensions/browser/api/runtime/runtime_event_router.h
@@ -0,0 +1,59 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef EXTENSIONS_BROWSER_API_RUNTIME_RUNTIME_EVENT_ROUTER_H_
+#define EXTENSIONS_BROWSER_API_RUNTIME_RUNTIME_EVENT_ROUTER_H_
+
+#include <string>
+
+#include "base/macros.h"
+#include "chrome/common/extensions/api/runtime.h"
+
+namespace base {
+class DictionaryValue;
+class Version;
+}
+
+namespace content {
+class BrowserContext;
+};
+
+namespace extensions {
+
+// Dispatches events to extensions such as onStartup, onInstalled, etc.
+class RuntimeEventRouter {
+ public:
+ // Dispatches the onStartup event to all currently-loaded extensions.
+ static void DispatchOnStartupEvent(content::BrowserContext* context,
+ const std::string& extension_id);
+
+ // Dispatches the onInstalled event to the given extension.
+ static void DispatchOnInstalledEvent(content::BrowserContext* context,
+ const std::string& extension_id,
+ const base::Version& old_version,
+ bool chrome_updated);
+
+ // Dispatches the onUpdateAvailable event to the given extension.
+ static void DispatchOnUpdateAvailableEvent(
+ content::BrowserContext* context,
+ const std::string& extension_id,
+ const base::DictionaryValue* manifest);
+
+ // Dispatches the onBrowserUpdateAvailable event to all extensions.
+ static void DispatchOnBrowserUpdateAvailableEvent(
+ content::BrowserContext* context);
+
+ // Dispatches the onRestartRequired event to the given app.
+ static void DispatchOnRestartRequiredEvent(
+ content::BrowserContext* context,
+ const std::string& app_id,
+ api::runtime::OnRestartRequired::Reason reason);
+
+ private:
+ DISALLOW_IMPLICIT_CONSTRUCTORS(RuntimeEventRouter);
+};
+
+} // namespace extensions
+
+#endif // EXTENSIONS_BROWSER_API_RUNTIME_RUNTIME_EVENT_ROUTER_H_
« no previous file with comments | « extensions/browser/DEPS ('k') | extensions/browser/api/runtime/runtime_event_router.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698