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

Unified Diff: app/test_animation_delegate.h

Issue 1575011: Adds AnimationContainer, which can be used to group a set of (Closed)
Patch Set: Incorporated review feedback Created 10 years, 9 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: app/test_animation_delegate.h
diff --git a/app/test_animation_delegate.h b/app/test_animation_delegate.h
new file mode 100644
index 0000000000000000000000000000000000000000..76f0f3e289111db2da687508ebefc6080a8a6e3a
--- /dev/null
+++ b/app/test_animation_delegate.h
@@ -0,0 +1,47 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef APP_TEST_ANIMATION_DELEGATE_H_
+#define APP_TEST_ANIMATION_DELEGATE_H_
+
+#include "app/animation.h"
+#include "base/message_loop.h"
+
+// Trivial AnimationDelegate implementation. AnimationEnded/Canceled quit the
+// message loop.
+class TestAnimationDelegate : public AnimationDelegate {
+ public:
+ TestAnimationDelegate() : canceled_(false), finished_(false) {
+ }
+
+ virtual void AnimationStarted(const Animation* animation) {
+ }
+
+ virtual void AnimationEnded(const Animation* animation) {
+ finished_ = true;
+ MessageLoop::current()->Quit();
+ }
+
+ virtual void AnimationCanceled(const Animation* animation) {
+ finished_ = true;
+ canceled_ = true;
+ MessageLoop::current()->Quit();
+ }
+
+ bool finished() const {
+ return finished_;
+ }
+
+ bool canceled() const {
+ return canceled_;
+ }
+
+ private:
+ bool canceled_;
+ bool finished_;
+
+ DISALLOW_COPY_AND_ASSIGN(TestAnimationDelegate);
+};
+
+#endif // APP_TEST_ANIMATION_DELEGATE_H_
« no previous file with comments | « app/slide_animation.h ('k') | app/throb_animation.h » ('j') | views/animation/bounds_animator.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698