Chromium Code Reviews| Index: components/infobars/core/infobar.cc |
| diff --git a/components/infobars/core/infobar.cc b/components/infobars/core/infobar.cc |
| index e25a8ea1ba4afd2f595194ec1ad29fe8e304aa25..e6a17cf515da4a34d0380630b0da0a8e190707bd 100644 |
| --- a/components/infobars/core/infobar.cc |
| +++ b/components/infobars/core/infobar.cc |
| @@ -53,6 +53,9 @@ void InfoBar::SetOwner(InfoBarManager* owner) { |
| } |
| void InfoBar::Show(bool animate) { |
| + DCHECK(owner_); |
| + if (!owner_->animations_enabled()) |
| + animate = false; |
|
Peter Kasting
2017/02/23 00:33:55
Nit: Shorter:
animate &= owner_->animations_ena
samuong
2017/02/23 00:45:26
Done.
|
| PlatformSpecificShow(animate); |
| if (animate) { |
| animation_.Show(); |
| @@ -63,6 +66,9 @@ void InfoBar::Show(bool animate) { |
| } |
| void InfoBar::Hide(bool animate) { |
| + DCHECK(owner_); |
| + if (!owner_->animations_enabled()) |
| + animate = false; |
| PlatformSpecificHide(animate); |
| if (animate) { |
| animation_.Hide(); |