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

Unified Diff: ui/base/animation/animation_container.cc

Issue 11453012: Fix black background when locking with fullscreen window: (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Add fix for shutdown cut-off timing Created 8 years 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: ui/base/animation/animation_container.cc
diff --git a/ui/base/animation/animation_container.cc b/ui/base/animation/animation_container.cc
index c82d26b9aa5048ea9cdd69b7b7a389dfdb08eebe..f404b7bfbf25e221a27c774d961350787feb5dbc 100644
--- a/ui/base/animation/animation_container.cc
+++ b/ui/base/animation/animation_container.cc
@@ -14,7 +14,8 @@ namespace ui {
AnimationContainer::AnimationContainer()
: last_tick_time_(TimeTicks::Now()),
- observer_(NULL) {
+ observer_(NULL),
+ test_timing_enabled_(false) {
}
AnimationContainer::~AnimationContainer() {
@@ -28,7 +29,7 @@ void AnimationContainer::Start(AnimationContainerElement* element) {
// element isn't running.
if (elements_.empty()) {
- last_tick_time_ = TimeTicks::Now();
+ last_tick_time_ = GetCurrentTime();
SetMinTimerInterval(element->GetTimerInterval());
} else if (element->GetTimerInterval() < min_timer_interval_) {
SetMinTimerInterval(element->GetTimerInterval());
@@ -61,7 +62,7 @@ void AnimationContainer::Run() {
// ourself here to make sure we're still valid after running all the elements.
scoped_refptr<AnimationContainer> this_ref(this);
- TimeTicks current_time = TimeTicks::Now();
+ TimeTicks current_time = GetCurrentTime();
last_tick_time_ = current_time;
@@ -101,4 +102,10 @@ TimeDelta AnimationContainer::GetMinInterval() {
return min;
}
+TimeTicks AnimationContainer::GetCurrentTime() {
+ if (test_timing_enabled_)
+ return test_time_;
+ return TimeTicks::Now();
+}
+
} // namespace ui

Powered by Google App Engine
This is Rietveld 408576698