Chromium Code Reviews| Index: chrome/browser/extensions/extensions_service.cc |
| =================================================================== |
| --- chrome/browser/extensions/extensions_service.cc (revision 17327) |
| +++ chrome/browser/extensions/extensions_service.cc (working copy) |
| @@ -326,22 +326,29 @@ |
| } |
| void ExtensionsService::OnExtensionsLoaded(ExtensionList* new_extensions) { |
| - extensions_.insert(extensions_.end(), new_extensions->begin(), |
| - new_extensions->end()); |
| - NotificationService::current()->Notify( |
| - NotificationType::EXTENSIONS_LOADED, |
| - NotificationService::AllSources(), |
| - Details<ExtensionList>(new_extensions)); |
| + // If extensions aren't enabled, we still want to add themes. However, themes |
| + // should not trigger EXTENSIONS_LOADED. |
| + bool has_extension = false; |
| + for (ExtensionList::iterator iter = new_extensions->begin(); |
| + iter != new_extensions->end(); ++iter) { |
| + if (extensions_enabled() || (*iter)->IsTheme()) { |
| + extensions_.push_back(*iter); |
| + if (!(*iter)->IsTheme()) |
| + has_extension = true; |
| + } |
| + } |
| + |
| + if (has_extension) { |
|
Aaron Boodman
2009/06/01 23:44:36
Can you add:
TODO(aa): This can be re-enabled whe
|
| + NotificationService::current()->Notify( |
| + NotificationType::EXTENSIONS_LOADED, |
| + NotificationService::AllSources(), |
| + Details<ExtensionList>(new_extensions)); |
| + } |
| delete new_extensions; |
| } |
| void ExtensionsService::OnExtensionInstalled(Extension* extension, |
| bool update) { |
| - NotificationService::current()->Notify( |
| - NotificationType::EXTENSION_INSTALLED, |
| - NotificationService::AllSources(), |
| - Details<Extension>(extension)); |
| - |
| // If the extension is a theme, tell the profile (and therefore ThemeProvider) |
| // to apply it. |
| if (extension->IsTheme()) { |
| @@ -349,6 +356,11 @@ |
| NotificationType::THEME_INSTALLED, |
| NotificationService::AllSources(), |
| Details<Extension>(extension)); |
| + } else { |
| + NotificationService::current()->Notify( |
| + NotificationType::EXTENSION_INSTALLED, |
| + NotificationService::AllSources(), |
| + Details<Extension>(extension)); |
| } |
| } |