Chromium Code Reviews| Index: ui/app_list/views/app_list_view.cc |
| diff --git a/ui/app_list/views/app_list_view.cc b/ui/app_list/views/app_list_view.cc |
| index 55a3b6529bb42fa62834501cd8d73f266101a5a2..b4dcb5884117d9fad6dc6de648ee7d94f7797c74 100644 |
| --- a/ui/app_list/views/app_list_view.cc |
| +++ b/ui/app_list/views/app_list_view.cc |
| @@ -221,7 +221,25 @@ void AppListView::UpdateBounds() { |
| void AppListView::SetAppListOverlayVisible(bool visible) { |
| DCHECK(overlay_view_); |
| - overlay_view_->SetVisible(visible); |
| + |
| + // Display the overlay immediately so we can begin the animation. |
| + overlay_view_->SetVisible(true); |
| + |
| + ui::ScopedLayerAnimationSettings settings( |
| + overlay_view_->layer()->GetAnimator()); |
| + settings.SetTweenType(gfx::Tween::FAST_OUT_SLOW_IN); |
| + |
| + const float kOverlayFadeInMilliseconds = 125; |
| + settings.SetTransitionDuration( |
| + base::TimeDelta::FromMilliseconds(kOverlayFadeInMilliseconds)); |
| + |
| + if (visible == true) { |
|
calamity
2014/07/31 07:58:11
This can just be
if (visible) {
But if you get r
sashab
2014/08/04 01:19:32
Hmm... I originally thought this might be more con
|
| + const float kOverlayOpacity = 0.75f; |
| + overlay_view_->layer()->SetOpacity(kOverlayOpacity); |
| + } else { |
| + overlay_view_->layer()->SetOpacity(0.0f); |
| + overlay_view_->SetVisible(false); |
|
calamity
2014/07/31 07:58:11
How does this work? Won't the SetVisible(false) im
sashab
2014/08/04 01:19:33
Yup, it works - no matter how long I set the delay
|
| + } |
| } |
| bool AppListView::ShouldCenterWindow() const { |
| @@ -366,12 +384,11 @@ void AppListView::InitAsBubbleInternal(gfx::NativeView parent, |
| // To make the overlay view, construct a view with a white background, rather |
| // than a white rectangle in it. This is because we need overlay_view_ to be |
| // drawn to its own layer (so it appears correctly in the foreground). |
| - const float kOverlayOpacity = 0.75f; |
| overlay_view_ = new views::View(); |
| overlay_view_->SetPaintToLayer(true); |
| - overlay_view_->layer()->SetOpacity(kOverlayOpacity); |
| overlay_view_->SetBoundsRect(GetContentsBounds()); |
| overlay_view_->SetVisible(false); |
| + overlay_view_->layer()->SetOpacity(0.0f); |
| // On platforms that don't support a shadow, the rounded border of the app |
| // list is constructed _inside_ the view, so a rectangular background goes |
| // over the border in the rounded corners. To fix this, give the background a |