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

Unified Diff: ash/wm/panels/panel_layout_manager.cc

Issue 203793004: Fixing invalid visibility states with layers (opacity==0, visibility==true) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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/wm/system_modal_container_layout_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
}
}
« no previous file with comments | « no previous file | ash/wm/system_modal_container_layout_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698