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

Unified Diff: chrome/browser/extensions/extensions_service.cc

Issue 115974: The extensions service wasn't getting inited despite being used by themes (th... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 7 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 | « no previous file | chrome/browser/extensions/extensions_service_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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));
}
}
« no previous file with comments | « no previous file | chrome/browser/extensions/extensions_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698