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

Side by Side Diff: app/test_animation_delegate.h

Issue 1961001: Refactors animation to allow for cleaner subclassing. I'm doing this (Closed)
Patch Set: Incorporated review feedback Created 10 years, 7 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 unified diff | Download patch
« no previous file with comments | « app/slide_animation.cc ('k') | app/throb_animation.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef APP_TEST_ANIMATION_DELEGATE_H_ 5 #ifndef APP_TEST_ANIMATION_DELEGATE_H_
6 #define APP_TEST_ANIMATION_DELEGATE_H_ 6 #define APP_TEST_ANIMATION_DELEGATE_H_
7 7
8 #include "app/animation.h" 8 #include "app/animation.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 10
11 // Trivial AnimationDelegate implementation. AnimationEnded/Canceled quit the 11 // Trivial AnimationDelegate implementation. AnimationEnded/Canceled quit the
12 // message loop. 12 // message loop.
13 class TestAnimationDelegate : public AnimationDelegate { 13 class TestAnimationDelegate : public AnimationDelegate {
14 public: 14 public:
15 TestAnimationDelegate() : canceled_(false), finished_(false) { 15 TestAnimationDelegate() : canceled_(false), finished_(false) {
16 } 16 }
17 17
18 virtual void AnimationStarted(const Animation* animation) {
19 }
20
21 virtual void AnimationEnded(const Animation* animation) { 18 virtual void AnimationEnded(const Animation* animation) {
22 finished_ = true; 19 finished_ = true;
23 MessageLoop::current()->Quit(); 20 MessageLoop::current()->Quit();
24 } 21 }
25 22
26 virtual void AnimationCanceled(const Animation* animation) { 23 virtual void AnimationCanceled(const Animation* animation) {
27 finished_ = true; 24 finished_ = true;
28 canceled_ = true; 25 canceled_ = true;
29 MessageLoop::current()->Quit(); 26 MessageLoop::current()->Quit();
30 } 27 }
31 28
32 bool finished() const { 29 bool finished() const {
33 return finished_; 30 return finished_;
34 } 31 }
35 32
36 bool canceled() const { 33 bool canceled() const {
37 return canceled_; 34 return canceled_;
38 } 35 }
39 36
40 private: 37 private:
41 bool canceled_; 38 bool canceled_;
42 bool finished_; 39 bool finished_;
43 40
44 DISALLOW_COPY_AND_ASSIGN(TestAnimationDelegate); 41 DISALLOW_COPY_AND_ASSIGN(TestAnimationDelegate);
45 }; 42 };
46 43
47 #endif // APP_TEST_ANIMATION_DELEGATE_H_ 44 #endif // APP_TEST_ANIMATION_DELEGATE_H_
OLDNEW
« no previous file with comments | « app/slide_animation.cc ('k') | app/throb_animation.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698