| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 #include "ui/views/corewm/visibility_controller.h" | 5 #include "ui/views/corewm/visibility_controller.h" |
| 6 | 6 |
| 7 #include "ui/aura/window.h" | 7 #include "ui/aura/window.h" |
| 8 #include "ui/aura/window_property.h" | 8 #include "ui/aura/window_property.h" |
| 9 #include "ui/compositor/layer.h" | 9 #include "ui/compositor/layer.h" |
| 10 #include "ui/views/corewm/window_animations.h" | 10 #include "ui/views/corewm/window_animations.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 } | 33 } |
| 34 | 34 |
| 35 bool VisibilityController::CallAnimateOnChildWindowVisibilityChanged( | 35 bool VisibilityController::CallAnimateOnChildWindowVisibilityChanged( |
| 36 aura::Window* window, | 36 aura::Window* window, |
| 37 bool visible) { | 37 bool visible) { |
| 38 return AnimateOnChildWindowVisibilityChanged(window, visible); | 38 return AnimateOnChildWindowVisibilityChanged(window, visible); |
| 39 } | 39 } |
| 40 | 40 |
| 41 void VisibilityController::UpdateLayerVisibility(aura::Window* window, | 41 void VisibilityController::UpdateLayerVisibility(aura::Window* window, |
| 42 bool visible) { | 42 bool visible) { |
| 43 bool animated = window->type() != aura::client::WINDOW_TYPE_CONTROL && | 43 bool animated = window->type() != ui::wm::WINDOW_TYPE_CONTROL && |
| 44 window->type() != aura::client::WINDOW_TYPE_UNKNOWN && | 44 window->type() != ui::wm::WINDOW_TYPE_UNKNOWN && |
| 45 ShouldAnimateWindow(window); | 45 ShouldAnimateWindow(window); |
| 46 animated = animated && | 46 animated = animated && |
| 47 CallAnimateOnChildWindowVisibilityChanged(window, visible); | 47 CallAnimateOnChildWindowVisibilityChanged(window, visible); |
| 48 | 48 |
| 49 if (!visible) { | 49 if (!visible) { |
| 50 // For window hiding animation, we want to check if the window is already | 50 // For window hiding animation, we want to check if the window is already |
| 51 // animating, and not do SetVisible(false) if it is. | 51 // animating, and not do SetVisible(false) if it is. |
| 52 // TODO(vollick): remove this. | 52 // TODO(vollick): remove this. |
| 53 animated = animated || (window->layer()->GetAnimator()-> | 53 animated = animated || (window->layer()->GetAnimator()-> |
| 54 IsAnimatingProperty(ui::LayerAnimationElement::OPACITY) && | 54 IsAnimatingProperty(ui::LayerAnimationElement::OPACITY) && |
| (...skipping 23 matching lines...) Expand all Loading... |
| 78 window_->ClearProperty(kChildWindowVisibilityChangesAnimatedKey); | 78 window_->ClearProperty(kChildWindowVisibilityChangesAnimatedKey); |
| 79 } | 79 } |
| 80 | 80 |
| 81 void SetChildWindowVisibilityChangesAnimated(aura::Window* window) { | 81 void SetChildWindowVisibilityChangesAnimated(aura::Window* window) { |
| 82 window->SetProperty(kChildWindowVisibilityChangesAnimatedKey, true); | 82 window->SetProperty(kChildWindowVisibilityChangesAnimatedKey, true); |
| 83 } | 83 } |
| 84 | 84 |
| 85 } // namespace corewm | 85 } // namespace corewm |
| 86 } // namespace views | 86 } // namespace views |
| 87 | 87 |
| OLD | NEW |