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

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

Issue 6546072: Clean up how we handle themes in the extensions system and management API.... Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 10 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/extension_management_api.cc
===================================================================
--- chrome/browser/extensions/extension_management_api.cc (revision 75613)
+++ chrome/browser/extensions/extension_management_api.cc (working copy)
@@ -37,6 +37,7 @@
const char kIconsKey[] = "icons";
const char kIdKey[] = "id";
const char kIsAppKey[] = "isApp";
+const char kIsThemeKey[] = "isTheme";
const char kNameKey[] = "name";
const char kOptionsUrlKey[] = "optionsUrl";
const char kPermissionsKey[] = "permissions";
@@ -57,6 +58,7 @@
DictionaryValue* info = new DictionaryValue();
info->SetString(kIdKey, extension.id());
info->SetBoolean(kIsAppKey, extension.is_app());
+ info->SetBoolean(kIsThemeKey, extension.is_theme());
info->SetString(kNameKey, extension.name());
info->SetBoolean(kEnabledKey, enabled);
info->SetString(kVersionKey, extension.VersionString());
@@ -220,11 +222,6 @@
return true;
}
-// static
-ExtensionManagementEventRouter* ExtensionManagementEventRouter::GetInstance() {
- return Singleton<ExtensionManagementEventRouter>::get();
-}
-
ExtensionManagementEventRouter::ExtensionManagementEventRouter() {}
ExtensionManagementEventRouter::~ExtensionManagementEventRouter() {}
@@ -278,7 +275,14 @@
} else {
const Extension* extension = NULL;
if (event_name == events::kOnExtensionDisabled) {
- extension = Details<UnloadedExtensionInfo>(details)->extension;
+ UnloadedExtensionInfo* info =
+ Details<UnloadedExtensionInfo>(details).ptr();
+ // If the extension was already disabled, we don't want to send another
+ // notification about it.
+ if (info->already_disabled)
+ return;
+
+ extension = info->extension;
} else {
extension = Details<const Extension>(details).ptr();
}

Powered by Google App Engine
This is Rietveld 408576698