Index: ash/app_list/app_list.cc |
diff --git a/ash/app_list/app_list.cc b/ash/app_list/app_list.cc |
index c439bbbe8e6a2e0034b16afa1e93e439f1bac038..ad9fd017e1a253a5d16543d8680f5f461e731c30 100644 |
--- a/ash/app_list/app_list.cc |
+++ b/ash/app_list/app_list.cc |
@@ -87,7 +87,6 @@ void AppList::SetWidget(views::Widget* widget) { |
if (is_visible_) { |
widget_ = widget; |
- widget_->AddObserver(this); |
GetLayer(widget_)->GetAnimator()->AddObserver(this); |
Shell::GetInstance()->AddRootWindowEventFilter(this); |
@@ -119,13 +118,19 @@ void AppList::ScheduleAnimation() { |
return; |
ui::Layer* layer = GetLayer(widget_); |
+ |
+ // Stop observing previous animation. |
+ StopObservingImplicitAnimations(); |
+ |
ui::ScopedLayerAnimationSettings app_list_animation(layer->GetAnimator()); |
+ app_list_animation.AddObserver(this); |
layer->SetBounds(GetPreferredBounds(is_visible_)); |
layer->SetOpacity(is_visible_ ? 1.0 : 0.0); |
ui::Layer* default_container_layer = default_container->layer(); |
ui::ScopedLayerAnimationSettings default_container_animation( |
default_container_layer->GetAnimator()); |
+ app_list_animation.AddObserver(this); |
default_container_layer->SetOpacity(is_visible_ ? 0.0 : 1.0); |
} |
@@ -159,22 +164,13 @@ ui::GestureStatus AppList::PreHandleGestureEvent( |
} |
//////////////////////////////////////////////////////////////////////////////// |
-// AppList, ui::LayerAnimationObserver implementation: |
+// AppList, ui::ImplicitAnimationObserver implementation: |
-void AppList::OnLayerAnimationEnded( |
- const ui::LayerAnimationSequence* sequence) { |
+void AppList::OnImplicitAnimationsCompleted() { |
if (!is_visible_ ) |
widget_->Close(); |
} |
-void AppList::OnLayerAnimationAborted( |
- const ui::LayerAnimationSequence* sequence) { |
-} |
- |
-void AppList::OnLayerAnimationScheduled( |
- const ui::LayerAnimationSequence* sequence) { |
-} |
- |
//////////////////////////////////////////////////////////////////////////////// |
// AppList, views::Widget::Observer implementation: |