Remove all infobars from a tab when its renderer crashes.
They are irrelevant in the sad tab.

BUG=36035
TEST=Navigate to a foreign page so the translate infobar shows up.
     From the task manager, kill the renderer process for that page.
     The translate infobar should disappear.

Review URL: http://codereview.chromium.org/646023

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39381 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/browser/tab_contents/tab_contents.cc b/chrome/browser/tab_contents/tab_contents.cc
index 359a6c9..d6632bb 100644
--- a/chrome/browser/tab_contents/tab_contents.cc
+++ b/chrome/browser/tab_contents/tab_contents.cc
@@ -2127,6 +2127,10 @@
   NotifyDisconnected();
   SetIsCrashed(true);
 
+  // Remove all infobars.
+  for (int i = 0; i < infobar_delegate_count(); ++i)
+    RemoveInfoBar(GetInfoBarDelegateAt(i));
+
   // Tell the view that we've crashed so it can prepare the sad tab page.
   // Only do this if we're not in browser shutdown, so that TabContents
   // objects that are not in a browser (e.g., HTML dialogs) and thus are