summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/browser.cc11
1 files changed, 6 insertions, 5 deletions
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc
index 0a652d4..97eabe8 100644
--- a/chrome/browser/browser.cc
+++ b/chrome/browser/browser.cc
@@ -2435,15 +2435,16 @@ void Browser::Observe(NotificationType type,
if (!tab_contents)
break;
Extension* extension = Details<Extension>(details).ptr();
- int delegate_count = tab_contents->infobar_delegate_count();
CrashedExtensionInfoBarDelegate* delegate = NULL;
- for (int i = 0; i < delegate_count; ++i) {
+ for (int i = 0; i < tab_contents->infobar_delegate_count();) {
delegate = tab_contents->GetInfoBarDelegateAt(i)->
AsCrashedExtensionInfoBarDelegate();
- if (!delegate)
- continue;
- if (extension->id() == delegate->extension_id())
+ if (delegate && delegate->extension_id() == extension->id()) {
tab_contents->RemoveInfoBar(delegate);
+ continue;
+ }
+ // Only increment |i| if we didn't remove an entry.
+ ++i;
}
break;
}