OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef APP_TEST_ANIMATION_DELEGATE_H_ |
| 6 #define APP_TEST_ANIMATION_DELEGATE_H_ |
| 7 |
| 8 #include "app/animation.h" |
| 9 #include "base/message_loop.h" |
| 10 |
| 11 // Trivial AnimationDelegate implementation. AnimationEnded/Canceled quit the |
| 12 // message loop. |
| 13 class TestAnimationDelegate : public AnimationDelegate { |
| 14 public: |
| 15 TestAnimationDelegate() : canceled_(false), finished_(false) { |
| 16 } |
| 17 |
| 18 virtual void AnimationStarted(const Animation* animation) { |
| 19 } |
| 20 |
| 21 virtual void AnimationEnded(const Animation* animation) { |
| 22 finished_ = true; |
| 23 MessageLoop::current()->Quit(); |
| 24 } |
| 25 |
| 26 virtual void AnimationCanceled(const Animation* animation) { |
| 27 finished_ = true; |
| 28 canceled_ = true; |
| 29 MessageLoop::current()->Quit(); |
| 30 } |
| 31 |
| 32 bool finished() const { |
| 33 return finished_; |
| 34 } |
| 35 |
| 36 bool canceled() const { |
| 37 return canceled_; |
| 38 } |
| 39 |
| 40 private: |
| 41 bool canceled_; |
| 42 bool finished_; |
| 43 |
| 44 DISALLOW_COPY_AND_ASSIGN(TestAnimationDelegate); |
| 45 }; |
| 46 |
| 47 #endif // APP_TEST_ANIMATION_DELEGATE_H_ |
OLD | NEW |