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

Unified Diff: ash/wm/system_modal_container_layout_manager.cc

Issue 9222018: reland -- Disable animations during aura tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 11 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
Index: ash/wm/system_modal_container_layout_manager.cc
diff --git a/ash/wm/system_modal_container_layout_manager.cc b/ash/wm/system_modal_container_layout_manager.cc
index 3cad5879d76b48e8f821bf985f6c240989964e69..c0fda1460e26c28d3fcb474bd2ccfcd54888bf56 100644
--- a/ash/wm/system_modal_container_layout_manager.cc
+++ b/ash/wm/system_modal_container_layout_manager.cc
@@ -122,22 +122,14 @@ void SystemModalContainerLayoutManager::OnWindowPropertyChanged(
}
////////////////////////////////////////////////////////////////////////////////
-// SystemModalContainerLayoutManager, ui::LayerAnimationObserver implementation:
+// SystemModalContainerLayoutManager,
+// ui::ImplicitAnimationObserver implementation:
-void SystemModalContainerLayoutManager::OnLayerAnimationEnded(
- const ui::LayerAnimationSequence* sequence) {
+void SystemModalContainerLayoutManager::OnImplicitAnimationsCompleted() {
if (modal_screen_ && !modal_screen_->GetNativeView()->layer()->ShouldDraw())
DestroyModalScreen();
}
-void SystemModalContainerLayoutManager::OnLayerAnimationAborted(
- const ui::LayerAnimationSequence* sequence) {
-}
-
-void SystemModalContainerLayoutManager::OnLayerAnimationScheduled(
- const ui::LayerAnimationSequence* sequence) {
-}
-
////////////////////////////////////////////////////////////////////////////////
// SystemModalContainerLayoutManager,
// SystemModalContainerEventFilter::Delegate implementation:
@@ -186,27 +178,33 @@ void SystemModalContainerLayoutManager::CreateModalScreen() {
"SystemModalContainerLayoutManager.ModalScreen");
modal_screen_->SetContentsView(new ScreenView);
modal_screen_->GetNativeView()->layer()->SetOpacity(0.0f);
- modal_screen_->GetNativeView()->layer()->GetAnimator()->AddObserver(this);
Shell::GetInstance()->AddRootWindowEventFilter(modality_filter_.get());
+ StopObservingImplicitAnimations();
+
ui::ScopedLayerAnimationSettings settings(
modal_screen_->GetNativeView()->layer()->GetAnimator());
+ settings.AddObserver(this);
modal_screen_->Show();
modal_screen_->GetNativeView()->layer()->SetOpacity(0.5f);
container_->StackChildAtTop(modal_screen_->GetNativeView());
}
void SystemModalContainerLayoutManager::DestroyModalScreen() {
- modal_screen_->GetNativeView()->layer()->GetAnimator()->RemoveObserver(this);
+ // Stop observing the modal screen's animations.
+ StopObservingImplicitAnimations();
modal_screen_->Close();
modal_screen_ = NULL;
}
void SystemModalContainerLayoutManager::HideModalScreen() {
+ StopObservingImplicitAnimations();
+
Shell::GetInstance()->RemoveRootWindowEventFilter(modality_filter_.get());
ui::ScopedLayerAnimationSettings settings(
modal_screen_->GetNativeView()->layer()->GetAnimator());
+ settings.AddObserver(this);
modal_screen_->GetNativeView()->layer()->SetOpacity(0.0f);
}
« no previous file with comments | « ash/wm/system_modal_container_layout_manager.h ('k') | ash/wm/system_modal_container_layout_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698