| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ash/wm/window_animations.h" | 5 #include "ash/wm/window_animations.h" |
| 6 | 6 |
| 7 #include <math.h> | 7 #include <math.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 #include "ui/aura/client/aura_constants.h" | 25 #include "ui/aura/client/aura_constants.h" |
| 26 #include "ui/aura/window.h" | 26 #include "ui/aura/window.h" |
| 27 #include "ui/aura/window_observer.h" | 27 #include "ui/aura/window_observer.h" |
| 28 #include "ui/aura/window_property.h" | 28 #include "ui/aura/window_property.h" |
| 29 #include "ui/compositor/compositor_observer.h" | 29 #include "ui/compositor/compositor_observer.h" |
| 30 #include "ui/compositor/layer.h" | 30 #include "ui/compositor/layer.h" |
| 31 #include "ui/compositor/layer_animation_observer.h" | 31 #include "ui/compositor/layer_animation_observer.h" |
| 32 #include "ui/compositor/layer_animation_sequence.h" | 32 #include "ui/compositor/layer_animation_sequence.h" |
| 33 #include "ui/compositor/layer_animator.h" | 33 #include "ui/compositor/layer_animator.h" |
| 34 #include "ui/compositor/scoped_layer_animation_settings.h" | 34 #include "ui/compositor/scoped_layer_animation_settings.h" |
| 35 #include "ui/gfx/frame_time.h" |
| 35 #include "ui/gfx/interpolated_transform.h" | 36 #include "ui/gfx/interpolated_transform.h" |
| 36 #include "ui/gfx/screen.h" | 37 #include "ui/gfx/screen.h" |
| 37 #include "ui/gfx/vector3d_f.h" | 38 #include "ui/gfx/vector3d_f.h" |
| 38 #include "ui/views/corewm/window_util.h" | 39 #include "ui/views/corewm/window_util.h" |
| 39 #include "ui/views/view.h" | 40 #include "ui/views/view.h" |
| 40 #include "ui/views/widget/widget.h" | 41 #include "ui/views/widget/widget.h" |
| 41 | 42 |
| 42 namespace ash { | 43 namespace ash { |
| 43 namespace { | 44 namespace { |
| 44 const int kLayerAnimationsForMinimizeDurationMS = 200; | 45 const int kLayerAnimationsForMinimizeDurationMS = 200; |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 267 window_ = NULL; | 268 window_ = NULL; |
| 268 layer_->GetCompositor()->RemoveObserver(this); | 269 layer_->GetCompositor()->RemoveObserver(this); |
| 269 views::corewm::DeepDeleteLayers(layer_); | 270 views::corewm::DeepDeleteLayers(layer_); |
| 270 layer_ = NULL; | 271 layer_ = NULL; |
| 271 } | 272 } |
| 272 | 273 |
| 273 // ui::CompositorObserver overrides: | 274 // ui::CompositorObserver overrides: |
| 274 virtual void OnCompositingDidCommit(ui::Compositor* compositor) OVERRIDE { | 275 virtual void OnCompositingDidCommit(ui::Compositor* compositor) OVERRIDE { |
| 275 } | 276 } |
| 276 virtual void OnCompositingStarted(ui::Compositor* compositor, | 277 virtual void OnCompositingStarted(ui::Compositor* compositor, |
| 277 base::TimeTicks start_time) OVERRIDE { | 278 gfx::FrameTime start_time) OVERRIDE { |
| 278 } | 279 } |
| 279 virtual void OnCompositingEnded(ui::Compositor* compositor) OVERRIDE { | 280 virtual void OnCompositingEnded(ui::Compositor* compositor) OVERRIDE { |
| 280 } | 281 } |
| 281 virtual void OnCompositingAborted(ui::Compositor* compositor) OVERRIDE { | 282 virtual void OnCompositingAborted(ui::Compositor* compositor) OVERRIDE { |
| 282 // Triggers OnImplicitAnimationsCompleted() to be called and deletes us. | 283 // Triggers OnImplicitAnimationsCompleted() to be called and deletes us. |
| 283 layer_->GetAnimator()->StopAnimating(); | 284 layer_->GetAnimator()->StopAnimating(); |
| 284 } | 285 } |
| 285 virtual void OnCompositingLockStateChanged( | 286 virtual void OnCompositingLockStateChanged( |
| 286 ui::Compositor* compositor) OVERRIDE { | 287 ui::Compositor* compositor) OVERRIDE { |
| 287 } | 288 } |
| 288 virtual void OnUpdateVSyncParameters(ui::Compositor* compositor, | 289 virtual void OnUpdateVSyncParameters(ui::Compositor* compositor, |
| 289 base::TimeTicks timebase, | 290 gfx::FrameTime timebase, |
| 290 base::TimeDelta interval) OVERRIDE { | 291 base::TimeDelta interval) OVERRIDE { |
| 291 } | 292 } |
| 292 | 293 |
| 293 // aura::WindowObserver overrides: | 294 // aura::WindowObserver overrides: |
| 294 virtual void OnWindowDestroying(aura::Window* window) OVERRIDE { | 295 virtual void OnWindowDestroying(aura::Window* window) OVERRIDE { |
| 295 // Triggers OnImplicitAnimationsCompleted() to be called and deletes us. | 296 // Triggers OnImplicitAnimationsCompleted() to be called and deletes us. |
| 296 layer_->GetAnimator()->StopAnimating(); | 297 layer_->GetAnimator()->StopAnimating(); |
| 297 } | 298 } |
| 298 virtual void OnWindowRemovingFromRootWindow(aura::Window* window) OVERRIDE { | 299 virtual void OnWindowRemovingFromRootWindow(aura::Window* window) OVERRIDE { |
| 299 layer_->GetAnimator()->StopAnimating(); | 300 layer_->GetAnimator()->StopAnimating(); |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 554 } | 555 } |
| 555 | 556 |
| 556 // Assume the launcher is overflowed, zoom off to the bottom right of the | 557 // Assume the launcher is overflowed, zoom off to the bottom right of the |
| 557 // work area. | 558 // work area. |
| 558 gfx::Rect work_area = | 559 gfx::Rect work_area = |
| 559 Shell::GetScreen()->GetDisplayNearestWindow(window).work_area(); | 560 Shell::GetScreen()->GetDisplayNearestWindow(window).work_area(); |
| 560 return gfx::Rect(work_area.right(), work_area.bottom(), 0, 0); | 561 return gfx::Rect(work_area.right(), work_area.bottom(), 0, 0); |
| 561 } | 562 } |
| 562 | 563 |
| 563 } // namespace ash | 564 } // namespace ash |
| OLD | NEW |