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

Unified Diff: ash/common/system/toast/toast_overlay.cc

Issue 2150603003: Prevent hiding a toast during animation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix test failures Created 4 years, 5 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
« no previous file with comments | « no previous file | ash/system/toast/toast_manager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/system/toast/toast_overlay.cc
diff --git a/ash/common/system/toast/toast_overlay.cc b/ash/common/system/toast/toast_overlay.cc
index 87d49c687e703ab71e236c569190dc65a394d786..868834144974974ef1a097a16d19d23660aec867 100644
--- a/ash/common/system/toast/toast_overlay.cc
+++ b/ash/common/system/toast/toast_overlay.cc
@@ -253,6 +253,13 @@ void ToastOverlay::Show(bool visible) {
ui::LayerAnimator* animator = overlay_widget_->GetLayer()->GetAnimator();
DCHECK(animator);
+ if (animator->is_animating()) {
+ // Showing during hiding animation doesn't happen since, ToastOverlay should
+ // be one-time-use and not be reused.
+ DCHECK(!visible);
+
+ return;
+ }
base::TimeDelta original_duration = animator->GetTransitionDuration();
ui::ScopedLayerAnimationSettings animation_settings(animator);
« no previous file with comments | « no previous file | ash/system/toast/toast_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698