Index: components/infobars/core/infobar_container.cc |
diff --git a/components/infobars/core/infobar_container.cc b/components/infobars/core/infobar_container.cc |
index c3bd8e2a9829b40096fed59613ce3f9d6d9a52b0..5013260b46c749dead590e2b01d32c3761249fd3 100644 |
--- a/components/infobars/core/infobar_container.cc |
+++ b/components/infobars/core/infobar_container.cc |
@@ -123,7 +123,8 @@ void InfoBarContainer::OnInfoBarAdded(InfoBar* infobar) { |
} |
void InfoBarContainer::OnInfoBarRemoved(InfoBar* infobar, bool animate) { |
- infobar->Hide(animate); |
+ DCHECK(infobar_manager_); |
+ infobar->Hide(infobar_manager_->animations_enabled() && animate); |
UpdateInfoBarArrowTargetHeights(); |
} |
@@ -154,7 +155,8 @@ void InfoBarContainer::AddInfoBar(InfoBar* infobar, |
UpdateInfoBarArrowTargetHeights(); |
PlatformSpecificAddInfoBar(infobar, position); |
infobar->set_container(this); |
- infobar->Show(animate); |
+ DCHECK(infobar_manager_); |
+ infobar->Show(infobar_manager_->animations_enabled() && animate); |
// Record the infobar being displayed. |
DCHECK_NE(InfoBarDelegate::INVALID, infobar->delegate()->GetIdentifier()); |