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

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

Issue 7003068: Fix crash when you uninstall a permissions-upgrade disabled extension. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: initialize extension to NULL Created 9 years, 6 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 | « no previous file | chrome/browser/extensions/extension_management_browsertest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/extension_disabled_infobar_delegate.cc
diff --git a/chrome/browser/extensions/extension_disabled_infobar_delegate.cc b/chrome/browser/extensions/extension_disabled_infobar_delegate.cc
index 94cbde5a778b5c6e4bf1104a88acf4bc11cbbf66..96228afd57451c64b6bb0e8a6ae71b7b09d272d1 100644
--- a/chrome/browser/extensions/extension_disabled_infobar_delegate.cc
+++ b/chrome/browser/extensions/extension_disabled_infobar_delegate.cc
@@ -152,14 +152,15 @@ void ExtensionDisabledInfobarDelegate::Observe(
const NotificationDetails& details) {
// TODO(mpcomplete): RemoveInfoBar doesn't seem to always result in us getting
// deleted.
- const Extension* extension;
+ const Extension* extension = NULL;
if (type.value == NotificationType::EXTENSION_LOADED) {
extension = Details<const Extension>(details).ptr();
} else {
DCHECK_EQ(NotificationType::EXTENSION_UNLOADED, type.value);
UnloadedExtensionInfo* info = Details<UnloadedExtensionInfo>(details).ptr();
- extension = (info->reason == UnloadedExtensionInfo::DISABLE) ?
- info->extension : NULL;
+ if (info->reason == UnloadedExtensionInfo::DISABLE ||
+ info->reason == UnloadedExtensionInfo::UNINSTALL)
+ extension = info->extension;
}
if (extension == extension_)
tab_contents_->RemoveInfoBar(this);
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_management_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698