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

Unified Diff: components/infobars/core/infobar.cc

Issue 2705293008: Disable info bar animations during automated testing. (Closed)
Patch Set: add DCHECKs Created 3 years, 10 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
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();

Powered by Google App Engine
This is Rietveld 408576698