diff options
author | vollick@google.com <vollick@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-18 14:12:18 +0000 |
---|---|---|
committer | vollick@google.com <vollick@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-01-18 14:12:18 +0000 |
commit | b7a1b663c75496fe1d734cf96abd43a8d13a92ce (patch) | |
tree | 2a61c8791100494e40893da6843c032bc8958c90 /ash | |
parent | 72daaa97d67f7c722eaf9eabf125427506ee8d45 (diff) | |
download | chromium_src-b7a1b663c75496fe1d734cf96abd43a8d13a92ce.zip chromium_src-b7a1b663c75496fe1d734cf96abd43a8d13a92ce.tar.gz chromium_src-b7a1b663c75496fe1d734cf96abd43a8d13a92ce.tar.bz2 |
Make it simpler to detect when implicit animations complete.
The ScopedSettings destructor should only remove the temporary observers from the animator, not the sequences. Added an ImplicitAnimationObserver for use with ScopedSettings to provide a simple way to get notified when implicit animations complete.
BUG=None
TEST=compositor_unittests
Review URL: https://chromiumcodereview.appspot.com/9112034
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@118091 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash')
-rw-r--r-- | ash/app_list/app_list.cc | 5 | ||||
-rw-r--r-- | ash/drag_drop/drag_drop_controller.cc | 3 | ||||
-rw-r--r-- | ash/wm/modal_container_layout_manager.cc | 7 | ||||
-rw-r--r-- | ash/wm/shelf_layout_manager.cc | 3 | ||||
-rw-r--r-- | ash/wm/workspace/workspace.cc | 5 | ||||
-rw-r--r-- | ash/wm/workspace/workspace.h | 2 | ||||
-rw-r--r-- | ash/wm/workspace/workspace_manager.cc | 7 |
7 files changed, 19 insertions, 13 deletions
diff --git a/ash/app_list/app_list.cc b/ash/app_list/app_list.cc index 8510d09..ed593f7 100644 --- a/ash/app_list/app_list.cc +++ b/ash/app_list/app_list.cc @@ -14,6 +14,7 @@ #include "base/command_line.h" #include "ui/aura/event.h" #include "ui/aura/window.h" +#include "ui/gfx/compositor/scoped_layer_animation_settings.h" #include "ui/gfx/screen.h" namespace ash { @@ -115,13 +116,13 @@ void AppList::ResetWidget() { void AppList::ScheduleAnimation() { ui::Layer* layer = GetLayer(widget_); - ui::LayerAnimator::ScopedSettings app_list_animation(layer->GetAnimator()); + ui::ScopedLayerAnimationSettings app_list_animation(layer->GetAnimator()); layer->SetBounds(GetPreferredBounds(is_visible_)); layer->SetOpacity(is_visible_ ? 1.0 : 0.0); ui::Layer* default_container_layer = Shell::GetInstance()->GetContainer( internal::kShellWindowId_DefaultContainer)->layer(); - ui::LayerAnimator::ScopedSettings default_container_animation( + ui::ScopedLayerAnimationSettings default_container_animation( default_container_layer->GetAnimator()); default_container_layer->SetOpacity(is_visible_ ? 0.0 : 1.0); } diff --git a/ash/drag_drop/drag_drop_controller.cc b/ash/drag_drop/drag_drop_controller.cc index a0c1ac57..0f310fc 100644 --- a/ash/drag_drop/drag_drop_controller.cc +++ b/ash/drag_drop/drag_drop_controller.cc @@ -13,6 +13,7 @@ #include "ui/base/dragdrop/drag_drop_types.h" #include "ui/base/dragdrop/os_exchange_data_provider_aura.h" #include "ui/gfx/compositor/layer_animator.h" +#include "ui/gfx/compositor/scoped_layer_animation_settings.h" #include "ui/gfx/point.h" #include "ui/gfx/rect.h" #include "ui/views/views_delegate.h" @@ -207,7 +208,7 @@ void DragDropController::StartCanceledAnimation() { animator->set_preemption_strategy( ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET); animator->AddObserver(this); - ui::LayerAnimator::ScopedSettings animation_setter(animator); + ui::ScopedLayerAnimationSettings animation_setter(animator); animation_setter.SetTransitionDuration(kDragDropAnimationDuration); window->SetBounds(gfx::Rect(drag_start_location_, window->bounds().size())); } diff --git a/ash/wm/modal_container_layout_manager.cc b/ash/wm/modal_container_layout_manager.cc index e4b8ea4..5ab20a3 100644 --- a/ash/wm/modal_container_layout_manager.cc +++ b/ash/wm/modal_container_layout_manager.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -17,6 +17,7 @@ #include "ui/gfx/canvas.h" #include "ui/gfx/compositor/layer.h" #include "ui/gfx/compositor/layer_animator.h" +#include "ui/gfx/compositor/scoped_layer_animation_settings.h" #include "ui/views/view.h" #include "ui/views/widget/widget.h" @@ -176,7 +177,7 @@ void ModalContainerLayoutManager::CreateModalScreen() { Shell::GetInstance()->AddRootWindowEventFilter(modality_filter_.get()); - ui::LayerAnimator::ScopedSettings settings( + ui::ScopedLayerAnimationSettings settings( modal_screen_->GetNativeView()->layer()->GetAnimator()); modal_screen_->Show(); modal_screen_->GetNativeView()->layer()->SetOpacity(0.5f); @@ -191,7 +192,7 @@ void ModalContainerLayoutManager::DestroyModalScreen() { void ModalContainerLayoutManager::HideModalScreen() { Shell::GetInstance()->RemoveRootWindowEventFilter(modality_filter_.get()); - ui::LayerAnimator::ScopedSettings settings( + ui::ScopedLayerAnimationSettings settings( modal_screen_->GetNativeView()->layer()->GetAnimator()); modal_screen_->GetNativeView()->layer()->SetOpacity(0.0f); } diff --git a/ash/wm/shelf_layout_manager.cc b/ash/wm/shelf_layout_manager.cc index fd55b1b..3343ad7 100644 --- a/ash/wm/shelf_layout_manager.cc +++ b/ash/wm/shelf_layout_manager.cc @@ -11,6 +11,7 @@ #include "ui/aura/screen_aura.h" #include "ui/gfx/compositor/layer.h" #include "ui/gfx/compositor/layer_animator.h" +#include "ui/gfx/compositor/scoped_layer_animation_settings.h" #include "ui/views/widget/widget.h" namespace ash { @@ -135,7 +136,7 @@ void ShelfLayoutManager::AnimateWidgetTo(views::Widget* widget, const gfx::Rect& target_bounds, float target_opacity) { ui::Layer* layer = GetLayer(widget); - ui::LayerAnimator::ScopedSettings animation_setter(layer->GetAnimator()); + ui::ScopedLayerAnimationSettings animation_setter(layer->GetAnimator()); // Don't go through the widget, otherwise we end up back in SetChildBounds and // cancel the animation/layout. layer->SetBounds(target_bounds); diff --git a/ash/wm/workspace/workspace.cc b/ash/wm/workspace/workspace.cc index cf64897..574662b5 100644 --- a/ash/wm/workspace/workspace.cc +++ b/ash/wm/workspace/workspace.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -16,6 +16,7 @@ #include "ui/base/ui_base_types.h" #include "ui/gfx/compositor/layer.h" #include "ui/gfx/compositor/layer_animator.h" +#include "ui/gfx/compositor/scoped_layer_animation_settings.h" namespace { // Horizontal margin between windows. @@ -256,7 +257,7 @@ void Workspace::MoveWindowTo( std::min(work_area.width(), bounds.width()), std::min(work_area.height(), bounds.height())); if (animate) { - ui::LayerAnimator::ScopedSettings settings(window->layer()->GetAnimator()); + ui::ScopedLayerAnimationSettings settings(window->layer()->GetAnimator()); window->SetBounds(bounds); } else { window->SetBounds(bounds); diff --git a/ash/wm/workspace/workspace.h b/ash/wm/workspace/workspace.h index cfae27b..999df84 100644 --- a/ash/wm/workspace/workspace.h +++ b/ash/wm/workspace/workspace.h @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. diff --git a/ash/wm/workspace/workspace_manager.cc b/ash/wm/workspace/workspace_manager.cc index 754d90d..a9884b3 100644 --- a/ash/wm/workspace/workspace_manager.cc +++ b/ash/wm/workspace/workspace_manager.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. +// Copyright (c) 2012 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -16,6 +16,7 @@ #include "ui/aura/window.h" #include "ui/gfx/compositor/layer.h" #include "ui/gfx/compositor/layer_animator.h" +#include "ui/gfx/compositor/scoped_layer_animation_settings.h" #include "ui/gfx/screen.h" #include "ui/gfx/transform.h" @@ -134,7 +135,7 @@ void WorkspaceManager::SetOverview(bool overview) { transform.SetTranslateX(-active_workspace_->bounds().x()); } - ui::LayerAnimator::ScopedSettings settings( + ui::ScopedLayerAnimationSettings settings( contents_view_->layer()->GetAnimator()); contents_view_->layer()->SetTransform(transform); } @@ -266,7 +267,7 @@ void WorkspaceManager::UpdateContentsView() { if (active_workspace_) { ui::Transform transform; transform.SetTranslateX(-active_workspace_->bounds().x()); - ui::LayerAnimator::ScopedSettings settings( + ui::ScopedLayerAnimationSettings settings( contents_view_->layer()->GetAnimator()); contents_view_->SetTransform(transform); } |