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

Side by Side Diff: ui/compositor/scoped_layer_animation_settings.cc

Issue 667923002: Standardize usage of virtual/override/final in ui/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 unified diff | Download patch
« no previous file with comments | « ui/compositor/layer_animator_collection.h ('k') | ui/compositor/test/draw_waiter_for_test.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "ui/compositor/scoped_layer_animation_settings.h" 5 #include "ui/compositor/scoped_layer_animation_settings.h"
6 6
7 #include "ui/compositor/layer.h" 7 #include "ui/compositor/layer.h"
8 #include "ui/compositor/layer_animation_observer.h" 8 #include "ui/compositor/layer_animation_observer.h"
9 #include "ui/compositor/layer_animation_sequence.h" 9 #include "ui/compositor/layer_animation_sequence.h"
10 #include "ui/compositor/layer_animator.h" 10 #include "ui/compositor/layer_animator.h"
11 11
12 namespace { 12 namespace {
13 13
14 const int kDefaultTransitionDurationMs = 200; 14 const int kDefaultTransitionDurationMs = 200;
15 15
16 } // namespace 16 } // namespace
17 17
18 namespace ui { 18 namespace ui {
19 19
20 // InvertingObserver ----------------------------------------------------------- 20 // InvertingObserver -----------------------------------------------------------
21 class InvertingObserver : public ImplicitAnimationObserver { 21 class InvertingObserver : public ImplicitAnimationObserver {
22 public: 22 public:
23 InvertingObserver() 23 InvertingObserver()
24 : base_layer_(NULL) { 24 : base_layer_(NULL) {
25 } 25 }
26 26
27 virtual ~InvertingObserver() {} 27 ~InvertingObserver() override {}
28 28
29 void SetLayer(Layer* base_layer) { base_layer_ = base_layer; } 29 void SetLayer(Layer* base_layer) { base_layer_ = base_layer; }
30 30
31 Layer* layer() { return base_layer_; } 31 Layer* layer() { return base_layer_; }
32 32
33 void AddInverselyAnimatedLayer(Layer* inverse_layer) { 33 void AddInverselyAnimatedLayer(Layer* inverse_layer) {
34 inverse_layers_.push_back(inverse_layer); 34 inverse_layers_.push_back(inverse_layer);
35 } 35 }
36 36
37 virtual void OnImplicitAnimationsCompleted() override {} 37 void OnImplicitAnimationsCompleted() override {}
38 38
39 virtual void OnLayerAnimationScheduled( 39 void OnLayerAnimationScheduled(LayerAnimationSequence* sequence) override {
40 LayerAnimationSequence* sequence) override {
41 DCHECK(base_layer_ != NULL) 40 DCHECK(base_layer_ != NULL)
42 << "Must set base layer with ScopedLayerAnimationSettings::" 41 << "Must set base layer with ScopedLayerAnimationSettings::"
43 << "SetInverslyAnimatedBaseLayer"; 42 << "SetInverslyAnimatedBaseLayer";
44 gfx::Transform base_transform = base_layer_->transform(); 43 gfx::Transform base_transform = base_layer_->transform();
45 scoped_ptr<LayerAnimationElement> inverse = GetInverseElement(sequence, 44 scoped_ptr<LayerAnimationElement> inverse = GetInverseElement(sequence,
46 base_transform); 45 base_transform);
47 46
48 for (std::vector<Layer*>::const_iterator i = 47 for (std::vector<Layer*>::const_iterator i =
49 inverse_layers_.begin(); i != inverse_layers_.end(); ++i) { 48 inverse_layers_.begin(); i != inverse_layers_.end(); ++i) {
50 (*i)->GetAnimator()->StartAnimation(new LayerAnimationSequence( 49 (*i)->GetAnimator()->StartAnimation(new LayerAnimationSequence(
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
154 } 153 }
155 inverse_observer_->SetLayer(base); 154 inverse_observer_->SetLayer(base);
156 } 155 }
157 156
158 void ScopedLayerAnimationSettings::AddInverselyAnimatedLayer( 157 void ScopedLayerAnimationSettings::AddInverselyAnimatedLayer(
159 Layer* inverse_layer) { 158 Layer* inverse_layer) {
160 inverse_observer_->AddInverselyAnimatedLayer(inverse_layer); 159 inverse_observer_->AddInverselyAnimatedLayer(inverse_layer);
161 } 160 }
162 161
163 } // namespace ui 162 } // namespace ui
OLDNEW
« no previous file with comments | « ui/compositor/layer_animator_collection.h ('k') | ui/compositor/test/draw_waiter_for_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698