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 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 window_->AddObserver(this); | 277 window_->AddObserver(this); |
278 layer_owner_->root()->GetCompositor()->AddObserver(this); | 278 layer_owner_->root()->GetCompositor()->AddObserver(this); |
279 } | 279 } |
280 virtual ~CrossFadeObserver() { | 280 virtual ~CrossFadeObserver() { |
281 window_->RemoveObserver(this); | 281 window_->RemoveObserver(this); |
282 window_ = NULL; | 282 window_ = NULL; |
283 layer_owner_->root()->GetCompositor()->RemoveObserver(this); | 283 layer_owner_->root()->GetCompositor()->RemoveObserver(this); |
284 } | 284 } |
285 | 285 |
286 // ui::CompositorObserver overrides: | 286 // ui::CompositorObserver overrides: |
287 virtual void OnCompositingDidCommit(ui::Compositor* compositor) OVERRIDE { | 287 virtual void OnCompositingDidCommit(ui::Compositor* compositor) override { |
288 } | 288 } |
289 virtual void OnCompositingStarted(ui::Compositor* compositor, | 289 virtual void OnCompositingStarted(ui::Compositor* compositor, |
290 base::TimeTicks start_time) OVERRIDE { | 290 base::TimeTicks start_time) override { |
291 } | 291 } |
292 virtual void OnCompositingEnded(ui::Compositor* compositor) OVERRIDE { | 292 virtual void OnCompositingEnded(ui::Compositor* compositor) override { |
293 } | 293 } |
294 virtual void OnCompositingAborted(ui::Compositor* compositor) OVERRIDE { | 294 virtual void OnCompositingAborted(ui::Compositor* compositor) override { |
295 // Triggers OnImplicitAnimationsCompleted() to be called and deletes us. | 295 // Triggers OnImplicitAnimationsCompleted() to be called and deletes us. |
296 layer_owner_->root()->GetAnimator()->StopAnimating(); | 296 layer_owner_->root()->GetAnimator()->StopAnimating(); |
297 } | 297 } |
298 virtual void OnCompositingLockStateChanged( | 298 virtual void OnCompositingLockStateChanged( |
299 ui::Compositor* compositor) OVERRIDE { | 299 ui::Compositor* compositor) override { |
300 } | 300 } |
301 | 301 |
302 // aura::WindowObserver overrides: | 302 // aura::WindowObserver overrides: |
303 virtual void OnWindowDestroying(aura::Window* window) OVERRIDE { | 303 virtual void OnWindowDestroying(aura::Window* window) override { |
304 // Triggers OnImplicitAnimationsCompleted() to be called and deletes us. | 304 // Triggers OnImplicitAnimationsCompleted() to be called and deletes us. |
305 layer_owner_->root()->GetAnimator()->StopAnimating(); | 305 layer_owner_->root()->GetAnimator()->StopAnimating(); |
306 } | 306 } |
307 virtual void OnWindowRemovingFromRootWindow(aura::Window* window, | 307 virtual void OnWindowRemovingFromRootWindow(aura::Window* window, |
308 aura::Window* new_root) OVERRIDE { | 308 aura::Window* new_root) override { |
309 layer_owner_->root()->GetAnimator()->StopAnimating(); | 309 layer_owner_->root()->GetAnimator()->StopAnimating(); |
310 } | 310 } |
311 | 311 |
312 // ui::ImplicitAnimationObserver overrides: | 312 // ui::ImplicitAnimationObserver overrides: |
313 virtual void OnImplicitAnimationsCompleted() OVERRIDE { | 313 virtual void OnImplicitAnimationsCompleted() override { |
314 delete this; | 314 delete this; |
315 } | 315 } |
316 | 316 |
317 private: | 317 private: |
318 aura::Window* window_; // not owned | 318 aura::Window* window_; // not owned |
319 scoped_ptr<ui::LayerTreeOwner> layer_owner_; | 319 scoped_ptr<ui::LayerTreeOwner> layer_owner_; |
320 | 320 |
321 DISALLOW_COPY_AND_ASSIGN(CrossFadeObserver); | 321 DISALLOW_COPY_AND_ASSIGN(CrossFadeObserver); |
322 }; | 322 }; |
323 | 323 |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
510 case SHELF_ALIGNMENT_LEFT: | 510 case SHELF_ALIGNMENT_LEFT: |
511 return gfx::Rect(work_area.x(), work_area.y(), 0, 0); | 511 return gfx::Rect(work_area.x(), work_area.y(), 0, 0); |
512 case SHELF_ALIGNMENT_RIGHT: | 512 case SHELF_ALIGNMENT_RIGHT: |
513 return gfx::Rect(work_area.right(), work_area.y(), 0, 0); | 513 return gfx::Rect(work_area.right(), work_area.y(), 0, 0); |
514 } | 514 } |
515 NOTREACHED(); | 515 NOTREACHED(); |
516 return gfx::Rect(); | 516 return gfx::Rect(); |
517 } | 517 } |
518 | 518 |
519 } // namespace ash | 519 } // namespace ash |
OLD | NEW |