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 "ui/aura/window.h" | 10 #include "ui/aura/window.h" |
10 #include "ui/aura/window_property.h" | |
11 #include "ui/compositor/layer.h" | 11 #include "ui/compositor/layer.h" |
12 | 12 |
13 DECLARE_WINDOW_PROPERTY_TYPE(bool) | |
14 | |
15 namespace ash { | 13 namespace ash { |
16 namespace internal { | |
17 // Property set on all windows whose child windows' visibility changes are | |
18 // animated. | |
19 DEFINE_LOCAL_WINDOW_PROPERTY_KEY( | |
20 bool, kChildWindowVisibilityChangesAnimatedKey, false); | |
21 | |
22 namespace { | 14 namespace { |
23 | |
24 bool GetChildWindowVisibilityChangesAnimated(aura::Window* window) { | 15 bool GetChildWindowVisibilityChangesAnimated(aura::Window* window) { |
25 if (!window) | 16 if (!window) |
26 return false; | 17 return false; |
27 return window->GetProperty(kChildWindowVisibilityChangesAnimatedKey); | 18 return window->GetProperty( |
| 19 internal::kChildWindowVisibilityChangesAnimatedKey); |
28 } | 20 } |
| 21 } // namespace |
29 | 22 |
30 } // namespace | 23 namespace internal { |
31 | 24 |
32 VisibilityController::VisibilityController() { | 25 VisibilityController::VisibilityController() { |
33 aura::client::SetVisibilityClient(Shell::GetRootWindow(), this); | 26 aura::client::SetVisibilityClient(Shell::GetRootWindow(), this); |
34 } | 27 } |
35 | 28 |
36 VisibilityController::~VisibilityController() { | 29 VisibilityController::~VisibilityController() { |
37 } | 30 } |
38 | 31 |
39 void VisibilityController::UpdateLayerVisibility(aura::Window* window, | 32 void VisibilityController::UpdateLayerVisibility(aura::Window* window, |
40 bool visible) { | 33 bool visible) { |
(...skipping 18 matching lines...) Expand all Loading... |
59 window->layer()->SetVisible(visible); | 52 window->layer()->SetVisible(visible); |
60 } | 53 } |
61 | 54 |
62 } // namespace internal | 55 } // namespace internal |
63 | 56 |
64 void SetChildWindowVisibilityChangesAnimated(aura::Window* window) { | 57 void SetChildWindowVisibilityChangesAnimated(aura::Window* window) { |
65 window->SetProperty(internal::kChildWindowVisibilityChangesAnimatedKey, true); | 58 window->SetProperty(internal::kChildWindowVisibilityChangesAnimatedKey, true); |
66 } | 59 } |
67 | 60 |
68 } // namespace ash | 61 } // namespace ash |
OLD | NEW |