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 "ash/wm/visibility_controller.h" | 5 #include "ash/wm/visibility_controller.h" |
6 | 6 |
7 #include "ash/wm/window_animations.h" | 7 #include "ash/wm/window_animations.h" |
8 #include "ui/aura/window.h" | 8 #include "ui/aura/window.h" |
9 | 9 |
10 namespace ash { | 10 namespace ash { |
(...skipping 17 matching lines...) Expand all Loading... |
28 } | 28 } |
29 | 29 |
30 VisibilityController::~VisibilityController() { | 30 VisibilityController::~VisibilityController() { |
31 } | 31 } |
32 | 32 |
33 void VisibilityController::UpdateLayerVisibility(aura::Window* window, | 33 void VisibilityController::UpdateLayerVisibility(aura::Window* window, |
34 bool visible) { | 34 bool visible) { |
35 bool animated = GetChildWindowVisibilityChangesAnimated(window->parent()) && | 35 bool animated = GetChildWindowVisibilityChangesAnimated(window->parent()) && |
36 window->type() != aura::client::WINDOW_TYPE_CONTROL && | 36 window->type() != aura::client::WINDOW_TYPE_CONTROL && |
37 window->type() != aura::client::WINDOW_TYPE_UNKNOWN; | 37 window->type() != aura::client::WINDOW_TYPE_UNKNOWN; |
38 if (animated) | 38 animated = animated && AnimateOnChildWindowVisibilityChanged(window, visible); |
39 AnimateOnChildWindowVisibilityChanged(window, visible); | |
40 | 39 |
41 // When a window is made visible, we always make its layer visible | 40 // When a window is made visible, we always make its layer visible |
42 // immediately. When a window is hidden, the layer must be left visible and | 41 // immediately. When a window is hidden, the layer must be left visible and |
43 // only made not visible once the animation is complete. | 42 // only made not visible once the animation is complete. |
44 if (!animated || visible) | 43 if (!animated || visible) |
45 window->layer()->SetVisible(visible); | 44 window->layer()->SetVisible(visible); |
46 } | 45 } |
47 | 46 |
48 } // namespace internal | 47 } // namespace internal |
49 | 48 |
50 void SetChildWindowVisibilityChangesAnimated(aura::Window* window) { | 49 void SetChildWindowVisibilityChangesAnimated(aura::Window* window) { |
51 window->SetIntProperty(internal::kChildWindowVisibilityChangesAnimated, 1); | 50 window->SetIntProperty(internal::kChildWindowVisibilityChangesAnimated, 1); |
52 } | 51 } |
53 | 52 |
54 } // namespace ash | 53 } // namespace ash |
OLD | NEW |