summaryrefslogtreecommitdiff
path: root/chromium/ui/compositor/layer_animation_observer.h
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/ui/compositor/layer_animation_observer.h')
-rw-r--r--chromium/ui/compositor/layer_animation_observer.h16
1 files changed, 10 insertions, 6 deletions
diff --git a/chromium/ui/compositor/layer_animation_observer.h b/chromium/ui/compositor/layer_animation_observer.h
index eb460da8533..c58f37a079c 100644
--- a/chromium/ui/compositor/layer_animation_observer.h
+++ b/chromium/ui/compositor/layer_animation_observer.h
@@ -9,6 +9,7 @@
#include <set>
#include "base/compiler_specific.h"
+#include "base/memory/weak_ptr.h"
#include "ui/compositor/compositor_export.h"
#include "ui/compositor/layer_animation_element.h"
@@ -33,6 +34,10 @@ class COMPOSITOR_EXPORT LayerAnimationObserver {
virtual void OnLayerAnimationEnded(
LayerAnimationSequence* sequence) = 0;
+ // Called when a |sequence| repetition ends and will repeat. Not called if
+ // |sequence| is aborted.
+ virtual void OnLayerAnimationWillRepeat(LayerAnimationSequence* sequence) {}
+
// Called if |sequence| is aborted for any reason. Should never do anything
// that may cause another animation to be started.
virtual void OnLayerAnimationAborted(
@@ -162,18 +167,17 @@ class COMPOSITOR_EXPORT ImplicitAnimationObserver
AnimationStatus AnimationStatusForProperty(
LayerAnimationElement::AnimatableProperty property) const;
- bool active_;
-
- // Set to true in the destructor (if non-NULL). Used to detect deletion while
- // calling out.
- bool* destroyed_;
+ bool active_ = false;
typedef std::map<LayerAnimationElement::AnimatableProperty,
AnimationStatus> PropertyAnimationStatusMap;
PropertyAnimationStatusMap property_animation_status_;
// True if OnLayerAnimationScheduled() has been called at least once.
- bool first_sequence_scheduled_;
+ bool first_sequence_scheduled_ = false;
+
+ // For tracking whether this object has been destroyed. Must be last.
+ base::WeakPtrFactory<ImplicitAnimationObserver> weak_factory_{this};
};
} // namespace ui