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

Side by Side Diff: cc/input/scrollbar_animation_controller.h

Issue 2442573002: Implement fade-out animation for Aura overlay scrollbars (CC only). (Closed)
Patch Set: Few more fixes Created 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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 CC_INPUT_SCROLLBAR_ANIMATION_CONTROLLER_H_ 5 #ifndef CC_INPUT_SCROLLBAR_ANIMATION_CONTROLLER_H_
6 #define CC_INPUT_SCROLLBAR_ANIMATION_CONTROLLER_H_ 6 #define CC_INPUT_SCROLLBAR_ANIMATION_CONTROLLER_H_
7 7
8 #include "base/cancelable_callback.h" 8 #include "base/cancelable_callback.h"
9 #include "base/memory/weak_ptr.h" 9 #include "base/memory/weak_ptr.h"
10 #include "base/time/time.h" 10 #include "base/time/time.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 base::TimeDelta duration); 54 base::TimeDelta duration);
55 55
56 virtual void RunAnimationFrame(float progress) = 0; 56 virtual void RunAnimationFrame(float progress) = 0;
57 57
58 void StartAnimation(); 58 void StartAnimation();
59 void StopAnimation(); 59 void StopAnimation();
60 ScrollbarSet Scrollbars() const; 60 ScrollbarSet Scrollbars() const;
61 61
62 ScrollbarAnimationControllerClient* client_; 62 ScrollbarAnimationControllerClient* client_;
63 63
64 void PostDelayedAnimationTask(bool on_resize);
65
66 base::TimeDelta duration_;
aelias_OOO_until_Jul13 2016/10/20 23:40:51 Could you replace this with a pure virtual getter,
bokan 2016/10/21 00:32:30 You mean move the state into both descendant class
67
64 private: 68 private:
65 // Returns how far through the animation we are as a progress value from 69 // Returns how far through the animation we are as a progress value from
66 // 0 to 1. 70 // 0 to 1.
67 float AnimationProgressAtTime(base::TimeTicks now); 71 float AnimationProgressAtTime(base::TimeTicks now);
68 72
69 void PostDelayedAnimationTask(bool on_resize);
70
71 base::TimeTicks last_awaken_time_; 73 base::TimeTicks last_awaken_time_;
72 base::TimeDelta delay_before_starting_; 74 base::TimeDelta delay_before_starting_;
73 base::TimeDelta resize_delay_before_starting_; 75 base::TimeDelta resize_delay_before_starting_;
74 base::TimeDelta duration_;
75 76
76 bool is_animating_; 77 bool is_animating_;
77 78
78 int scroll_layer_id_; 79 int scroll_layer_id_;
79 bool currently_scrolling_; 80 bool currently_scrolling_;
80 bool scroll_gesture_has_scrolled_; 81 bool scroll_gesture_has_scrolled_;
81 base::CancelableClosure delayed_scrollbar_fade_; 82 base::CancelableClosure delayed_scrollbar_fade_;
82 83
83 base::WeakPtrFactory<ScrollbarAnimationController> weak_factory_; 84 base::WeakPtrFactory<ScrollbarAnimationController> weak_factory_;
84 }; 85 };
85 86
86 } // namespace cc 87 } // namespace cc
87 88
88 #endif // CC_INPUT_SCROLLBAR_ANIMATION_CONTROLLER_H_ 89 #endif // CC_INPUT_SCROLLBAR_ANIMATION_CONTROLLER_H_
OLDNEW
« no previous file with comments | « no previous file | cc/input/scrollbar_animation_controller.cc » ('j') | cc/input/scrollbar_animation_controller.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698