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

Side by Side Diff: ash/wm/window_animations.cc

Issue 645513008: Standardize usage of virtual/override/final specifiers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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 unified diff | Download patch
OLDNEW
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 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 public: 270 public:
271 // Observes |window| for destruction, but does not take ownership. 271 // Observes |window| for destruction, but does not take ownership.
272 // Takes ownership of |layer| and its child layers. 272 // Takes ownership of |layer| and its child layers.
273 CrossFadeObserver(aura::Window* window, 273 CrossFadeObserver(aura::Window* window,
274 scoped_ptr<ui::LayerTreeOwner> layer_owner) 274 scoped_ptr<ui::LayerTreeOwner> layer_owner)
275 : window_(window), 275 : window_(window),
276 layer_owner_(layer_owner.Pass()) { 276 layer_owner_(layer_owner.Pass()) {
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 ~CrossFadeObserver() override {
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 void OnCompositingDidCommit(ui::Compositor* compositor) override {}
288 } 288 void OnCompositingStarted(ui::Compositor* compositor,
289 virtual void OnCompositingStarted(ui::Compositor* compositor, 289 base::TimeTicks start_time) override {}
290 base::TimeTicks start_time) override { 290 void OnCompositingEnded(ui::Compositor* compositor) override {}
291 } 291 void OnCompositingAborted(ui::Compositor* compositor) override {
292 virtual void OnCompositingEnded(ui::Compositor* compositor) override {
293 }
294 virtual void OnCompositingAborted(ui::Compositor* compositor) override {
295 // Triggers OnImplicitAnimationsCompleted() to be called and deletes us. 292 // Triggers OnImplicitAnimationsCompleted() to be called and deletes us.
296 layer_owner_->root()->GetAnimator()->StopAnimating(); 293 layer_owner_->root()->GetAnimator()->StopAnimating();
297 } 294 }
298 virtual void OnCompositingLockStateChanged( 295 void OnCompositingLockStateChanged(ui::Compositor* compositor) override {}
299 ui::Compositor* compositor) override {
300 }
301 296
302 // aura::WindowObserver overrides: 297 // aura::WindowObserver overrides:
303 virtual void OnWindowDestroying(aura::Window* window) override { 298 void OnWindowDestroying(aura::Window* window) override {
304 // Triggers OnImplicitAnimationsCompleted() to be called and deletes us. 299 // Triggers OnImplicitAnimationsCompleted() to be called and deletes us.
305 layer_owner_->root()->GetAnimator()->StopAnimating(); 300 layer_owner_->root()->GetAnimator()->StopAnimating();
306 } 301 }
307 virtual void OnWindowRemovingFromRootWindow(aura::Window* window, 302 void OnWindowRemovingFromRootWindow(aura::Window* window,
308 aura::Window* new_root) override { 303 aura::Window* new_root) override {
309 layer_owner_->root()->GetAnimator()->StopAnimating(); 304 layer_owner_->root()->GetAnimator()->StopAnimating();
310 } 305 }
311 306
312 // ui::ImplicitAnimationObserver overrides: 307 // ui::ImplicitAnimationObserver overrides:
313 virtual void OnImplicitAnimationsCompleted() override { 308 void OnImplicitAnimationsCompleted() override { delete this; }
314 delete this;
315 }
316 309
317 private: 310 private:
318 aura::Window* window_; // not owned 311 aura::Window* window_; // not owned
319 scoped_ptr<ui::LayerTreeOwner> layer_owner_; 312 scoped_ptr<ui::LayerTreeOwner> layer_owner_;
320 313
321 DISALLOW_COPY_AND_ASSIGN(CrossFadeObserver); 314 DISALLOW_COPY_AND_ASSIGN(CrossFadeObserver);
322 }; 315 };
323 316
324 base::TimeDelta CrossFadeAnimation( 317 base::TimeDelta CrossFadeAnimation(
325 aura::Window* window, 318 aura::Window* window,
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
510 case SHELF_ALIGNMENT_LEFT: 503 case SHELF_ALIGNMENT_LEFT:
511 return gfx::Rect(work_area.x(), work_area.y(), 0, 0); 504 return gfx::Rect(work_area.x(), work_area.y(), 0, 0);
512 case SHELF_ALIGNMENT_RIGHT: 505 case SHELF_ALIGNMENT_RIGHT:
513 return gfx::Rect(work_area.right(), work_area.y(), 0, 0); 506 return gfx::Rect(work_area.right(), work_area.y(), 0, 0);
514 } 507 }
515 NOTREACHED(); 508 NOTREACHED();
516 return gfx::Rect(); 509 return gfx::Rect();
517 } 510 }
518 511
519 } // namespace ash 512 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/virtual_keyboard_container_layout_manager.h ('k') | ash/wm/window_animations_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698