OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/display/display_configurator_animation.h" | 5 #include "ash/display/display_configurator_animation.h" |
6 | 6 |
7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
8 #include "ash/shell_window_ids.h" | 8 #include "ash/shell_window_ids.h" |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 // The actual observer to listen each animation completion. | 56 // The actual observer to listen each animation completion. |
57 class Observer : public ui::LayerAnimationObserver { | 57 class Observer : public ui::LayerAnimationObserver { |
58 public: | 58 public: |
59 Observer(ui::LayerAnimator* animator, | 59 Observer(ui::LayerAnimator* animator, |
60 CallbackRunningObserver* observer) | 60 CallbackRunningObserver* observer) |
61 : animator_(animator), | 61 : animator_(animator), |
62 observer_(observer) {} | 62 observer_(observer) {} |
63 | 63 |
64 protected: | 64 protected: |
65 // ui::LayerAnimationObserver overrides: | 65 // ui::LayerAnimationObserver overrides: |
66 virtual void OnLayerAnimationEnded( | 66 void OnLayerAnimationEnded(ui::LayerAnimationSequence* sequence) override { |
67 ui::LayerAnimationSequence* sequence) override { | |
68 animator_->RemoveObserver(this); | 67 animator_->RemoveObserver(this); |
69 observer_->OnSingleTaskCompleted(); | 68 observer_->OnSingleTaskCompleted(); |
70 } | 69 } |
71 virtual void OnLayerAnimationAborted( | 70 void OnLayerAnimationAborted( |
72 ui::LayerAnimationSequence* sequence) override { | 71 ui::LayerAnimationSequence* sequence) override { |
73 animator_->RemoveObserver(this); | 72 animator_->RemoveObserver(this); |
74 observer_->OnSingleTaskAborted(); | 73 observer_->OnSingleTaskAborted(); |
75 } | 74 } |
76 virtual void OnLayerAnimationScheduled( | 75 void OnLayerAnimationScheduled( |
77 ui::LayerAnimationSequence* sequence) override { | 76 ui::LayerAnimationSequence* sequence) override {} |
78 } | 77 bool RequiresNotificationWhenAnimatorDestroyed() const override { |
79 virtual bool RequiresNotificationWhenAnimatorDestroyed() const override { | |
80 return true; | 78 return true; |
81 } | 79 } |
82 | 80 |
83 private: | 81 private: |
84 ui::LayerAnimator* animator_; | 82 ui::LayerAnimator* animator_; |
85 CallbackRunningObserver* observer_; | 83 CallbackRunningObserver* observer_; |
86 | 84 |
87 DISALLOW_COPY_AND_ASSIGN(Observer); | 85 DISALLOW_COPY_AND_ASSIGN(Observer); |
88 }; | 86 }; |
89 | 87 |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 if (timer_) { | 217 if (timer_) { |
220 timer_->Stop(); | 218 timer_->Stop(); |
221 timer_.reset(); | 219 timer_.reset(); |
222 } | 220 } |
223 STLDeleteContainerPairSecondPointers( | 221 STLDeleteContainerPairSecondPointers( |
224 hiding_layers_.begin(), hiding_layers_.end()); | 222 hiding_layers_.begin(), hiding_layers_.end()); |
225 hiding_layers_.clear(); | 223 hiding_layers_.clear(); |
226 } | 224 } |
227 | 225 |
228 } // namespace ash | 226 } // namespace ash |
OLD | NEW |