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

Unified Diff: ui/compositor/callback_layer_animation_observer.cc

Issue 1407043002: Added more constructors to CallbackLayerAnimationObserver. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
Index: ui/compositor/callback_layer_animation_observer.cc
diff --git a/ui/compositor/callback_layer_animation_observer.cc b/ui/compositor/callback_layer_animation_observer.cc
index 305bce6a700ee1f78dd7bcc8f896a90ded07b1df..639caf4d1411b867a31ce29e6c6ec4ae846359a8 100644
--- a/ui/compositor/callback_layer_animation_observer.cc
+++ b/ui/compositor/callback_layer_animation_observer.cc
@@ -4,22 +4,39 @@
#include "ui/compositor/callback_layer_animation_observer.h"
+#include "base/bind.h"
#include "ui/compositor/layer_animation_sequence.h"
namespace ui {
+void CallbackLayerAnimationObserver::DummyAnimationStartedCallback(
+ const CallbackLayerAnimationObserver&) {}
+
+bool CallbackLayerAnimationObserver::DummyAnimationEndedCallback(
+ bool should_delete_observer,
+ const CallbackLayerAnimationObserver&) {
+ return should_delete_observer;
+}
+
CallbackLayerAnimationObserver::CallbackLayerAnimationObserver(
AnimationStartedCallback animation_started_callback,
AnimationEndedCallback animation_ended_callback)
- : active_(false),
- attached_sequence_count_(0),
- detached_sequence_count_(0),
- started_count_(0),
- aborted_count_(0),
- successful_count_(0),
- animation_started_callback_(animation_started_callback),
- animation_ended_callback_(animation_ended_callback),
- destroyed_(nullptr) {}
+ : animation_started_callback_(animation_started_callback),
+ animation_ended_callback_(animation_ended_callback) {}
+
+CallbackLayerAnimationObserver::CallbackLayerAnimationObserver(
+ AnimationStartedCallback animation_started_callback,
+ bool should_delete_observer)
+ : animation_started_callback_(animation_started_callback),
+ animation_ended_callback_(base::Bind(
+ &CallbackLayerAnimationObserver::DummyAnimationEndedCallback,
+ should_delete_observer)) {}
+
+CallbackLayerAnimationObserver::CallbackLayerAnimationObserver(
+ AnimationEndedCallback animation_ended_callback)
+ : animation_started_callback_(base::Bind(
+ &CallbackLayerAnimationObserver::DummyAnimationStartedCallback)),
+ animation_ended_callback_(animation_ended_callback) {}
CallbackLayerAnimationObserver::~CallbackLayerAnimationObserver() {
if (destroyed_)
« no previous file with comments | « ui/compositor/callback_layer_animation_observer.h ('k') | ui/compositor/callback_layer_animation_observer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698