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..14dd477e4057bd0c22e09c9ff5f484d41240faef 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,17 @@ 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 the window after we have started the opacity animation. |
sky
2014/03/18 20:13:11
I'll say it again, don't document what the code do
Mr4D (OOO till 08-26)
2014/03/18 21:32:05
Done.
|
+ callout_widget->Show(); |
} |
} |