diff options
-rw-r--r-- | chrome/browser/extensions/extension_disabled_infobar_delegate.cc | 3 | ||||
-rw-r--r-- | chrome/browser/extensions/extensions_service.cc | 10 | ||||
-rw-r--r-- | chrome/browser/tab_contents/tab_contents.cc | 5 |
3 files changed, 10 insertions, 8 deletions
diff --git a/chrome/browser/extensions/extension_disabled_infobar_delegate.cc b/chrome/browser/extensions/extension_disabled_infobar_delegate.cc index a1012c0..feaa264 100644 --- a/chrome/browser/extensions/extension_disabled_infobar_delegate.cc +++ b/chrome/browser/extensions/extension_disabled_infobar_delegate.cc @@ -115,6 +115,9 @@ class ExtensionDisabledInfobarDelegate service_, extension_); return true; } + virtual void InfoBarClosed() { + delete this; + } virtual void Observe(NotificationType type, const NotificationSource& source, diff --git a/chrome/browser/extensions/extensions_service.cc b/chrome/browser/extensions/extensions_service.cc index 86d86c5..ae251f7 100644 --- a/chrome/browser/extensions/extensions_service.cc +++ b/chrome/browser/extensions/extensions_service.cc @@ -617,13 +617,9 @@ void ExtensionsService::OnExtensionLoaded(Extension* extension, old = NULL; if (!allow_silent_upgrade) { - // Extension has changed permissions significantly. Disable it and - // notify the user. + // Extension has changed permissions significantly. Disable it. We + // send a notification below. extension_prefs_->SetExtensionState(extension, Extension::DISABLED); - NotificationService::current()->Notify( - NotificationType::EXTENSION_UPDATE_DISABLED, - Source<Profile>(profile_), - Details<Extension>(extension)); } } else { // We already have the extension of the same or older version. @@ -665,11 +661,11 @@ void ExtensionsService::OnExtensionLoaded(Extension* extension, } break; case Extension::DISABLED: + disabled_extensions_.push_back(scoped_extension.release()); NotificationService::current()->Notify( NotificationType::EXTENSION_UPDATE_DISABLED, Source<Profile>(profile_), Details<Extension>(extension)); - disabled_extensions_.push_back(scoped_extension.release()); break; default: NOTREACHED(); diff --git a/chrome/browser/tab_contents/tab_contents.cc b/chrome/browser/tab_contents/tab_contents.cc index fd97827..06801fd 100644 --- a/chrome/browser/tab_contents/tab_contents.cc +++ b/chrome/browser/tab_contents/tab_contents.cc @@ -865,8 +865,11 @@ void TabContents::AddInfoBar(InfoBarDelegate* delegate) { // Look through the existing InfoBarDelegates we have for a match. If we've // already got one that matches, then we don't add the new one. for (int i = 0; i < infobar_delegate_count(); ++i) { - if (GetInfoBarDelegateAt(i)->EqualsDelegate(delegate)) + if (GetInfoBarDelegateAt(i)->EqualsDelegate(delegate)) { + // Tell the new infobar to close so that it can clean itself up. + delegate->InfoBarClosed(); return; + } } infobar_delegates_.push_back(delegate); |