| 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/wm/overview/scoped_overview_animation_settings_aura.h" | 5 #include "ash/wm/overview/scoped_overview_animation_settings.h" |
| 6 | 6 |
| 7 #include "base/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
| 8 #include "base/metrics/histogram_macros.h" | 8 #include "base/metrics/histogram_macros.h" |
| 9 #include "base/time/time.h" | 9 #include "base/time/time.h" |
| 10 #include "ui/aura/window.h" | 10 #include "ui/aura/window.h" |
| 11 #include "ui/compositor/layer.h" | 11 #include "ui/compositor/layer.h" |
| 12 #include "ui/compositor/layer_animation_observer.h" | 12 #include "ui/compositor/layer_animation_observer.h" |
| 13 #include "ui/compositor/scoped_layer_animation_settings.h" | 13 #include "ui/compositor/scoped_layer_animation_settings.h" |
| 14 #include "ui/gfx/animation/tween.h" | 14 #include "ui/gfx/animation/tween.h" |
| 15 | 15 |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 case OVERVIEW_ANIMATION_CLOSING_SELECTOR_ITEM: | 116 case OVERVIEW_ANIMATION_CLOSING_SELECTOR_ITEM: |
| 117 case OVERVIEW_ANIMATION_CLOSE_SELECTOR_ITEM: | 117 case OVERVIEW_ANIMATION_CLOSE_SELECTOR_ITEM: |
| 118 return g_reporter_close.Pointer(); | 118 return g_reporter_close.Pointer(); |
| 119 } | 119 } |
| 120 NOTREACHED(); | 120 NOTREACHED(); |
| 121 return nullptr; | 121 return nullptr; |
| 122 } | 122 } |
| 123 | 123 |
| 124 } // namespace | 124 } // namespace |
| 125 | 125 |
| 126 ScopedOverviewAnimationSettingsAura::ScopedOverviewAnimationSettingsAura( | 126 ScopedOverviewAnimationSettings::ScopedOverviewAnimationSettings( |
| 127 OverviewAnimationType animation_type, | 127 OverviewAnimationType animation_type, |
| 128 aura::Window* window) | 128 aura::Window* window) |
| 129 : animation_settings_(new ui::ScopedLayerAnimationSettings( | 129 : animation_settings_(new ui::ScopedLayerAnimationSettings( |
| 130 window->layer()->GetAnimator())) { | 130 window->layer()->GetAnimator())) { |
| 131 switch (animation_type) { | 131 switch (animation_type) { |
| 132 case OVERVIEW_ANIMATION_NONE: | 132 case OVERVIEW_ANIMATION_NONE: |
| 133 animation_settings_->SetPreemptionStrategy( | 133 animation_settings_->SetPreemptionStrategy( |
| 134 ui::LayerAnimator::REPLACE_QUEUED_ANIMATIONS); | 134 ui::LayerAnimator::REPLACE_QUEUED_ANIMATIONS); |
| 135 break; | 135 break; |
| 136 case OVERVIEW_ANIMATION_ENTER_OVERVIEW_MODE_FADE_IN: | 136 case OVERVIEW_ANIMATION_ENTER_OVERVIEW_MODE_FADE_IN: |
| (...skipping 21 matching lines...) Expand all Loading... |
| 158 ui::LayerAnimator::ENQUEUE_NEW_ANIMATION); | 158 ui::LayerAnimator::ENQUEUE_NEW_ANIMATION); |
| 159 animation_settings_->SetTweenType(gfx::Tween::EASE_OUT); | 159 animation_settings_->SetTweenType(gfx::Tween::EASE_OUT); |
| 160 break; | 160 break; |
| 161 } | 161 } |
| 162 animation_settings_->SetTransitionDuration( | 162 animation_settings_->SetTransitionDuration( |
| 163 GetAnimationDuration(animation_type)); | 163 GetAnimationDuration(animation_type)); |
| 164 animation_settings_->SetAnimationMetricsReporter( | 164 animation_settings_->SetAnimationMetricsReporter( |
| 165 GetMetricsReporter(animation_type)); | 165 GetMetricsReporter(animation_type)); |
| 166 } | 166 } |
| 167 | 167 |
| 168 ScopedOverviewAnimationSettingsAura::~ScopedOverviewAnimationSettingsAura() {} | 168 ScopedOverviewAnimationSettings::~ScopedOverviewAnimationSettings() {} |
| 169 | 169 |
| 170 void ScopedOverviewAnimationSettingsAura::AddObserver( | 170 void ScopedOverviewAnimationSettings::AddObserver( |
| 171 ui::ImplicitAnimationObserver* observer) { | 171 ui::ImplicitAnimationObserver* observer) { |
| 172 animation_settings_->AddObserver(observer); | 172 animation_settings_->AddObserver(observer); |
| 173 } | 173 } |
| 174 | 174 |
| 175 } // namespace ash | 175 } // namespace ash |
| OLD | NEW |