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

Unified Diff: chrome/browser/extensions/external_install_ui.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
« no previous file with comments | « chrome/browser/extensions/extension_service.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/external_install_ui.cc
diff --git a/chrome/browser/extensions/external_install_ui.cc b/chrome/browser/extensions/external_install_ui.cc
index 0888c976cb227e126c5454adc8f7e8d4d3f5e9ac..d2771943e6da391566e271701d14dd8df5aa8690 100644
--- a/chrome/browser/extensions/external_install_ui.cc
+++ b/chrome/browser/extensions/external_install_ui.cc
@@ -244,7 +244,7 @@ ExternalInstallMenuAlert::ExternalInstallMenuAlert(
extension_(extension) {
registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_LOADED,
content::Source<Profile>(service->profile()));
- registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_UNLOADED,
+ registrar_.Add(this, chrome::NOTIFICATION_EXTENSION_REMOVED,
content::Source<Profile>(service->profile()));
}
@@ -315,23 +315,17 @@ void ExternalInstallMenuAlert::Observe(
int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) {
- const Extension* extension = NULL;
- // The error is invalidated if the extension has been reloaded or unloaded.
- if (type == chrome::NOTIFICATION_EXTENSION_LOADED) {
- extension = content::Details<const Extension>(details).ptr();
- } else {
- DCHECK_EQ(chrome::NOTIFICATION_EXTENSION_UNLOADED, type);
- extensions::UnloadedExtensionInfo* info =
- content::Details<extensions::UnloadedExtensionInfo>(details).ptr();
- extension = info->extension;
- }
- if (extension == extension_) {
- GlobalErrorService* error_service =
- GlobalErrorServiceFactory::GetForProfile(service_->profile());
- error_service->RemoveGlobalError(this);
- service_->AcknowledgeExternalExtension(extension_->id());
- delete this;
- }
+ // The error is invalidated if the extension has been loaded or removed.
+ DCHECK(type == chrome::NOTIFICATION_EXTENSION_LOADED ||
+ type == chrome::NOTIFICATION_EXTENSION_REMOVED);
+ const Extension* extension = content::Details<const Extension>(details).ptr();
+ if (extension != extension_)
+ return;
+ GlobalErrorService* error_service =
+ GlobalErrorServiceFactory::GetForProfile(service_->profile());
+ error_service->RemoveGlobalError(this);
+ service_->AcknowledgeExternalExtension(extension_->id());
+ delete this;
}
// ExternalInstallGlobalError -----------------------------------------------
« no previous file with comments | « chrome/browser/extensions/extension_service.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698