| 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/shell.h" | 7 #include "ash/shell.h" |
| 8 #include "ash/wm/window_animations.h" | 8 #include "ash/wm/window_animations.h" |
| 9 #include "ash/wm/window_properties.h" | 9 #include "ash/wm/window_properties.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 | 12 |
| 13 namespace ash { | 13 namespace ash { |
| 14 namespace { | 14 namespace { |
| 15 bool GetChildWindowVisibilityChangesAnimated(aura::Window* window) { | 15 bool GetChildWindowVisibilityChangesAnimated(aura::Window* window) { |
| 16 if (!window) | 16 if (!window) |
| 17 return false; | 17 return false; |
| 18 return window->GetProperty( | 18 return window->GetProperty( |
| 19 internal::kChildWindowVisibilityChangesAnimatedKey); | 19 internal::kChildWindowVisibilityChangesAnimatedKey); |
| 20 } | 20 } |
| 21 } // namespace | 21 } // namespace |
| 22 | 22 |
| 23 namespace internal { | 23 namespace internal { |
| 24 | 24 |
| 25 VisibilityController::VisibilityController() { | 25 VisibilityController::VisibilityController() { |
| 26 aura::client::SetVisibilityClient(Shell::GetRootWindow(), this); | 26 aura::client::SetVisibilityClient(Shell::GetPrimaryRootWindow(), this); |
| 27 } | 27 } |
| 28 | 28 |
| 29 VisibilityController::~VisibilityController() { | 29 VisibilityController::~VisibilityController() { |
| 30 } | 30 } |
| 31 | 31 |
| 32 void VisibilityController::UpdateLayerVisibility(aura::Window* window, | 32 void VisibilityController::UpdateLayerVisibility(aura::Window* window, |
| 33 bool visible) { | 33 bool visible) { |
| 34 bool animated = GetChildWindowVisibilityChangesAnimated(window->parent()) && | 34 bool animated = GetChildWindowVisibilityChangesAnimated(window->parent()) && |
| 35 window->type() != aura::client::WINDOW_TYPE_CONTROL && | 35 window->type() != aura::client::WINDOW_TYPE_CONTROL && |
| 36 window->type() != aura::client::WINDOW_TYPE_UNKNOWN; | 36 window->type() != aura::client::WINDOW_TYPE_UNKNOWN; |
| (...skipping 15 matching lines...) Expand all Loading... |
| 52 window->layer()->SetVisible(visible); | 52 window->layer()->SetVisible(visible); |
| 53 } | 53 } |
| 54 | 54 |
| 55 } // namespace internal | 55 } // namespace internal |
| 56 | 56 |
| 57 void SetChildWindowVisibilityChangesAnimated(aura::Window* window) { | 57 void SetChildWindowVisibilityChangesAnimated(aura::Window* window) { |
| 58 window->SetProperty(internal::kChildWindowVisibilityChangesAnimatedKey, true); | 58 window->SetProperty(internal::kChildWindowVisibilityChangesAnimatedKey, true); |
| 59 } | 59 } |
| 60 | 60 |
| 61 } // namespace ash | 61 } // namespace ash |
| OLD | NEW |