| 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 --------------------------------------------------------------------
|
|
|