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

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

Issue 213313007: Revert of Extract RuntimeEventRouter from extensions Runtime API (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
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 463fab0601036888a30c2bbc9c005de328a4718e..6e65e1b704cefa195cd1a124d3ae0757c42b0401 100644
--- a/chrome/browser/extensions/api/runtime/runtime_api.h
+++ b/chrome/browser/extensions/api/runtime/runtime_api.h
@@ -8,12 +8,17 @@
#include <string>
#include "chrome/browser/extensions/chrome_extension_function.h"
+#include "chrome/common/extensions/api/runtime.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
#include "extensions/browser/browser_context_keyed_api_factory.h"
#include "extensions/browser/update_observer.h"
class Profile;
+
+namespace base {
+class Version;
+}
namespace content {
class BrowserContext;
@@ -48,10 +53,6 @@
void OnExtensionInstalled(const Extension* extension);
void OnExtensionUninstalled(const Extension* extension);
- // Shows the uninstall URL in a new tab.
- static void ShowUninstallURL(Profile* profile,
- const std::string& extension_id);
-
// BrowserContextKeyedAPI implementation:
static const char* service_name() { return "RuntimeAPI"; }
static const bool kServiceRedirectedInIncognito = true;
@@ -74,6 +75,38 @@
content::NotificationRegistrar registrar_;
DISALLOW_COPY_AND_ASSIGN(RuntimeAPI);
+};
+
+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(
+ Profile* profile,
+ const std::string& extension_id,
+ const base::DictionaryValue* manifest);
+
+ // 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,
+ api::runtime::OnRestartRequired::Reason reason);
+
+ // Does any work needed at extension uninstall (e.g. load uninstall url).
+ static void OnExtensionUninstalled(Profile* profile,
+ const std::string& extension_id);
};
class RuntimeGetBackgroundPageFunction : public ChromeAsyncExtensionFunction {
« no previous file with comments | « chrome/browser/chromeos/app_mode/kiosk_app_update_service.cc ('k') | chrome/browser/extensions/api/runtime/runtime_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698