| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "ash/display/display_configurator_animation.h" | 5 #include "ash/display/display_configurator_animation.h" |
| 6 | 6 |
| 7 #include "ash/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "ash/shell_window_ids.h" | 8 #include "ash/shell_window_ids.h" |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 kFadingAnimationDurationInMS)); | 132 kFadingAnimationDurationInMS)); |
| 133 observer->AddNewAnimator(hiding_layer->GetAnimator()); | 133 observer->AddNewAnimator(hiding_layer->GetAnimator()); |
| 134 hiding_layer->SetOpacity(1.0f); | 134 hiding_layer->SetOpacity(1.0f); |
| 135 hiding_layer->SetVisible(true); | 135 hiding_layer->SetVisible(true); |
| 136 hiding_layers_[root_window] = hiding_layer; | 136 hiding_layers_[root_window] = hiding_layer; |
| 137 } | 137 } |
| 138 | 138 |
| 139 // In case that OnDisplayModeChanged() isn't called or its animator is | 139 // In case that OnDisplayModeChanged() isn't called or its animator is |
| 140 // canceled due to some unknown errors, we set a timer to clear these | 140 // canceled due to some unknown errors, we set a timer to clear these |
| 141 // hiding layers. | 141 // hiding layers. |
| 142 timer_.reset(new base::OneShotTimer<DisplayConfiguratorAnimation>()); | 142 timer_.reset(new base::OneShotTimer()); |
| 143 timer_->Start(FROM_HERE, | 143 timer_->Start(FROM_HERE, |
| 144 base::TimeDelta::FromSeconds(kFadingTimeoutDurationInSeconds), | 144 base::TimeDelta::FromSeconds(kFadingTimeoutDurationInSeconds), |
| 145 this, | 145 this, |
| 146 &DisplayConfiguratorAnimation::ClearHidingLayers); | 146 &DisplayConfiguratorAnimation::ClearHidingLayers); |
| 147 } | 147 } |
| 148 | 148 |
| 149 void DisplayConfiguratorAnimation::StartFadeInAnimation() { | 149 void DisplayConfiguratorAnimation::StartFadeInAnimation() { |
| 150 // We want to make sure clearing all of hiding layers after the animation | 150 // We want to make sure clearing all of hiding layers after the animation |
| 151 // finished. Note that this callback can be canceled, but the cancel only | 151 // finished. Note that this callback can be canceled, but the cancel only |
| 152 // happens when the next animation is scheduled. Thus the hiding layers | 152 // happens when the next animation is scheduled. Thus the hiding layers |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 if (timer_) { | 218 if (timer_) { |
| 219 timer_->Stop(); | 219 timer_->Stop(); |
| 220 timer_.reset(); | 220 timer_.reset(); |
| 221 } | 221 } |
| 222 STLDeleteContainerPairSecondPointers( | 222 STLDeleteContainerPairSecondPointers( |
| 223 hiding_layers_.begin(), hiding_layers_.end()); | 223 hiding_layers_.begin(), hiding_layers_.end()); |
| 224 hiding_layers_.clear(); | 224 hiding_layers_.clear(); |
| 225 } | 225 } |
| 226 | 226 |
| 227 } // namespace ash | 227 } // namespace ash |
| OLD | NEW |