diff options
author | vollick@google.com <vollick@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-01 20:31:15 +0000 |
---|---|---|
committer | vollick@google.com <vollick@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-02-01 20:31:15 +0000 |
commit | 7482542213d768c50ea506fdb56b3442cfa3c8aa (patch) | |
tree | 1029af22ed076aefb784ef0643bfab42af547465 /ash/app_list | |
parent | dfce15bcdfd22b6d9eb60c9741932d9c917b3bcc (diff) | |
download | chromium_src-7482542213d768c50ea506fdb56b3442cfa3c8aa.zip chromium_src-7482542213d768c50ea506fdb56b3442cfa3c8aa.tar.gz chromium_src-7482542213d768c50ea506fdb56b3442cfa3c8aa.tar.bz2 |
Revert 120092 - Reland 120074 -- Disable animations during aura tests.
This causes all animations scheduled during a test to complete immediately.
After making this change, I noticed some code assumed that animations would not complete synchronously. Some of this code used animation observers, and I while fixing the code I have updated it to use the preferred ImplicitAnimationObserver.
BUG=None
TEST=aura_shell_unittests,aura_unittests,compositor_unittests
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=120074
Review URL: https://chromiumcodereview.appspot.com/9222018
TBR=vollick@google.com
Review URL: https://chromiumcodereview.appspot.com/9320018
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@120097 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/app_list')
-rw-r--r-- | ash/app_list/app_list.cc | 20 | ||||
-rw-r--r-- | ash/app_list/app_list.h | 11 |
2 files changed, 20 insertions, 11 deletions
diff --git a/ash/app_list/app_list.cc b/ash/app_list/app_list.cc index ad9fd01..c439bbb 100644 --- a/ash/app_list/app_list.cc +++ b/ash/app_list/app_list.cc @@ -87,6 +87,7 @@ void AppList::SetWidget(views::Widget* widget) { if (is_visible_) { widget_ = widget; + widget_->AddObserver(this); GetLayer(widget_)->GetAnimator()->AddObserver(this); Shell::GetInstance()->AddRootWindowEventFilter(this); @@ -118,19 +119,13 @@ 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); } @@ -164,13 +159,22 @@ ui::GestureStatus AppList::PreHandleGestureEvent( } //////////////////////////////////////////////////////////////////////////////// -// AppList, ui::ImplicitAnimationObserver implementation: +// AppList, ui::LayerAnimationObserver implementation: -void AppList::OnImplicitAnimationsCompleted() { +void AppList::OnLayerAnimationEnded( + const ui::LayerAnimationSequence* sequence) { if (!is_visible_ ) widget_->Close(); } +void AppList::OnLayerAnimationAborted( + const ui::LayerAnimationSequence* sequence) { +} + +void AppList::OnLayerAnimationScheduled( + const ui::LayerAnimationSequence* sequence) { +} + //////////////////////////////////////////////////////////////////////////////// // AppList, views::Widget::Observer implementation: diff --git a/ash/app_list/app_list.h b/ash/app_list/app_list.h index b499498..77b2ecd 100644 --- a/ash/app_list/app_list.h +++ b/ash/app_list/app_list.h @@ -20,7 +20,7 @@ namespace internal { // While the UI is visible, it monitors things such as app list widget's // activation state and desktop mouse click to auto dismiss the UI. class AppList : public aura::EventFilter, - public ui::ImplicitAnimationObserver, + public ui::LayerAnimationObserver, public views::Widget::Observer { public: AppList(); @@ -54,8 +54,13 @@ class AppList : public aura::EventFilter, aura::Window* target, aura::GestureEvent* event) OVERRIDE; - // ui::ImplicitAnimationObserver overrides: - virtual void OnImplicitAnimationsCompleted() OVERRIDE; + // ui::LayerAnimationObserver overrides: + virtual void OnLayerAnimationEnded( + const ui::LayerAnimationSequence* sequence) OVERRIDE; + virtual void OnLayerAnimationAborted( + const ui::LayerAnimationSequence* sequence) OVERRIDE; + virtual void OnLayerAnimationScheduled( + const ui::LayerAnimationSequence* sequence) OVERRIDE; // views::Widget::Observer overrides: virtual void OnWidgetClosing(views::Widget* widget) OVERRIDE; |