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 #pragma once | |
8 | |
9 #include "app/animation_delegate.h" | |
10 #include "base/message_loop.h" | |
11 | |
12 // Trivial AnimationDelegate implementation. AnimationEnded/Canceled quit the | |
13 // message loop. | |
14 class TestAnimationDelegate : public AnimationDelegate { | |
15 public: | |
16 TestAnimationDelegate() : canceled_(false), finished_(false) { | |
17 } | |
18 | |
19 virtual void AnimationEnded(const Animation* animation) { | |
20 finished_ = true; | |
21 MessageLoop::current()->Quit(); | |
22 } | |
23 | |
24 virtual void AnimationCanceled(const Animation* animation) { | |
25 finished_ = true; | |
26 canceled_ = true; | |
27 MessageLoop::current()->Quit(); | |
28 } | |
29 | |
30 bool finished() const { | |
31 return finished_; | |
32 } | |
33 | |
34 bool canceled() const { | |
35 return canceled_; | |
36 } | |
37 | |
38 private: | |
39 bool canceled_; | |
40 bool finished_; | |
41 | |
42 DISALLOW_COPY_AND_ASSIGN(TestAnimationDelegate); | |
43 }; | |
44 | |
45 #endif // APP_TEST_ANIMATION_DELEGATE_H_ | |
OLD | NEW |