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

Unified Diff: chrome/browser/extensions/extension_disabled_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/chrome_notification_types.h ('k') | chrome/browser/extensions/extension_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_disabled_ui.cc
diff --git a/chrome/browser/extensions/extension_disabled_ui.cc b/chrome/browser/extensions/extension_disabled_ui.cc
index d1c3b5c3c9a260ac3ac90454394b1be90f37bbf1..42767a1bf1f50f90fb4f771d9bf01f22a57dbf10 100644
--- a/chrome/browser/extensions/extension_disabled_ui.cc
+++ b/chrome/browser/extensions/extension_disabled_ui.cc
@@ -211,7 +211,7 @@ ExtensionDisabledGlobalError::ExtensionDisabledGlobalError(
}
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()));
}
@@ -318,27 +318,20 @@ void ExtensionDisabledGlobalError::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_) {
- GlobalErrorServiceFactory::GetForProfile(service_->profile())->
- RemoveGlobalError(this);
-
- if (type == chrome::NOTIFICATION_EXTENSION_LOADED)
- user_response_ = REENABLE;
- else if (type == chrome::NOTIFICATION_EXTENSION_UNLOADED)
- user_response_ = UNINSTALL;
- 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;
+ GlobalErrorServiceFactory::GetForProfile(service_->profile())->
+ RemoveGlobalError(this);
+
+ if (type == chrome::NOTIFICATION_EXTENSION_LOADED)
+ user_response_ = REENABLE;
+ else if (type == chrome::NOTIFICATION_EXTENSION_REMOVED)
+ user_response_ = UNINSTALL;
+ delete this;
}
// Globals --------------------------------------------------------------------
« no previous file with comments | « chrome/browser/chrome_notification_types.h ('k') | chrome/browser/extensions/extension_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698