Chromium Code Reviews| Index: chrome/browser/extensions/extensions_service.cc |
| diff --git a/chrome/browser/extensions/extensions_service.cc b/chrome/browser/extensions/extensions_service.cc |
| index ef6d9cdf1012d3cb026b3effbbd646f0a58a7b1d..d681e83d5f58023b830c0f64c5f4ddc672896044 100644 |
| --- a/chrome/browser/extensions/extensions_service.cc |
| +++ b/chrome/browser/extensions/extensions_service.cc |
| @@ -127,9 +127,6 @@ void ExtensionsService::Init() { |
| // the first extension, because its members listen for loaded notifications. |
| g_browser_process->resource_dispatcher_host(); |
| - // Start up the extension event routers. |
| - ExtensionBrowserEventRouter::GetInstance()->Init(); |
| - |
| LoadAllExtensions(); |
| // TODO(erikkay) this should probably be deferred to a future point |
| @@ -508,6 +505,12 @@ void ExtensionsService::OnExtensionLoaded(Extension* extension, |
| case Extension::ENABLED: |
| extensions_.push_back(scoped_extension.release()); |
| + // We delay starting up the browser event router until at least one |
| + // extension that needs it is loaded. |
| + if (extension->HasApiPermission(Extension::kTabPermission)) { |
| + ExtensionBrowserEventRouter::GetInstance()->Init(); |
|
Evan Martin
2009/10/29 01:56:29
Are you certain there's no other way for this to b
Aaron Boodman
2009/10/29 04:03:25
I don't understand.
rafaelw
2009/10/29 04:08:46
Don't need braces
On 2009/10/29 01:56:29, Evan Ma
|
| + } |
| + |
| if (extension->location() != Extension::LOAD) |
| extension_prefs_->MigrateToPrefs(extension); |