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

Unified Diff: ui/gfx/compositor/layer_animation_observer.cc

Issue 9320018: Revert 120092 - Reland 120074 -- Disable animations during aura tests. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/gfx/compositor/layer_animation_observer.h ('k') | ui/gfx/compositor/layer_animator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/compositor/layer_animation_observer.cc
===================================================================
--- ui/gfx/compositor/layer_animation_observer.cc (revision 120096)
+++ ui/gfx/compositor/layer_animation_observer.cc (working copy)
@@ -11,26 +11,14 @@
////////////////////////////////////////////////////////////////////////////////
// LayerAnimationObserver
-LayerAnimationObserver::LayerAnimationObserver() {
-}
-
-LayerAnimationObserver::~LayerAnimationObserver() {
- StopObserving();
-}
-
bool LayerAnimationObserver::RequiresNotificationWhenAnimatorDestroyed() const {
return false;
}
-void LayerAnimationObserver::OnAttachedToSequence(
- LayerAnimationSequence* sequence) {
+LayerAnimationObserver::LayerAnimationObserver() {
}
-void LayerAnimationObserver::OnDetachedFromSequence(
- LayerAnimationSequence* sequence) {
-}
-
-void LayerAnimationObserver::StopObserving() {
+LayerAnimationObserver::~LayerAnimationObserver() {
while (!attached_sequences_.empty()) {
LayerAnimationSequence* sequence = *attached_sequences_.begin();
sequence->RemoveObserver(this);
@@ -41,21 +29,20 @@
LayerAnimationSequence* sequence) {
DCHECK(attached_sequences_.find(sequence) == attached_sequences_.end());
attached_sequences_.insert(sequence);
- OnAttachedToSequence(sequence);
}
void LayerAnimationObserver::DetachedFromSequence(
LayerAnimationSequence* sequence) {
if (attached_sequences_.find(sequence) != attached_sequences_.end())
attached_sequences_.erase(sequence);
- OnDetachedFromSequence(sequence);
}
////////////////////////////////////////////////////////////////////////////////
// ImplicitAnimationObserver
ImplicitAnimationObserver::ImplicitAnimationObserver()
- : active_(false) {
+ : active_(false),
+ animation_count_(0) {
}
ImplicitAnimationObserver::~ImplicitAnimationObserver() {}
@@ -65,44 +52,26 @@
CheckCompleted();
}
-void ImplicitAnimationObserver::StopObservingImplicitAnimations() {
- SetActive(false);
- StopObserving();
-}
-
void ImplicitAnimationObserver::OnLayerAnimationEnded(
- LayerAnimationSequence* sequence) {
- sequence->RemoveObserver(this);
- DCHECK(attached_sequences().find(sequence) == attached_sequences().end());
+ const LayerAnimationSequence* sequence) {
+ animation_count_--;
CheckCompleted();
}
void ImplicitAnimationObserver::OnLayerAnimationAborted(
- LayerAnimationSequence* sequence) {
- sequence->RemoveObserver(this);
- DCHECK(attached_sequences().find(sequence) == attached_sequences().end());
+ const LayerAnimationSequence* sequence) {
+ animation_count_--;
CheckCompleted();
}
void ImplicitAnimationObserver::OnLayerAnimationScheduled(
- LayerAnimationSequence* sequence) {
+ const LayerAnimationSequence* sequence) {
+ animation_count_++;
}
-void ImplicitAnimationObserver::OnAttachedToSequence(
- LayerAnimationSequence* sequence) {
-}
-
-void ImplicitAnimationObserver::OnDetachedFromSequence(
- LayerAnimationSequence* sequence) {
- DCHECK(attached_sequences().find(sequence) == attached_sequences().end());
- CheckCompleted();
-}
-
void ImplicitAnimationObserver::CheckCompleted() {
- if (active_ && attached_sequences().empty()) {
+ if (active_ && animation_count_ == 0)
OnImplicitAnimationsCompleted();
- active_ = false;
- }
}
} // namespace ui
« no previous file with comments | « ui/gfx/compositor/layer_animation_observer.h ('k') | ui/gfx/compositor/layer_animator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698