OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "ui/views/widget/window_visibility_animation_aura.h" |
| 6 |
| 7 #include "ui/wm/core/window_animations.h" |
| 8 |
| 9 namespace views { |
| 10 |
| 11 WindowVisibilityAnimationAura::WindowVisibilityAnimationAura( |
| 12 aura::Window* window) |
| 13 : window_(window) { |
| 14 DCHECK(window); |
| 15 } |
| 16 |
| 17 WindowVisibilityAnimationAura::~WindowVisibilityAnimationAura() { |
| 18 } |
| 19 |
| 20 void WindowVisibilityAnimationAura::SetDuration( |
| 21 const base::TimeDelta& duration) { |
| 22 wm::SetWindowVisibilityAnimationDuration(window_, duration); |
| 23 } |
| 24 |
| 25 void WindowVisibilityAnimationAura::SetTransition(Transition transition) { |
| 26 wm::WindowVisibilityAnimationTransition wm_transition; |
| 27 switch (transition) { |
| 28 case ANIMATE_SHOW: |
| 29 wm_transition = wm::ANIMATE_SHOW; |
| 30 case ANIMATE_HIDE: |
| 31 wm_transition = wm::ANIMATE_HIDE; |
| 32 case ANIMATE_BOTH: |
| 33 wm_transition = wm::ANIMATE_BOTH; |
| 34 case ANIMATE_NONE: |
| 35 wm_transition = wm::ANIMATE_NONE; |
| 36 } |
| 37 wm::SetWindowVisibilityAnimationTransition(window_, wm_transition); |
| 38 } |
| 39 |
| 40 } // namespace views |
OLD | NEW |