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

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

Issue 10274013: Revert order of EXTENSION_LOADED and EXTENSION_INSTALLED notifications back to (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: compile fix Created 8 years, 8 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.cc
diff --git a/chrome/browser/extensions/api/runtime/runtime_api.cc b/chrome/browser/extensions/api/runtime/runtime_api.cc
index 9e6998ec67cbf8361a5ebe14f9db71aed7d0bfa9..31425653aa352db0e1785e81f8ff2acae31b20df 100644
--- a/chrome/browser/extensions/api/runtime/runtime_api.cc
+++ b/chrome/browser/extensions/api/runtime/runtime_api.cc
@@ -25,16 +25,19 @@ namespace extensions {
// static
void RuntimeEventRouter::DispatchOnInstalledEvent(
- Profile* profile, const Extension* extension) {
+ Profile* profile, const std::string& extension_id) {
+ ExtensionSystem* system = ExtensionSystem::Get(profile);
+ if (!system)
+ return;
+
// Special case: normally, extensions add their own lazy event listeners.
// However, since the extension has just been installed, it hasn't had a
// chance to register for events. So we register on its behalf. If the
// extension does not actually have a listener, the event will just be
// ignored.
- ExtensionEventRouter* router = profile->GetExtensionEventRouter();
- router->AddLazyEventListener(kOnInstalledEvent, extension->id());
- router->DispatchEventToExtension(
- extension->id(), kOnInstalledEvent, "[]", NULL, GURL());
+ system->event_router()->AddLazyEventListener(kOnInstalledEvent, extension_id);
+ system->event_router()->DispatchEventToExtension(
+ extension_id, kOnInstalledEvent, "[]", NULL, GURL());
}
bool RuntimeGetBackgroundPageFunction::RunImpl() {
« no previous file with comments | « chrome/browser/extensions/api/runtime/runtime_api.h ('k') | chrome/browser/extensions/component_loader_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698