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

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

Issue 21443002: Add NOTIFICATION_EXTENSION_REMOVED for Extensions removed from ExtensionService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 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_service.cc
diff --git a/chrome/browser/extensions/extension_service.cc b/chrome/browser/extensions/extension_service.cc
index 42cb3fa69ea9ea451229871e5df976d830fb9cd7..a52cb8f107122a0ea3480b3caec89478821e275d 100644
--- a/chrome/browser/extensions/extension_service.cc
+++ b/chrome/browser/extensions/extension_service.cc
@@ -1888,13 +1888,16 @@ void ExtensionService::UnloadExtension(
// disabled extension is unloaded (since they are also tracking the disabled
// extensions).
system_->UnregisterExtensionWithRequestContexts(extension_id, reason);
- return;
+ } else {
+ // Remove the extension from our list.
+ extensions_.Remove(extension->id());
+ NotifyExtensionUnloaded(extension.get(), reason);
}
- // Remove the extension from our list.
- extensions_.Remove(extension->id());
-
- NotifyExtensionUnloaded(extension.get(), reason);
+ content::NotificationService::current()->Notify(
+ chrome::NOTIFICATION_EXTENSION_REMOVED,
+ content::Source<Profile>(profile_),
+ content::Details<const Extension>(extension.get()));
}
void ExtensionService::UnloadAllExtensions() {
@@ -2599,7 +2602,14 @@ void ExtensionService::TrackTerminatedExtension(const Extension* extension) {
void ExtensionService::UntrackTerminatedExtension(const std::string& id) {
std::string lowercase_id = StringToLowerASCII(id);
+ const Extension* extension = terminated_extensions_.GetByID(lowercase_id);
terminated_extensions_.Remove(lowercase_id);
+ if (extension) {
+ content::NotificationService::current()->Notify(
+ chrome::NOTIFICATION_EXTENSION_REMOVED,
+ content::Source<Profile>(profile_),
+ content::Details<const Extension>(extension));
+ }
}
const Extension* ExtensionService::GetTerminatedExtension(
« no previous file with comments | « chrome/browser/extensions/extension_disabled_ui.cc ('k') | chrome/browser/extensions/external_install_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698