Index: ash/wm/panels/panel_layout_manager.cc |
diff --git a/ash/wm/panels/panel_layout_manager.cc b/ash/wm/panels/panel_layout_manager.cc |
index 690c23ace74a606191237ec10af75fa89875fcda..cfbeb6c27c647df3f9f4caf46d21809782963f14 100644 |
--- a/ash/wm/panels/panel_layout_manager.cc |
+++ b/ash/wm/panels/panel_layout_manager.cc |
@@ -848,16 +848,13 @@ void PanelLayoutManager::UpdateCallouts() { |
SetChildBoundsDirect(callout_widget->GetNativeWindow(), callout_bounds); |
panel_container_->StackChildAbove(callout_widget->GetNativeWindow(), |
panel); |
- callout_widget->Show(); |
ui::Layer* layer = callout_widget->GetNativeWindow()->layer(); |
// If the panel is not over the callout position or has just become visible |
// then fade in the callout. |
- if ((distance_until_over_panel > 0 || layer->GetTargetOpacity() < 1) && |
- panel->layer()->GetTargetTransform().IsIdentity()) { |
+ if ((distance_until_over_panel > 0 || layer->GetTargetOpacity() < 1)) { |
if (distance_until_over_panel > 0 && |
slide_distance >= distance_until_over_panel) { |
- layer->SetOpacity(0); |
// If the panel is not yet over the callout, then delay fading in |
// the callout until after the panel should be over it. |
int delay = kPanelSlideDurationMilliseconds * |
@@ -868,16 +865,18 @@ void PanelLayoutManager::UpdateCallouts() { |
base::TimeDelta::FromMilliseconds(delay), |
ui::LayerAnimationElement::OPACITY); |
} |
- { |
- ui::ScopedLayerAnimationSettings callout_settings(layer->GetAnimator()); |
- callout_settings.SetPreemptionStrategy( |
- ui::LayerAnimator::REPLACE_QUEUED_ANIMATIONS); |
- callout_settings.SetTransitionDuration( |
- base::TimeDelta::FromMilliseconds( |
- kCalloutFadeDurationMilliseconds)); |
- layer->SetOpacity(1); |
- } |
+ ui::ScopedLayerAnimationSettings callout_settings(layer->GetAnimator()); |
+ callout_settings.SetPreemptionStrategy( |
+ ui::LayerAnimator::REPLACE_QUEUED_ANIMATIONS); |
+ callout_settings.SetTransitionDuration( |
+ base::TimeDelta::FromMilliseconds( |
+ kCalloutFadeDurationMilliseconds)); |
+ layer->SetOpacity(1); |
} |
+ |
+ // Show after changing the opacity animation. This way we don't have a |
+ // state where the widget is visible but the opacity is 0. |
+ callout_widget->Show(); |
} |
} |