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

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

Issue 5968009: Change extension unload notification to indicate updates.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years 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_disabled_infobar_delegate.cc
===================================================================
--- chrome/browser/extensions/extension_disabled_infobar_delegate.cc (revision 69996)
+++ chrome/browser/extensions/extension_disabled_infobar_delegate.cc (working copy)
@@ -70,7 +70,7 @@
// The user might re-enable the extension in other ways, so watch for that.
registrar_.Add(this, NotificationType::EXTENSION_LOADED,
Source<Profile>(service->profile()));
- registrar_.Add(this, NotificationType::EXTENSION_UNLOADED_DISABLED,
+ registrar_.Add(this, NotificationType::EXTENSION_UNLOADED,
Source<Profile>(service->profile()));
}
virtual ~ExtensionDisabledInfobarDelegate() {
@@ -106,17 +106,24 @@
const NotificationDetails& details) {
// TODO(mpcomplete): RemoveInfoBar doesn't seem to always result in us
// getting deleted.
+ const Extension* extension = NULL;
switch (type.value) {
case NotificationType::EXTENSION_LOADED:
- case NotificationType::EXTENSION_UNLOADED_DISABLED: {
- const Extension* extension = Details<const Extension>(details).ptr();
- if (extension == extension_)
- tab_contents_->RemoveInfoBar(this);
+ extension = Details<const Extension>(details).ptr();
break;
+ case NotificationType::EXTENSION_UNLOADED: {
+ UnloadedExtensionInfo* info =
+ Details<UnloadedExtensionInfo>(details).ptr();
+ if (info->reason == UnloadedExtensionInfo::DISABLE)
+ extension = info->extension;
+ break;
}
default:
NOTREACHED();
+ return;
}
+ if (extension == extension_)
+ tab_contents_->RemoveInfoBar(this);
}
private:

Powered by Google App Engine
This is Rietveld 408576698